mbox series

[v3,0/5] perf build: libtraceevent, libtracefs feature check with pkg-config

Message ID 20240717174739.186988-1-amadio@gentoo.org (mailing list archive)
Headers show
Series perf build: libtraceevent, libtracefs feature check with pkg-config | expand

Message

Guilherme Amadio July 17, 2024, 5:47 p.m. UTC
This patch series is a continuation of recent work to use pkg-config for feature
checks for libtraceevent and libtracefs.

The original intention of the first patches was to fix build issues with
libtracefs installed with its meson build system (used in Gentoo), which
installs headers in a different directory as the make build system. This has
been reported here: https://github.com/rostedt/libtracefs/issues/3

In order to fix the feature check, instead of using #include <tracefs/tracefs.h>
in tools/build/feature/test-libtracefs.c, we need to use #include <tracefs.h>
and add the appropriate -I flag for the include directory, which is what is now
done with pkg-config. An unintended consequence of this (reported by Thorsten)
was that other tools which also perform the same feature check for libtracefs
became broken, because the initial patch only set the include flag for perf in
tools/perf/Makefile.config.

This patch series fixes this issue by moving the feature check flags to the file
tools/build/Makefile.feature, which ensures the flags get set for all tools that
need them. I tried to write the new code in a way that would be easily extensible
to other dependencies that may be used via pkg-config as well.

There is no change in this new submission relative to the last (which has been
tested by Thorsten to fix the build issue in Fedora). The only change has been
to add in CC Steven Rostedt and the list linux-trace-devel@vger.kernel.org.

Best regards,
-Guilherme

Guilherme Amadio (5):
  perf build: Warn if libtracefs is not found
  tools: Make pkg-config dependency checks usable by other tools
  tools/verification: Use pkg-config in lib_setup of Makefile.config
  tools/rtla: Use pkg-config in lib_setup of Makefile.config
  tools/latency: Use pkg-config in lib_setup of Makefile.config

 tools/build/Makefile.feature          | 18 ++++++++++++++++++
 tools/perf/Makefile.config            | 13 +++++--------
 tools/tracing/latency/Makefile.config |  3 ++-
 tools/tracing/rtla/Makefile.config    |  3 ++-
 tools/verification/rv/Makefile.config |  3 ++-
 5 files changed, 29 insertions(+), 11 deletions(-)

Comments

Steven Rostedt July 17, 2024, 5:57 p.m. UTC | #1
On Wed, 17 Jul 2024 19:47:34 +0200
Guilherme Amadio <amadio@gentoo.org> wrote:

> There is no change in this new submission relative to the last (which has been
> tested by Thorsten to fix the build issue in Fedora). The only change has been
> to add in CC Steven Rostedt and the list linux-trace-devel@vger.kernel.org.

Thanks,

For the whole series:

Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org>

Feel free to take it through the perf tree.

-- Steve

> 
> Best regards,
> -Guilherme
> 
> Guilherme Amadio (5):
>   perf build: Warn if libtracefs is not found
>   tools: Make pkg-config dependency checks usable by other tools
>   tools/verification: Use pkg-config in lib_setup of Makefile.config
>   tools/rtla: Use pkg-config in lib_setup of Makefile.config
>   tools/latency: Use pkg-config in lib_setup of Makefile.config
> 
>  tools/build/Makefile.feature          | 18 ++++++++++++++++++
>  tools/perf/Makefile.config            | 13 +++++--------
>  tools/tracing/latency/Makefile.config |  3 ++-
>  tools/tracing/rtla/Makefile.config    |  3 ++-
>  tools/verification/rv/Makefile.config |  3 ++-
>  5 files changed, 29 insertions(+), 11 deletions(-)
>
Leo Yan July 17, 2024, 7:47 p.m. UTC | #2
On 7/17/2024 6:47 PM, Guilherme Amadio wrote:
> 
> This patch series is a continuation of recent work to use pkg-config for feature
> checks for libtraceevent and libtracefs.

Tested this series for building x86_64 target and cross building aarch64 target:

Tested-by: Leo Yan <leo.yan@arm.com>
Namhyung Kim July 17, 2024, 8:17 p.m. UTC | #3
On Wed, Jul 17, 2024 at 10:58 AM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> On Wed, 17 Jul 2024 19:47:34 +0200
> Guilherme Amadio <amadio@gentoo.org> wrote:
>
> > There is no change in this new submission relative to the last (which has been
> > tested by Thorsten to fix the build issue in Fedora). The only change has been
> > to add in CC Steven Rostedt and the list linux-trace-devel@vger.kernel.org.
>
> Thanks,
>
> For the whole series:
>
> Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org>
>
> Feel free to take it through the perf tree.

Thanks, I'll add it to perf-tools and send out to v6.11 later.

Namhyung