Re: [PATCH] tools/rtla: Explicitly list libtraceevent dependency

From: Daniel Wagner
Date: Tue Jan 10 2023 - 10:10:14 EST


On Tue, Jan 10, 2023 at 09:53:47AM -0500, Steven Rostedt wrote:
> On Tue, 10 Jan 2023 09:51:37 -0500
> Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
> > There's many interfaces that require the libtraceevent header files to work
> > with libtracefs. Anything that uses libtracefs must also use libtraceevent,
> > as libtracefs is really just an extension of libtraceevent.

Okay, in this case I am going update the Meson build to add the necessary
explicit dependency:

++ b/src/meson.build
@@ -50,6 +50,7 @@ libtracefs_static = static_library(
pkg = import('pkgconfig')
pkg.generate(
libtracefs,
+ libraries: [libtraceevent_dep],
subdirs: 'libtracefs',
filebase: meson.project_name(),
name: meson.project_name(),


$ cat /tmp/trace-cmd/lib64/pkgconfig/libtracefs.pc
prefix=/tmp/trace-cmd
includedir=${prefix}/include
libdir=${prefix}/lib64

Name: libtracefs
Description: Manage trace fs
URL: https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/
Version: 1.6.3
Requires: libtraceevent >= 1.7.0
Libs: -L${libdir} -ltracefs
Cflags: -I${includedir}/libtracefs

$ PKG_CONFIG_PATH=/tmp/trace-cmd
$ pkg-config --libs libtracefs
-L/tmp/trace-cmd/lib64 -ltracefs -ltraceevent