[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <38fd4992-63ae-4871-ddfd-27d40b5c48d2@arm.com>
Date: Fri, 3 Dec 2021 12:00:26 +0000
From: German Gomez <german.gomez@....com>
To: Athira Rajeev <atrajeev@...ux.vnet.ibm.com>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-perf-users@...r.kernel.org,
Arnaldo Carvalho de Melo <acme@...nel.org>,
John Garry <john.garry@...wei.com>,
Will Deacon <will@...nel.org>,
Mathieu Poirier <mathieu.poirier@...aro.org>,
Leo Yan <leo.yan@...aro.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...hat.com>,
Namhyung Kim <namhyung@...nel.org>,
linux-arm-kernel@...ts.infradead.org, linux-csky@...r.kernel.org,
linux-riscv@...ts.infradead.org
Subject: Re: [PATCH v1 2/4] perf script: Add "struct machine" parameter to
process_event callback
Hi Athira,
On 02/12/2021 16:03, Athira Rajeev wrote:
>
>> On 01-Dec-2021, at 6:03 PM, German Gomez <german.gomez@....com> wrote:
>>
>> Include a "struct machine*" parameter to the process_event callback in
>> the scripting layer. This will allow access to the perf_env from within
>> this callback.
>>
>> Followup patches will build on top of this to report the correct name of
>> the registers in a perf.data file, consistently with the architecture
>> the file was recorded in.
>>
>> Signed-off-by: German Gomez <german.gomez@....com>
>> ---
>> tools/perf/builtin-script.c | 2 +-
>> .../util/scripting-engines/trace-event-perl.c | 3 ++-
>> .../scripting-engines/trace-event-python.c | 23 +++++++++++--------
>> tools/perf/util/trace-event-scripting.c | 3 ++-
>> tools/perf/util/trace-event.h | 3 ++-
>> 5 files changed, 21 insertions(+), 13 deletions(-)
>>
>> diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
>> index 9434367af..711132f0b 100644
>> --- a/tools/perf/builtin-script.c
>> +++ b/tools/perf/builtin-script.c
>> @@ -2256,7 +2256,7 @@ static int process_sample_event(struct perf_tool *tool,
>> thread__resolve(al.thread, &addr_al, sample);
>> addr_al_ptr = &addr_al;
>> }
>> - scripting_ops->process_event(event, sample, evsel, &al, addr_al_ptr);
>> + scripting_ops->process_event(event, sample, evsel, &al, addr_al_ptr, machine);
> Hi,
>
> Looks like the patch is using “machine” to allow access to perf_env__arch and there by to get the “arch” value.
> But can we use from evsel, like "perf_env__arch(evsel__env(evsel))” to get arch value instead of including new parameter for “struct machine” ?
>
> Thanks
> Athira
Thanks for the suggestion. It looks like we can skip this patch if we
can get the arch value that way.
Thanks!
German
Powered by blists - more mailing lists