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 <atrajeev@linux.vnet.ibm.com> Tested-by: Athira Jajeev <atrajeev@linux.vnet.ibm.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Ian Rogers <irogers@google.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Nick Desaulniers <ndesaulniers@google.com> Cc: Peter Zijlstra <peterz@infradead.org>, Cc: Stephane Eranian <eranian@google.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
@ -994,8 +994,10 @@ static void python_process_tracepoint(struct perf_sample *sample,
|
||||
offset = val;
|
||||
len = offset >> 16;
|
||||
offset &= 0xffff;
|
||||
#ifdef HAVE_LIBTRACEEVENT_TEP_FIELD_IS_RELATIVE
|
||||
if (field->flags & TEP_FIELD_IS_RELATIVE)
|
||||
offset += field->offset + field->size;
|
||||
#endif
|
||||
}
|
||||
if (field->flags & TEP_FIELD_IS_STRING &&
|
||||
is_printable_array(data + offset, len)) {
|
||||
|
Reference in New Issue
Block a user