mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Ben Gainey <ben.gainey@arm.com>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org,
	mark.rutland@arm.com, alexander.shishkin@linux.intel.com,
	jolsa@kernel.org, namhyung@kernel.org, irogers@google.com,
	will@kernel.org
Subject: Re: [PATCH 0/1] tools: perf: Expose sample ID / stream ID to python scripts
Date: Tue, 23 Jan 2024 13:32:19 +0200	[thread overview]
Message-ID: <089e43c5-1e0e-4c6e-9b91-827b01012b23@intel.com> (raw)
In-Reply-To: <20240123103137.1890779-1-ben.gainey@arm.com>

On 23/01/24 12:31, Ben Gainey wrote:
> This patch modifies the perf python scripting engine so that the ID and
> STREAM_ID are exposed as part of the sample so that they may be
> correlated to the corresponding throttle/unthrottle event (for example).
> 
> NB: For scripts where perf_db_export_mode = True, this may be a breaking
> change depending on how the script is constructed. Each field is passed
> to `sample_table` as an argument so any script that is written as:
> 
>     def sample_table(db_id, evsel_id, machine_id, ..., cyc_cnt, flags)
> 
> will now fail due to the changed number of arguments with:
> 
>     TypeError: sample_table() takes 25 positional arguments but 27 were given
> 
> Scripts that use:
> 
>     def sample_table(*args)
> 
> or some variation thereof will not be affected.

That is documented in tools/perf/Documentation/db-export.txt.  It was
anticipated that more arguments could be added, so that should be OK.

> 
> When `perf_db_export_mode = False`, the script should be unaffected as
> all the arguments are inserted into a dictionary.
> 
> The export-to-xxx.py scripts use the (..., *x) form so are not affected.
> 
> 
> Ben Gainey (1):
>   tools: perf: Expose sample ID / stream ID to python scripts
> 
>  tools/perf/Documentation/perf-script-python.txt        | 4 ++--
>  tools/perf/util/scripting-engines/trace-event-python.c | 8 +++++++-
>  2 files changed, 9 insertions(+), 3 deletions(-)
> 


  parent reply	other threads:[~2024-01-23 11:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-23 10:31 Ben Gainey
2024-01-23 10:31 ` [PATCH 1/1] " Ben Gainey
2024-01-23 11:04   ` Adrian Hunter
2024-01-23 11:24     ` Ben Gainey
2024-02-02 17:05   ` Adrian Hunter
2024-01-23 11:32 ` Adrian Hunter [this message]
2024-02-03  1:54 ` [PATCH 0/1] " Namhyung Kim
2024-02-06  0:19 ` Namhyung Kim

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=089e43c5-1e0e-4c6e-9b91-827b01012b23@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=ben.gainey@arm.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=will@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

all inboxes | Powered by JetHome®