All of lore.kernel.org
 help / color / mirror / Atom feed
From: Atsushi Nemoto <atsushi.nemoto@sord.co.jp>
To: jkacur@redhat.com
Cc: linux-rt-users@vger.kernel.org
Subject: Re: [rteval PATCH] rteval: stressng.py: Fix argument passing to Popen
Date: Fri, 30 Jul 2021 13:35:08 +0900 (JST)	[thread overview]
Message-ID: <20210730.133508.2236677766467322522.atsushi.nemoto@sord.co.jp> (raw)
In-Reply-To: <f3f2dd4-733-2bcf-1c4a-5d7cfb2b6fbf@redhat.com>

On Thu, 29 Jul 2021 19:10:37 -0400 (EDT), John Kacur <jkacur@redhat.com> wrote:
> On Thu, 29 Jul 2021, Atsushi Nemoto wrote:
>> On Wed, 28 Jul 2021 17:38:05 -0400 (EDT), John Kacur <jkacur@redhat.com> wrote:
>> >> -            self.process = subprocess.Popen(self.args,
>> >> +            self.process = subprocess.Popen(" ".join(self.args), shell=True,
>> >>                                              stdout=self.__out,
>> >>                                              stderr=self.__err,
>> >>                                              stdin=self.__in)
>> >> -- 
>> > 
>> > I don't see the need to do this here and in fact there are some security 
>> > implications to using shell=True. Is there a reason you want to do this?
>> 
>> I want to pass multiple options using --stressng-arg.
>> 
>> And also, there are elements with spaces in self.args already:
>> "--timeout %s" and "--taskset %s".
> 
> Running stress-ng as a load in rteval is fairly new and purposely 
> contrained so far. So, you can't run multiple tests right now.
> However most of what you want to do is already possible.

I just want to pass some additional option like "--memcpy-method=libc"
using stressng-arg.

    rteval --stressng-option=memcpy --stressng-arg="8 --memcpy-method=libc"

> stress-ng is like any other load so you can specify the taskset like this
> --loads-cpulist='0-4'
> 
> If you want for example to run the stress-ng memcpy test with an argument 
> of N=8 for 8 workers with a timeout of ten seconds you do this
> 
> rteval -d1m --loads-cpulist='0-4' --stressng-option=memcpy 
> --stressng-arg=8 --stressng-timeout=10
> 
> which will result in rteval running the following command
> stress-ng --memcpy 8 --timeout 10 --taskset 0,1,2,3,4

In this case, the self.args will be:

	["stress-ng", "--memcpy", "8", "--timeout 10", "--taskset 0,1,2,3,4"]

and will cause "stress-ng: unrecognized option '--timeout 10'" error.

If "shell=True" is not acceptable, how about this?

    self.process = subprocess.Popen(" ".join(self.args).split(),

---
Atsushi Nemoto

  reply	other threads:[~2021-07-30  4:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-28 11:19 [rteval PATCH] rteval: stressng.py: Fix argument passing to Popen Atsushi Nemoto
2021-07-28 21:38 ` John Kacur
2021-07-29  0:23   ` Atsushi Nemoto
2021-07-29 23:10     ` John Kacur
2021-07-30  4:35       ` Atsushi Nemoto [this message]
2021-08-06  8:45         ` Atsushi Nemoto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210730.133508.2236677766467322522.atsushi.nemoto@sord.co.jp \
    --to=atsushi.nemoto@sord.co.jp \
    --cc=jkacur@redhat.com \
    --cc=linux-rt-users@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.