diff options
| author | Arnaldo Carvalho de Melo <[email protected]> | 2022-12-08 22:28:58 +0000 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <[email protected]> | 2022-12-14 14:16:12 +0000 |
| commit | b9a49f8cb02f08592054b953adcacecd59b7ae4b (patch) | |
| tree | fbc413e12a489d6c4ffe1bca19fc79be62b1054c /tools/perf/util/scripting-engines/trace-event-perl.c | |
| parent | tools lib traceevent: Remove libtraceevent (diff) | |
| download | kernel-b9a49f8cb02f08592054b953adcacecd59b7ae4b.tar.gz kernel-b9a49f8cb02f08592054b953adcacecd59b7ae4b.zip | |
perf tools: Check if libtracevent has TEP_FIELD_IS_RELATIVE
Some distros have older versions of libtraceevent where
TEP_FIELD_IS_RELATIVE and its associated semantics are not present, so
we need to check if the version has it, it was introduced in
libtraceevent 1.5.0.
Reported-by: Athira Jajeev <[email protected]>
Tested-by: Athira Jajeev <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Ian Rogers <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Nick Desaulniers <[email protected]>
Cc: Peter Zijlstra <[email protected]>,
Cc: Stephane Eranian <[email protected]>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/util/scripting-engines/trace-event-perl.c')
| -rw-r--r-- | tools/perf/util/scripting-engines/trace-event-perl.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/util/scripting-engines/trace-event-perl.c b/tools/perf/util/scripting-engines/trace-event-perl.c index 0bacb49408f8..c097b7934fd4 100644 --- a/tools/perf/util/scripting-engines/trace-event-perl.c +++ b/tools/perf/util/scripting-engines/trace-event-perl.c @@ -393,8 +393,10 @@ static void perl_process_tracepoint(struct perf_sample *sample, if (field->flags & TEP_FIELD_IS_DYNAMIC) { offset = *(int *)(data + field->offset); offset &= 0xffff; +#ifdef HAVE_LIBTRACEEVENT_TEP_FIELD_IS_RELATIVE if (field->flags & TEP_FIELD_IS_RELATIVE) offset += field->offset + field->size; +#endif } else offset = field->offset; XPUSHs(sv_2mortal(newSVpv((char *)data + offset, 0))); |
