aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/perf/util/sort.c
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2023-01-10 23:06:40 -0800
committerArnaldo Carvalho de Melo <acme@redhat.com>2023-01-19 13:26:28 -0300
commit1634bad32074e00e0ec29e0aef53210ed20f0ec5 (patch)
treeafc55d8b847485e46394f1a7249556dd799667f9 /tools/perf/util/sort.c
parentperf tools: Remove HAVE_LIBTRACEEVENT_TEP_FIELD_IS_RELATIVE (diff)
downloadwireguard-linux-1634bad32074e00e0ec29e0aef53210ed20f0ec5.tar.xz
wireguard-linux-1634bad32074e00e0ec29e0aef53210ed20f0ec5.zip
perf trace: Reduce #ifdefs for TEP_FIELD_IS_RELATIVE
Add a helper function that applies the mask to test, or returns false if libtraceevent is too old or not present. Signed-off-by: Ian Rogers <irogers@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com> Cc: Eelco Chaudron <echaudro@redhat.com> Cc: German Gomez <german.gomez@arm.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Kim Phillips <kim.phillips@amd.com> Cc: Leo Yan <leo.yan@linaro.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Sean Christopherson <seanjc@google.com> Cc: Stephane Eranian <eranian@google.com> Cc: Yang Jihong <yangjihong1@huawei.com> Link: https://lore.kernel.org/r/20230111070641.1728726-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/sort.c')
-rw-r--r--tools/perf/util/sort.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index 3673912d9e6b..d7d0f997873a 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -2668,10 +2668,8 @@ static int64_t __sort__hde_cmp(struct perf_hpp_fmt *fmt,
tep_read_number_field(field, a->raw_data, &dyn);
offset = dyn & 0xffff;
size = (dyn >> 16) & 0xffff;
-#if LIBTRACEEVENT_VERSION >= MAKE_LIBTRACEEVENT_VERSION(1, 5, 0)
- if (field->flags & TEP_FIELD_IS_RELATIVE)
+ if (tep_field_is_relative(field->flags))
offset += field->offset + field->size;
-#endif
/* record max width for output */
if (size > hde->dynamic_len)
hde->dynamic_len = size;