From: Andi Kleen <ak@linux.intel.com>
To: Adrian Hunter <adrian.hunter@intel.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
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] perf scripts python: Add a script to run instances of perf script in parallel
Date: Mon, 11 Mar 2024 09:13:42 -0700 [thread overview]
Message-ID: <Ze8ttn4bxBrYi63h@tassilo> (raw)
In-Reply-To: <20240310193502.2334-1-adrian.hunter@intel.com>
On Sun, Mar 10, 2024 at 09:35:02PM +0200, Adrian Hunter wrote:
> Add a Python script to run a perf script command multiple times in
> parallel, using perf script options --cpu and --time so that each job
> processes a different chunk of the data.
>
> Refer to the script's own help text at the end of the patch for more
> details.
>
> 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.
This only optimizes for the run time of the decoder. Often when you do
analysis you have a non trivial part of it in some analysis script too,
but you currently have no directi / easy way to paralelize that. It would
be better to support parallel pipelines.
TBH I'm not sure the script is worth it. If you need to do parallel
pipelines (which imho is the common case) it's probably better to just
write a custom shell script, which is not that difficult. It might be
better to have a helper that makes writing such scripts easier,
e.g. figuring out reasonable options for manual parallelization
based on the input file. I think parts of your script do that, maybe
it is usable for that.
Also as a default output it would be better to just merge the
original output in order and output it on stdout.
You should probably limit the number of jobs to some minimum
length, otherwise on systems with many CPUs there might be
inefficiently short jobs.
-Andi
next prev parent reply other threads:[~2024-03-11 16:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-10 19:35 [PATCH] perf scripts python: Add a script to run instances of perf script in parallel Adrian Hunter
2024-03-11 16:13 ` Andi Kleen [this message]
2024-03-11 17:52 ` Adrian Hunter
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=Ze8ttn4bxBrYi63h@tassilo \
--to=ak@linux.intel.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@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;
as well as URLs for NNTP newsgroup(s).