From: Adrian Hunter <adrian.hunter@intel.com>
To: Zixian Cai <fzczx123@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
Ian Rogers <irogers@google.com>,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf script python: Add the ins_lat field to event handler
Date: Thu, 8 Aug 2024 14:12:35 +0300 [thread overview]
Message-ID: <95455271-83dc-4765-b5b8-0851a75b9164@intel.com> (raw)
In-Reply-To: <20240808080027.3559776-1-fzczx123@gmail.com>
On 8/08/24 11:00, Zixian Cai wrote:
> For example, when using the Alder Lake PMU memory load event, the
> instruction latency is stored in ins_lat, while the cache latency is
> stored in weight.
>
> This patch reports the ins_lat field for Python scripting.
Patch does not apply.
Needs to be based on upstream kernel. Latest perf tools kernel
tree and branch is:
git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git perf-tools-next
>
> Signed-off-by: Zixian Cai <fzczx123@gmail.com>
> ---
> tools/perf/util/scripting-engines/trace-event-python.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c
> index 41d4f9e6a..68eb0586c 100644
> --- a/tools/perf/util/scripting-engines/trace-event-python.c
> +++ b/tools/perf/util/scripting-engines/trace-event-python.c
> @@ -861,6 +861,8 @@ static PyObject *get_perf_sample_dict(struct perf_sample *sample,
> set_sample_read_in_dict(dict_sample, sample, evsel);
> pydict_set_item_string_decref(dict_sample, "weight",
> PyLong_FromUnsignedLongLong(sample->weight));
> + pydict_set_item_string_decref(dict_sample, "ins_lat",
> + PyLong_FromUnsignedLongLong(sample->ins_lat));
> pydict_set_item_string_decref(dict_sample, "transaction",
> PyLong_FromUnsignedLongLong(sample->transaction));
> set_sample_datasrc_in_dict(dict_sample, sample);
> @@ -1286,7 +1288,7 @@ static void python_export_sample_table(struct db_export *dbe,
> struct tables *tables = container_of(dbe, struct tables, dbe);
> PyObject *t;
>
> - t = tuple_new(25);
> + t = tuple_new(26);
>
> tuple_set_d64(t, 0, es->db_id);
> tuple_set_d64(t, 1, es->evsel->db_id);
> @@ -1313,6 +1315,7 @@ static void python_export_sample_table(struct db_export *dbe,
> tuple_set_d64(t, 22, es->sample->insn_cnt);
> tuple_set_d64(t, 23, es->sample->cyc_cnt);
> tuple_set_s32(t, 24, es->sample->flags);
> + tuple_set_s32(t, 25, es->sample->ins_lat);
>
> call_object(tables->sample_handler, t, "sample_table");
>
> --
> 2.25.1
>
next prev parent reply other threads:[~2024-08-08 11:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-08 8:00 Zixian Cai
2024-08-08 11:12 ` Adrian Hunter [this message]
2024-08-08 13:28 ` Zixian Cai
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=95455271-83dc-4765-b5b8-0851a75b9164@intel.com \
--to=adrian.hunter@intel.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=fzczx123@gmail.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.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 \
/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®