mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-07-01 23:53:16 -04:00
perf script: Stop using pevent directly
We can get all that is needed using just event_format, that is available via evsel->tp_format now. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-2hsr1686epa9f0vx4yg7z2zj@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
7f7f8d0bea
commit
9782243353
6 changed files with 28 additions and 47 deletions
|
@ -221,7 +221,6 @@ static inline struct event_format *find_cache_event(struct perf_evsel *evsel)
|
|||
}
|
||||
|
||||
static void python_process_event(union perf_event *perf_event __unused,
|
||||
struct pevent *pevent,
|
||||
struct perf_sample *sample,
|
||||
struct perf_evsel *evsel,
|
||||
struct machine *machine __unused,
|
||||
|
@ -248,7 +247,7 @@ static void python_process_event(union perf_event *perf_event __unused,
|
|||
if (!event)
|
||||
die("ug! no event found for type %d", (int)evsel->attr.config);
|
||||
|
||||
pid = trace_parse_common_pid(pevent, data);
|
||||
pid = raw_field_value(event, "common_pid", data);
|
||||
|
||||
sprintf(handler_name, "%s__%s", event->system, event->name);
|
||||
|
||||
|
@ -293,7 +292,7 @@ static void python_process_event(union perf_event *perf_event __unused,
|
|||
offset = field->offset;
|
||||
obj = PyString_FromString((char *)data + offset);
|
||||
} else { /* FIELD_IS_NUMERIC */
|
||||
val = read_size(pevent, data + field->offset,
|
||||
val = read_size(event, data + field->offset,
|
||||
field->size);
|
||||
if (field->flags & FIELD_IS_SIGNED) {
|
||||
if ((long long)val >= LONG_MIN &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue