Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libtracefs header location not checked #234

Closed
hramrach opened this issue Feb 23, 2023 · 4 comments
Closed

libtracefs header location not checked #234

hramrach opened this issue Feb 23, 2023 · 4 comments

Comments

@hramrach
Copy link
Contributor

Needed

find . -name *.c -o -name *.h | xargs sed -i -e "s,#include <tracefs/tracefs.h>,#include <libtracefs/tracefs.h>,"

Looks like the include should be <tracefs.h>, and the -I from pkgconfig should be used:

pkgconf --cflags libtracefs
-I/usr/include/libtracefs -I/usr/include/traceevent

@stellarhopper
Copy link
Member

@hramrach hm looks like this might need another distro-specific include searching dance like we had for iniparser.
Fedora has it in /usr/include/tracefs/tracefs.h, and there's not a /usr/include/libtracefs/ at all.

@stellarhopper
Copy link
Member

Oh, agreed with include <tracefs.h> since there is a pkgconf. I'll make that change.

@stellarhopper
Copy link
Member

Fixes sent: https://lore.kernel.org/linux-cxl/20230223-meson-build-fixes-v1-0-5fae3b606395@intel.com
I'll do a 76.1 with these once reviewed

stellarhopper added a commit that referenced this issue Feb 24, 2023
Distros vary on whether the above headers are placed in
{prefix}/libtracefs/ or {prefix}/tracefs/, and likewise for traceevent.

Since both of these libraries do ship with pkgconfig info to determine
the exact include path, the respective #include statements can drop the
{lib}trace{fs,event}/ prefix.

Since the libraries are declared using meson's dependency() function, it
already does the requisite pkgconfig parsing. Drop the above
prefixes to allow the includes work on all distros.

Link: #234
Link: https://lore.kernel.org/r/20230223-meson-build-fixes-v1-1-5fae3b606395@intel.com
Fixes: 8dedc6c ("cxl: add a helper to parse trace events into a json object")
Fixes: 7b237bc ("cxl: add a helper to go through all current events and parse them")
Cc: Dave Jiang <dave.jiang@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Reported-by: Michal Suchánek <msuchanek@suse.de>
Tested-by: Michal Suchánek <msuchanek@suse.de>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
@stellarhopper
Copy link
Member

76.1 is now out with these fixes. Thanks for the reports @hramrach

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants