diff mbox series

[ndctl,1/2] cxl/monitor: fix include paths for tracefs and traceevent

Message ID 20230223-meson-build-fixes-v1-1-5fae3b606395@intel.com (mailing list archive)
State Accepted
Commit a59866328ec5a988f7fa395cb567b6c34841cda9
Headers show
Series fix a couple of meson issues with v76 | expand

Commit Message

Verma, Vishal L Feb. 24, 2023, 5:45 a.m. UTC
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 <msuchanek@suse.de>
Cc: Dave Jiang <dave.jiang@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---
 cxl/event_trace.c | 4 ++--
 cxl/monitor.c     | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

Comments

Ira Weiny Feb. 24, 2023, 7:54 a.m. UTC | #1
Vishal Verma wrote:
> 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 <msuchanek@suse.de>
> Cc: Dave Jiang <dave.jiang@intel.com>
> Cc: Dan Williams <dan.j.williams@intel.com>

Reviewed-by: Ira Weiny <ira.weiny@intel.com>

> Signed-off-by: Vishal Verma <vishal.l.verma@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
>
Dave Jiang Feb. 24, 2023, 3:29 p.m. UTC | #2
On 2/23/23 10:45 PM, Vishal Verma wrote:
> 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 <msuchanek@suse.de>
> Cc: Dave Jiang <dave.jiang@intel.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>

Reviewed-by: Dave Jiang <dave.jiang@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 */
>
diff mbox series

Patch

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 */