Re: [PATCH 2/3] perf build: Use libtraceevent from the system

Arnaldo Carvalho de Melo
2022-12-13T22:34:13Z

On December 13, 2022 7:09:07 PM GMT-03:00, Ian Rogers <irogers@google.com> wrote:
>Thanks Athira and Arnaldo. It is a little strange to me to be using
>the shell to do a version number test. The intent was to be doing
>these in the code:
>#if LIBRTRACEEVENT_VERSION >= MAKE_LIBTRACEEVENT_VERSION(1, 5, 0)
>vs
>...
>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
>...
>#ifdef HAVE_LIBTRACEEVENT_TEP_FIELD_IS_RELATIVE
>I'm a little selfish as I'm maintaining a bazel build and a single
>version number to maintain is easier than lots of HAVE_... tests. I'm
>happy to follow Arnaldo's lead. I think the test should also be
>greater-equal rather than greater-than:
>https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/tree/include/traceevent/event-parse.h?h=libtraceevent-v1.5#n128

I'll fix that, and in a case like this please consider to send a patch with your preference, I'd happily
graft it.

- Arnaldo
>