public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
	Ian Rogers <irogers@google.com>,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org
Subject: Re: [PATCH V3] perf scripts python: Add a script to run instances of perf script in parallel
Date: Fri, 26 Apr 2024 18:24:12 +0300	[thread overview]
Message-ID: <1e2bee89-0a4a-42e3-9f81-bd7296cfb351@intel.com> (raw)
In-Reply-To: <ZiuiiFdPhJIrjI7k@x1>

On 26/04/24 15:48, Arnaldo Carvalho de Melo wrote:
> On Wed, Apr 24, 2024 at 11:15:11AM -0300, Arnaldo Carvalho de Melo wrote:
>> On Tue, Apr 23, 2024 at 04:33:53PM -0700, Andi Kleen wrote:
>>> On Tue, Apr 23, 2024 at 04:32:48PM +0300, Adrian Hunter wrote:
>>>> The script is useful for Intel PT traces, that can be efficiently
>>>> decoded by perf script when split by CPU and/or time ranges. Running
>>>> jobs in parallel can decrease the overall decoding time.
> 
>>>> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
> 
>>> Reviewed-by: Andi Kleen <ak@linux.intel.com>
> 
>> Thanks, applied, and added a note on testing it using:
> 
> Plus this, please check.
> 
> Committer testing:
> 
>   Ian reported that shellcheck found some issues, I installed it as there
>   are no warnings about it not being available, but when available it
>   fails the build with:
> 
>     TEST    /tmp/build/perf-tools-next/tests/shell/script.sh.shellcheck_log
>     CC      /tmp/build/perf-tools-next/util/header.o
> 
>   In tests/shell/script.sh line 20:
>                   rm -rf "${temp_dir}/"*
>                          ^-------------^ SC2115 (warning): Use "${var:?}" to ensure this never expands to /* .
> 
> 
>   In tests/shell/script.sh line 83:
>           output1_dir="${temp_dir}/output1"
>           ^---------^ SC2034 (warning): output1_dir appears unused. Verify use (or export if used externally).
> 
> 
>   In tests/shell/script.sh line 84:
>           output2_dir="${temp_dir}/output2"
>           ^---------^ SC2034 (warning): output2_dir appears unused. Verify use (or export if used externally).
> 
> 
>   In tests/shell/script.sh line 86:
>           python3 "${pp}" -o "${output_dir}" --jobs 4 --verbose -- perf script -i "${perf_data}"
>                               ^-----------^ SC2154 (warning): output_dir is referenced but not assigned (did you mean 'output1_dir'?).
> 
>   For more information:
>     https://www.shellcheck.net/wiki/SC2034 -- output1_dir appears unused. Verif...
>     https://www.shellcheck.net/wiki/SC2115 -- Use "${var:?}" to ensure this nev...
>     https://www.shellcheck.net/wiki/SC2154 -- output_dir is referenced but not ...
> 
> Did these fixes:
> 
>   -               rm -rf "${temp_dir}/"*
>   +               rm -rf "${temp_dir:?}/"*
> 
> And:
> 
>    @@ -83,8 +83,8 @@ test_parallel_perf()
>           output1_dir="${temp_dir}/output1"
>           output2_dir="${temp_dir}/output2"
>           perf record -o "${perf_data}" --sample-cpu uname
>   -       python3 "${pp}" -o "${output_dir}" --jobs 4 --verbose -- perf script -i "${perf_data}"
>   -       python3 "${pp}" -o "${output_dir}" --jobs 4 --verbose --per-cpu -- perf script -i "${perf_data}"
>   +       python3 "${pp}" -o "${output1_dir}" --jobs 4 --verbose -- perf script -i "${perf_data}"
>   +       python3 "${pp}" -o "${output2_dir}" --jobs 4 --verbose --per-cpu -- perf script -i "${perf_data}"
> 

Sorry, didn't have shellcheck installed!

Looks good. The shellcheck page refers to bash for "${var:?}"
but it is POSIX too.


  reply	other threads:[~2024-04-26 15:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-23 13:32 [PATCH V3] perf scripts python: Add a script to run instances of perf script in parallel Adrian Hunter
2024-04-23 23:33 ` Andi Kleen
2024-04-24 14:15   ` Arnaldo Carvalho de Melo
2024-04-26 12:48     ` Arnaldo Carvalho de Melo
2024-04-26 15:24       ` Adrian Hunter [this message]
2024-04-26 20:34         ` Arnaldo Carvalho de Melo

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=1e2bee89-0a4a-42e3-9f81-bd7296cfb351@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=namhyung@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox