Commit 1784eeae authored by Ian Rogers's avatar Ian Rogers Committed by Arnaldo Carvalho de Melo
Browse files

perf tools: Remove HAVE_LIBTRACEEVENT_TEP_FIELD_IS_RELATIVE



Switch HAVE_LIBTRACEEVENT_TEP_FIELD_IS_RELATIVE to be a version number
test on libtraceevent being >= to version 1.5.0. This also corrects a
greater-than test to be greater-than-or-equal.

Fixes: b9a49f8c ("perf tools: Check if libtracevent has TEP_FIELD_IS_RELATIVE")
Signed-off-by: default avatarIan 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/lkml/20221205225940.3079667-3-irogers@google.com/


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 9f19aab4
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -1208,10 +1208,6 @@ ifneq ($(NO_LIBTRACEEVENT),1)
    LIBTRACEEVENT_VERSION_CPP := $(shell expr $(LIBTRACEEVENT_VERSION_1) \* 255 \* 255 + $(LIBTRACEEVENT_VERSION_2) \* 255 + $(LIBTRACEEVENT_VERSION_3))
    CFLAGS += -DLIBTRACEEVENT_VERSION=$(LIBTRACEEVENT_VERSION_CPP)
    $(call detected,CONFIG_LIBTRACEEVENT)
    LIBTRACEEVENT_VERSION_WITH_TEP_FIELD_IS_RELATIVE := $(shell expr 1 \* 255 \* 255 + 5 \* 255 + 0) # 1.5.0
    ifeq ($(shell test $(LIBTRACEEVENT_VERSION_CPP) -gt $(LIBTRACEEVENT_VERSION_WITH_TEP_FIELD_IS_RELATIVE); echo $$?),0)
      CFLAGS += -DHAVE_LIBTRACEEVENT_TEP_FIELD_IS_RELATIVE
    endif
  else
    dummy := $(warning Warning: libtraceevent is missing limiting functionality, please install libtraceevent-dev/libtraceevent-devel)
  endif
+1 −1
Original line number Diff line number Diff line
@@ -2731,7 +2731,7 @@ static size_t trace__fprintf_tp_fields(struct trace *trace, struct evsel *evsel,
				offset = format_field__intval(field, sample, evsel->needs_swap);
				syscall_arg.len = offset >> 16;
				offset &= 0xffff;
#ifdef HAVE_LIBTRACEEVENT_TEP_FIELD_IS_RELATIVE
#if LIBTRACEEVENT_VERSION >= MAKE_LIBTRACEEVENT_VERSION(1, 5, 0)
				if (field->flags & TEP_FIELD_IS_RELATIVE)
					offset += field->offset + field->size;
#endif
+1 −1
Original line number Diff line number Diff line
@@ -322,7 +322,7 @@ static int add_tracepoint_field_value(struct ctf_writer *cw,
		offset = tmp_val;
		len = offset >> 16;
		offset &= 0xffff;
#ifdef HAVE_LIBTRACEEVENT_TEP_FIELD_IS_RELATIVE
#if LIBTRACEEVENT_VERSION >= MAKE_LIBTRACEEVENT_VERSION(1, 5, 0)
		if (flags & TEP_FIELD_IS_RELATIVE)
			offset += fmtf->offset + fmtf->size;
#endif
+1 −1
Original line number Diff line number Diff line
@@ -2784,7 +2784,7 @@ void *evsel__rawptr(struct evsel *evsel, struct perf_sample *sample, const char
	if (field->flags & TEP_FIELD_IS_DYNAMIC) {
		offset = *(int *)(sample->raw_data + field->offset);
		offset &= 0xffff;
#ifdef HAVE_LIBTRACEEVENT_TEP_FIELD_IS_RELATIVE
#if LIBTRACEEVENT_VERSION >= MAKE_LIBTRACEEVENT_VERSION(1, 5, 0)
		if (field->flags & TEP_FIELD_IS_RELATIVE)
			offset += field->offset + field->size;
#endif
+1 −1
Original line number Diff line number Diff line
@@ -442,7 +442,7 @@ tracepoint_field(struct pyrf_event *pe, struct tep_format_field *field)
			offset  = val;
			len     = offset >> 16;
			offset &= 0xffff;
#ifdef HAVE_LIBTRACEEVENT_TEP_FIELD_IS_RELATIVE
#if LIBTRACEEVENT_VERSION >= MAKE_LIBTRACEEVENT_VERSION(1, 5, 0)
			if (field->flags & TEP_FIELD_IS_RELATIVE)
				offset += field->offset + field->size;
#endif
Loading