2024-03-01 13:39:30

by James Clark

[permalink] [raw]
Subject: [PATCH] perf version: Display availability of OpenCSD support

This is useful for scripts that work with Perf and ETM trace. Rather
than them trying to parse Perf's error output at runtime to see if it
was linked or not.

Signed-off-by: James Clark <[email protected]>
---
tools/perf/builtin-version.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/tools/perf/builtin-version.c b/tools/perf/builtin-version.c
index 1bafe5855ae7..398aa53e9e2e 100644
--- a/tools/perf/builtin-version.c
+++ b/tools/perf/builtin-version.c
@@ -84,6 +84,7 @@ static void library_status(void)
STATUS(HAVE_LIBTRACEEVENT, libtraceevent);
STATUS(HAVE_BPF_SKEL, bpf_skeletons);
STATUS(HAVE_DWARF_UNWIND_SUPPORT, dwarf-unwind-support);
+ STATUS(HAVE_CSTRACE_SUPPORT, libopencsd);
}

int cmd_version(int argc, const char **argv)
--
2.34.1



2024-03-01 16:44:25

by Ian Rogers

[permalink] [raw]
Subject: Re: [PATCH] perf version: Display availability of OpenCSD support

On Fri, Mar 1, 2024 at 5:39 AM James Clark <[email protected]> wrote:
>
> This is useful for scripts that work with Perf and ETM trace. Rather
> than them trying to parse Perf's error output at runtime to see if it
> was linked or not.
>
> Signed-off-by: James Clark <[email protected]>

Reviewed-by: Ian Rogers <[email protected]>

Thanks,
Ian

> ---
> tools/perf/builtin-version.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tools/perf/builtin-version.c b/tools/perf/builtin-version.c
> index 1bafe5855ae7..398aa53e9e2e 100644
> --- a/tools/perf/builtin-version.c
> +++ b/tools/perf/builtin-version.c
> @@ -84,6 +84,7 @@ static void library_status(void)
> STATUS(HAVE_LIBTRACEEVENT, libtraceevent);
> STATUS(HAVE_BPF_SKEL, bpf_skeletons);
> STATUS(HAVE_DWARF_UNWIND_SUPPORT, dwarf-unwind-support);
> + STATUS(HAVE_CSTRACE_SUPPORT, libopencsd);
> }
>
> int cmd_version(int argc, const char **argv)
> --
> 2.34.1
>

2024-03-04 18:56:39

by Namhyung Kim

[permalink] [raw]
Subject: Re: [PATCH] perf version: Display availability of OpenCSD support

On Fri, 1 Mar 2024 13:38:29 +0000, James Clark wrote:
> This is useful for scripts that work with Perf and ETM trace. Rather
> than them trying to parse Perf's error output at runtime to see if it
> was linked or not.
>
>

Applied to perf-tools-next, thanks!

Best regards,
--
Namhyung Kim <[email protected]>