diff mbox series

[rteval] rteval: stressng.py: Fix arguments for Popen

Message ID 20210806.174641.1741870399325228428.atsushi.nemoto@sord.co.jp
State New
Headers show
Series [rteval] rteval: stressng.py: Fix arguments for Popen | expand

Commit Message

Atsushi Nemoto Aug. 6, 2021, 8:46 a.m. UTC
Make each element of self.args contains only one argument.

Signed-off-by: Atsushi Nemoto <atsushi.nemoto@sord.co.jp>
---
 rteval/modules/loads/stressng.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Atsushi Nemoto Sept. 14, 2021, 4:45 a.m. UTC | #1
On Fri, 06 Aug 2021 17:46:41 +0900 (JST), Atsushi Nemoto <atsushi.nemoto@sord.co.jp> wrote:
> Make each element of self.args contains only one argument.

> 

> Signed-off-by: Atsushi Nemoto <atsushi.nemoto@sord.co.jp>

> ---

>  rteval/modules/loads/stressng.py | 6 +++---

>  1 file changed, 3 insertions(+), 3 deletions(-)

> 

> diff --git a/rteval/modules/loads/stressng.py b/rteval/modules/loads/stressng.py

> index 926de38..c259554 100644

> --- a/rteval/modules/loads/stressng.py

> +++ b/rteval/modules/loads/stressng.py

> @@ -50,9 +50,9 @@ class Stressng(CommandLineLoad):

>          self.args = ['stress-ng']

>          self.args.append('--%s' % str(self.cfg.option))

>          if self.cfg.arg is not None:

> -            self.args.append(self.cfg.arg)

> +            self.args.extend(self.cfg.arg.split())

>          if self.cfg.timeout is not None:

> -            self.args.append('--timeout %s' % str(self.cfg.timeout))

> +            self.args.extend(['--timeout', str(self.cfg.timeout)])

>  

>          systop = SysTopology()

>          # get the number of nodes

> @@ -74,7 +74,7 @@ class Stressng(CommandLineLoad):

>          if self.cpulist:

>              for node in nodes:

>                  cpulist = ",".join([str(n) for n in cpus[node]])

> -                self.args.append('--taskset %s' % cpulist)

> +                self.args.extend(['--taskset', cpulist])

>  

>      def _WorkloadTask(self):

>          """ Kick of the workload here """

> -- 

> 2.11.0


Any comments?

There is an another problem in '--taskset' handling (do not work as
expected on multi-node system) so I want to create a patch on top of
this fix.

---
Atsushi Nemoto
John Kacur Sept. 14, 2021, 12:51 p.m. UTC | #2
On Tue, 14 Sep 2021, Atsushi Nemoto wrote:

> On Fri, 06 Aug 2021 17:46:41 +0900 (JST), Atsushi Nemoto <atsushi.nemoto@sord.co.jp> wrote:

> > Make each element of self.args contains only one argument.

> > 

> > Signed-off-by: Atsushi Nemoto <atsushi.nemoto@sord.co.jp>

> > ---

> >  rteval/modules/loads/stressng.py | 6 +++---

> >  1 file changed, 3 insertions(+), 3 deletions(-)

> > 

> > diff --git a/rteval/modules/loads/stressng.py b/rteval/modules/loads/stressng.py

> > index 926de38..c259554 100644

> > --- a/rteval/modules/loads/stressng.py

> > +++ b/rteval/modules/loads/stressng.py

> > @@ -50,9 +50,9 @@ class Stressng(CommandLineLoad):

> >          self.args = ['stress-ng']

> >          self.args.append('--%s' % str(self.cfg.option))

> >          if self.cfg.arg is not None:

> > -            self.args.append(self.cfg.arg)

> > +            self.args.extend(self.cfg.arg.split())

> >          if self.cfg.timeout is not None:

> > -            self.args.append('--timeout %s' % str(self.cfg.timeout))

> > +            self.args.extend(['--timeout', str(self.cfg.timeout)])

> >  

> >          systop = SysTopology()

> >          # get the number of nodes

> > @@ -74,7 +74,7 @@ class Stressng(CommandLineLoad):

> >          if self.cpulist:

> >              for node in nodes:

> >                  cpulist = ",".join([str(n) for n in cpus[node]])

> > -                self.args.append('--taskset %s' % cpulist)

> > +                self.args.extend(['--taskset', cpulist])

> >  

> >      def _WorkloadTask(self):

> >          """ Kick of the workload here """

> > -- 

> > 2.11.0

> 

> Any comments?

> 

> There is an another problem in '--taskset' handling (do not work as

> expected on multi-node system) so I want to create a patch on top of

> this fix.

> 

> ---

> Atsushi Nemoto

> 


You haven't convinced me to apply the first patch - yet anyway, so you can 
decide yourself whether to create a version 2 that incorporates your new 
idea or whether they belong in to separate commits.

Thanks

John
Atsushi Nemoto Sept. 14, 2021, 1:42 p.m. UTC | #3
On Tue, 14 Sep 2021 08:51:02 -0400 (EDT), John Kacur <jkacur@redhat.com> wrote:
> 

> 

> On Tue, 14 Sep 2021, Atsushi Nemoto wrote:

> 

>> On Fri, 06 Aug 2021 17:46:41 +0900 (JST), Atsushi Nemoto <atsushi.nemoto@sord.co.jp> wrote:

>> > Make each element of self.args contains only one argument.

>> > 

>> > Signed-off-by: Atsushi Nemoto <atsushi.nemoto@sord.co.jp>

>> > ---

>> >  rteval/modules/loads/stressng.py | 6 +++---

>> >  1 file changed, 3 insertions(+), 3 deletions(-)

>> > 

>> > diff --git a/rteval/modules/loads/stressng.py b/rteval/modules/loads/stressng.py

>> > index 926de38..c259554 100644

>> > --- a/rteval/modules/loads/stressng.py

>> > +++ b/rteval/modules/loads/stressng.py

>> > @@ -50,9 +50,9 @@ class Stressng(CommandLineLoad):

>> >          self.args = ['stress-ng']

>> >          self.args.append('--%s' % str(self.cfg.option))

>> >          if self.cfg.arg is not None:

>> > -            self.args.append(self.cfg.arg)

>> > +            self.args.extend(self.cfg.arg.split())

>> >          if self.cfg.timeout is not None:

>> > -            self.args.append('--timeout %s' % str(self.cfg.timeout))

>> > +            self.args.extend(['--timeout', str(self.cfg.timeout)])

>> >  

>> >          systop = SysTopology()

>> >          # get the number of nodes

>> > @@ -74,7 +74,7 @@ class Stressng(CommandLineLoad):

>> >          if self.cpulist:

>> >              for node in nodes:

>> >                  cpulist = ",".join([str(n) for n in cpus[node]])

>> > -                self.args.append('--taskset %s' % cpulist)

>> > +                self.args.extend(['--taskset', cpulist])

>> >  

>> >      def _WorkloadTask(self):

>> >          """ Kick of the workload here """

>> > -- 

>> > 2.11.0

>> 

>> Any comments?

>> 

>> There is an another problem in '--taskset' handling (do not work as

>> expected on multi-node system) so I want to create a patch on top of

>> this fix.

>> 

>> ---

>> Atsushi Nemoto

>> 

> 

> You haven't convinced me to apply the first patch - yet anyway, so you can 

> decide yourself whether to create a version 2 that incorporates your new 

> idea or whether they belong in to separate commits.

> 

> Thanks

> 

> John


Thank you, I will send revised patches with a bit more detailed description.

---
Atsushi Nemoto
diff mbox series

Patch

diff --git a/rteval/modules/loads/stressng.py b/rteval/modules/loads/stressng.py
index 926de38..c259554 100644
--- a/rteval/modules/loads/stressng.py
+++ b/rteval/modules/loads/stressng.py
@@ -50,9 +50,9 @@  class Stressng(CommandLineLoad):
         self.args = ['stress-ng']
         self.args.append('--%s' % str(self.cfg.option))
         if self.cfg.arg is not None:
-            self.args.append(self.cfg.arg)
+            self.args.extend(self.cfg.arg.split())
         if self.cfg.timeout is not None:
-            self.args.append('--timeout %s' % str(self.cfg.timeout))
+            self.args.extend(['--timeout', str(self.cfg.timeout)])
 
         systop = SysTopology()
         # get the number of nodes
@@ -74,7 +74,7 @@  class Stressng(CommandLineLoad):
         if self.cpulist:
             for node in nodes:
                 cpulist = ",".join([str(n) for n in cpus[node]])
-                self.args.append('--taskset %s' % cpulist)
+                self.args.extend(['--taskset', cpulist])
 
     def _WorkloadTask(self):
         """ Kick of the workload here """