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: https://github.com/pmem/ndctl/issues/234
Fixes: 8dedc6cf5e85 ("cxl: add a helper to parse trace events into a json 
object")
Fixes: 7b237bc7a8ae ("cxl: add a helper to go through all current events and 
parse them")
Reported-by: Michal Suchánek <msucha...@suse.de>
Cc: Dave Jiang <dave.ji...@intel.com>
Cc: Dan Williams <dan.j.willi...@intel.com>
Signed-off-by: Vishal Verma <vishal.l.ve...@intel.com>
---
 cxl/event_trace.c | 4 ++--
 cxl/monitor.c     | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/cxl/event_trace.c b/cxl/event_trace.c
index 76dd4e7..926f446 100644
--- a/cxl/event_trace.c
+++ b/cxl/event_trace.c
@@ -2,14 +2,14 @@
 // Copyright (C) 2022, Intel Corp. All rights reserved.
 #include <stdio.h>
 #include <errno.h>
+#include <event-parse.h>
 #include <json-c/json.h>
 #include <util/json.h>
 #include <util/util.h>
 #include <util/strbuf.h>
 #include <ccan/list/list.h>
 #include <uuid/uuid.h>
-#include <traceevent/event-parse.h>
-#include <tracefs/tracefs.h>
+#include <tracefs.h>
 #include "event_trace.h"
 
 #define _GNU_SOURCE
diff --git a/cxl/monitor.c b/cxl/monitor.c
index 749f472..e3469b9 100644
--- a/cxl/monitor.c
+++ b/cxl/monitor.c
@@ -4,6 +4,7 @@
 #include <stdio.h>
 #include <unistd.h>
 #include <errno.h>
+#include <event-parse.h>
 #include <json-c/json.h>
 #include <libgen.h>
 #include <time.h>
@@ -16,8 +17,7 @@
 #include <util/strbuf.h>
 #include <sys/epoll.h>
 #include <sys/stat.h>
-#include <traceevent/event-parse.h>
-#include <tracefs/tracefs.h>
+#include <tracefs.h>
 #include <cxl/libcxl.h>
 
 /* reuse the core log helpers for the monitor logger */

-- 
2.39.1


Reply via email to