* [PATCH ndctl 0/2] fix a couple of meson issues with v76
@ 2023-02-24 5:45 Vishal Verma
2023-02-24 5:45 ` [PATCH ndctl 1/2] cxl/monitor: fix include paths for tracefs and traceevent Vishal Verma
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Vishal Verma @ 2023-02-24 5:45 UTC (permalink / raw)
To: linux-cxl
Cc: Michal Suchánek, Dave Jiang, Dan Williams, Dan Williams,
Vishal Verma, nvdimm
Fix the include paths for libtraceevent and libtracefs headers to not
explicitly state the {lib}trace{fs,event}/ prefix since that is
determined via pkg-config.
Require a minimum version of json-c for new APIs used by cxl-monitor.
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---
Vishal Verma (2):
cxl/monitor: fix include paths for tracefs and traceevent
cxl/event-trace: use the wrapped util_json_new_u64()
cxl/event_trace.c | 8 ++++----
cxl/monitor.c | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
---
base-commit: 4e1d3fd6343abf60a1d51eec6657be8fe1156789
change-id: 20230223-meson-build-fixes-362586a0afae
Best regards,
--
Vishal Verma <vishal.l.verma@intel.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH ndctl 1/2] cxl/monitor: fix include paths for tracefs and traceevent
2023-02-24 5:45 [PATCH ndctl 0/2] fix a couple of meson issues with v76 Vishal Verma
@ 2023-02-24 5:45 ` Vishal Verma
2023-02-24 7:54 ` Ira Weiny
2023-02-24 15:29 ` Dave Jiang
2023-02-24 5:45 ` [PATCH ndctl 2/2] cxl/event-trace: use the wrapped util_json_new_u64() Vishal Verma
2023-02-24 9:06 ` [PATCH ndctl 0/2] fix a couple of meson issues with v76 Michal Suchánek
2 siblings, 2 replies; 8+ messages in thread
From: Vishal Verma @ 2023-02-24 5:45 UTC (permalink / raw)
To: linux-cxl
Cc: Michal Suchánek, Dave Jiang, Dan Williams, Dan Williams,
Vishal Verma, nvdimm
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(-)
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
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH ndctl 2/2] cxl/event-trace: use the wrapped util_json_new_u64()
2023-02-24 5:45 [PATCH ndctl 0/2] fix a couple of meson issues with v76 Vishal Verma
2023-02-24 5:45 ` [PATCH ndctl 1/2] cxl/monitor: fix include paths for tracefs and traceevent Vishal Verma
@ 2023-02-24 5:45 ` Vishal Verma
2023-02-24 7:55 ` Ira Weiny
2023-02-24 15:29 ` Dave Jiang
2023-02-24 9:06 ` [PATCH ndctl 0/2] fix a couple of meson issues with v76 Michal Suchánek
2 siblings, 2 replies; 8+ messages in thread
From: Vishal Verma @ 2023-02-24 5:45 UTC (permalink / raw)
To: linux-cxl
Cc: Michal Suchánek, Dave Jiang, Dan Williams, Dan Williams,
Vishal Verma, nvdimm
The json-c API json_object_new_uint64() is relatively new, and some distros
may not have it available. There is already a wrapped version in
util/json.h which falls back to the int64 API, based on meson's
determination of the availability of the uint64 version at compile time.
Replace the direct uint64 calls with this wrapped version.
Link: https://github.com/pmem/ndctl/issues/233
Fixes: 8dedc6cf5e85 ("cxl: add a helper to parse trace events into a json object")
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 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cxl/event_trace.c b/cxl/event_trace.c
index 926f446..db8cc85 100644
--- a/cxl/event_trace.c
+++ b/cxl/event_trace.c
@@ -25,7 +25,7 @@ static struct json_object *num_to_json(void *num, int elem_size, unsigned long f
if (sign)
return json_object_new_int64(*(int64_t *)num);
else
- return json_object_new_uint64(*(uint64_t *)num);
+ return util_json_new_u64(*(uint64_t *)num);
}
/* All others fit in a signed 64 bit */
@@ -98,7 +98,7 @@ static int cxl_event_to_json(struct tep_event *event, struct tep_record *record,
}
json_object_object_add(jevent, "event", jobj);
- jobj = json_object_new_uint64(record->ts);
+ jobj = util_json_new_u64(record->ts);
if (!jobj) {
rc = -ENOMEM;
goto err_jevent;
--
2.39.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH ndctl 1/2] cxl/monitor: fix include paths for tracefs and traceevent
2023-02-24 5:45 ` [PATCH ndctl 1/2] cxl/monitor: fix include paths for tracefs and traceevent Vishal Verma
@ 2023-02-24 7:54 ` Ira Weiny
2023-02-24 15:29 ` Dave Jiang
1 sibling, 0 replies; 8+ messages in thread
From: Ira Weiny @ 2023-02-24 7:54 UTC (permalink / raw)
To: Vishal Verma, linux-cxl
Cc: Michal Suchánek, Dave Jiang, Dan Williams, Vishal Verma,
nvdimm
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
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH ndctl 2/2] cxl/event-trace: use the wrapped util_json_new_u64()
2023-02-24 5:45 ` [PATCH ndctl 2/2] cxl/event-trace: use the wrapped util_json_new_u64() Vishal Verma
@ 2023-02-24 7:55 ` Ira Weiny
2023-02-24 15:29 ` Dave Jiang
1 sibling, 0 replies; 8+ messages in thread
From: Ira Weiny @ 2023-02-24 7:55 UTC (permalink / raw)
To: Vishal Verma, linux-cxl
Cc: Michal Suchánek, Dave Jiang, Dan Williams, Vishal Verma,
nvdimm
Vishal Verma wrote:
> The json-c API json_object_new_uint64() is relatively new, and some distros
> may not have it available. There is already a wrapped version in
> util/json.h which falls back to the int64 API, based on meson's
> determination of the availability of the uint64 version at compile time.
> Replace the direct uint64 calls with this wrapped version.
>
> Link: https://github.com/pmem/ndctl/issues/233
> Fixes: 8dedc6cf5e85 ("cxl: add a helper to parse trace events into a json object")
> 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 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/cxl/event_trace.c b/cxl/event_trace.c
> index 926f446..db8cc85 100644
> --- a/cxl/event_trace.c
> +++ b/cxl/event_trace.c
> @@ -25,7 +25,7 @@ static struct json_object *num_to_json(void *num, int elem_size, unsigned long f
> if (sign)
> return json_object_new_int64(*(int64_t *)num);
> else
> - return json_object_new_uint64(*(uint64_t *)num);
> + return util_json_new_u64(*(uint64_t *)num);
> }
>
> /* All others fit in a signed 64 bit */
> @@ -98,7 +98,7 @@ static int cxl_event_to_json(struct tep_event *event, struct tep_record *record,
> }
> json_object_object_add(jevent, "event", jobj);
>
> - jobj = json_object_new_uint64(record->ts);
> + jobj = util_json_new_u64(record->ts);
> if (!jobj) {
> rc = -ENOMEM;
> goto err_jevent;
>
> --
> 2.39.1
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH ndctl 0/2] fix a couple of meson issues with v76
2023-02-24 5:45 [PATCH ndctl 0/2] fix a couple of meson issues with v76 Vishal Verma
2023-02-24 5:45 ` [PATCH ndctl 1/2] cxl/monitor: fix include paths for tracefs and traceevent Vishal Verma
2023-02-24 5:45 ` [PATCH ndctl 2/2] cxl/event-trace: use the wrapped util_json_new_u64() Vishal Verma
@ 2023-02-24 9:06 ` Michal Suchánek
2 siblings, 0 replies; 8+ messages in thread
From: Michal Suchánek @ 2023-02-24 9:06 UTC (permalink / raw)
To: Vishal Verma; +Cc: linux-cxl, Dave Jiang, Dan Williams, nvdimm
On Thu, Feb 23, 2023 at 10:45:37PM -0700, Vishal Verma wrote:
> Fix the include paths for libtraceevent and libtracefs headers to not
> explicitly state the {lib}trace{fs,event}/ prefix since that is
> determined via pkg-config.
>
> Require a minimum version of json-c for new APIs used by cxl-monitor.
>
> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
> ---
> Vishal Verma (2):
> cxl/monitor: fix include paths for tracefs and traceevent
> cxl/event-trace: use the wrapped util_json_new_u64()
Tested-by: Michal Suchánek <msuchanek@suse.de>
Thanks
Michal
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH ndctl 1/2] cxl/monitor: fix include paths for tracefs and traceevent
2023-02-24 5:45 ` [PATCH ndctl 1/2] cxl/monitor: fix include paths for tracefs and traceevent Vishal Verma
2023-02-24 7:54 ` Ira Weiny
@ 2023-02-24 15:29 ` Dave Jiang
1 sibling, 0 replies; 8+ messages in thread
From: Dave Jiang @ 2023-02-24 15:29 UTC (permalink / raw)
To: Vishal Verma, linux-cxl; +Cc: Michal Suchánek, Dan Williams, nvdimm
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 */
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH ndctl 2/2] cxl/event-trace: use the wrapped util_json_new_u64()
2023-02-24 5:45 ` [PATCH ndctl 2/2] cxl/event-trace: use the wrapped util_json_new_u64() Vishal Verma
2023-02-24 7:55 ` Ira Weiny
@ 2023-02-24 15:29 ` Dave Jiang
1 sibling, 0 replies; 8+ messages in thread
From: Dave Jiang @ 2023-02-24 15:29 UTC (permalink / raw)
To: Vishal Verma, linux-cxl; +Cc: Michal Suchánek, Dan Williams, nvdimm
On 2/23/23 10:45 PM, Vishal Verma wrote:
> The json-c API json_object_new_uint64() is relatively new, and some distros
> may not have it available. There is already a wrapped version in
> util/json.h which falls back to the int64 API, based on meson's
> determination of the availability of the uint64 version at compile time.
> Replace the direct uint64 calls with this wrapped version.
>
> Link: https://github.com/pmem/ndctl/issues/233
> Fixes: 8dedc6cf5e85 ("cxl: add a helper to parse trace events into a json object")
> 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 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/cxl/event_trace.c b/cxl/event_trace.c
> index 926f446..db8cc85 100644
> --- a/cxl/event_trace.c
> +++ b/cxl/event_trace.c
> @@ -25,7 +25,7 @@ static struct json_object *num_to_json(void *num, int elem_size, unsigned long f
> if (sign)
> return json_object_new_int64(*(int64_t *)num);
> else
> - return json_object_new_uint64(*(uint64_t *)num);
> + return util_json_new_u64(*(uint64_t *)num);
> }
>
> /* All others fit in a signed 64 bit */
> @@ -98,7 +98,7 @@ static int cxl_event_to_json(struct tep_event *event, struct tep_record *record,
> }
> json_object_object_add(jevent, "event", jobj);
>
> - jobj = json_object_new_uint64(record->ts);
> + jobj = util_json_new_u64(record->ts);
> if (!jobj) {
> rc = -ENOMEM;
> goto err_jevent;
>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2023-02-24 15:29 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-24 5:45 [PATCH ndctl 0/2] fix a couple of meson issues with v76 Vishal Verma
2023-02-24 5:45 ` [PATCH ndctl 1/2] cxl/monitor: fix include paths for tracefs and traceevent Vishal Verma
2023-02-24 7:54 ` Ira Weiny
2023-02-24 15:29 ` Dave Jiang
2023-02-24 5:45 ` [PATCH ndctl 2/2] cxl/event-trace: use the wrapped util_json_new_u64() Vishal Verma
2023-02-24 7:55 ` Ira Weiny
2023-02-24 15:29 ` Dave Jiang
2023-02-24 9:06 ` [PATCH ndctl 0/2] fix a couple of meson issues with v76 Michal Suchánek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox