perf check: Introduce 'check' subcommand
Currently the presence of a feature is checked with a combination of
perf version --build-options and greps, such as:
perf version --build-options | grep " on .* HAVE_FEATURE"
Instead of this, introduce a subcommand "perf check feature", with which
scripts can test for presence of a feature, such as:
perf check feature HAVE_FEATURE
'perf check feature' command is expected to have exit status of 0 if
feature is built-in, and 1 if it's not built-in or if feature is not known.
Multiple features can also be passed as a comma-separated list, in which
case the exit status will be 1 only if all of the passed features are
built-in. For example, with below command, it will have exit status of 0
only if both libtraceevent and bpf are enabled, else 1 in all other cases
perf check feature libtraceevent,bpf
The arguments are case-insensitive.
An array 'supported_features' has also been introduced that can be used by
other commands like 'perf version --build-options', so that new features
can be added in one place, with the array
Committer testing:
$ perf check feature libtraceevent,bpf
libtraceevent: [ on ] # HAVE_LIBTRACEEVENT
bpf: [ on ] # HAVE_LIBBPF_SUPPORT
$ perf check feature libtraceevent
libtraceevent: [ on ] # HAVE_LIBTRACEEVENT
$ perf check feature bpf
bpf: [ on ] # HAVE_LIBBPF_SUPPORT
$ perf check -q feature bpf && echo "BPF support is present"
BPF support is present
$ perf check -q feature Bogus && echo "Bogus support is present"
$
Reviewed-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Cc: Disha Goel <disgoel@linux.vnet.ibm.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20240904061836.55873-3-adityag@linux.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2024-09-04 11:48:31 +05:30
|
|
|
perf-check(1)
|
|
|
|
===============
|
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
|
|
|
perf-check - check if features are present in perf
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
|
|
|
[verse]
|
|
|
|
'perf check' [<options>]
|
|
|
|
'perf check' {feature <feature_list>} [<options>]
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
|
|
|
With no subcommands given, 'perf check' command just prints the command
|
|
|
|
usage on the standard output.
|
|
|
|
|
|
|
|
If the subcommand 'feature' is used, then status of feature is printed
|
|
|
|
on the standard output (unless '-q' is also passed), ie. whether it is
|
|
|
|
compiled-in/built-in or not.
|
|
|
|
Also, 'perf check feature' returns with exit status 0 if the feature
|
|
|
|
is built-in, otherwise returns with exit status 1.
|
|
|
|
|
|
|
|
SUBCOMMANDS
|
|
|
|
-----------
|
|
|
|
|
|
|
|
feature::
|
|
|
|
|
|
|
|
Print whether feature(s) is compiled-in or not, and also returns with an
|
|
|
|
exit status of 0, if passed feature(s) are compiled-in, else 1.
|
|
|
|
|
|
|
|
It expects a feature list as an argument. There can be a single feature
|
|
|
|
name/macro, or multiple features can also be passed as a comma-separated
|
|
|
|
list, in which case the exit status will be 0 only if all of the passed
|
|
|
|
features are compiled-in.
|
|
|
|
|
|
|
|
The feature names/macros are case-insensitive.
|
|
|
|
|
|
|
|
Example Usage:
|
|
|
|
perf check feature libtraceevent
|
|
|
|
perf check feature HAVE_LIBTRACEEVENT
|
|
|
|
perf check feature libtraceevent,bpf
|
|
|
|
|
|
|
|
Supported feature names/macro:
|
|
|
|
aio / HAVE_AIO_SUPPORT
|
|
|
|
bpf / HAVE_LIBBPF_SUPPORT
|
|
|
|
bpf_skeletons / HAVE_BPF_SKEL
|
|
|
|
debuginfod / HAVE_DEBUGINFOD_SUPPORT
|
2024-10-16 17:13:53 -07:00
|
|
|
dwarf / HAVE_LIBDW_SUPPORT
|
|
|
|
dwarf_getlocations / HAVE_LIBDW_SUPPORT
|
2024-09-05 00:31:31 +05:30
|
|
|
dwarf-unwind / HAVE_DWARF_UNWIND_SUPPORT
|
|
|
|
auxtrace / HAVE_AUXTRACE_SUPPORT
|
perf check: Introduce 'check' subcommand
Currently the presence of a feature is checked with a combination of
perf version --build-options and greps, such as:
perf version --build-options | grep " on .* HAVE_FEATURE"
Instead of this, introduce a subcommand "perf check feature", with which
scripts can test for presence of a feature, such as:
perf check feature HAVE_FEATURE
'perf check feature' command is expected to have exit status of 0 if
feature is built-in, and 1 if it's not built-in or if feature is not known.
Multiple features can also be passed as a comma-separated list, in which
case the exit status will be 1 only if all of the passed features are
built-in. For example, with below command, it will have exit status of 0
only if both libtraceevent and bpf are enabled, else 1 in all other cases
perf check feature libtraceevent,bpf
The arguments are case-insensitive.
An array 'supported_features' has also been introduced that can be used by
other commands like 'perf version --build-options', so that new features
can be added in one place, with the array
Committer testing:
$ perf check feature libtraceevent,bpf
libtraceevent: [ on ] # HAVE_LIBTRACEEVENT
bpf: [ on ] # HAVE_LIBBPF_SUPPORT
$ perf check feature libtraceevent
libtraceevent: [ on ] # HAVE_LIBTRACEEVENT
$ perf check feature bpf
bpf: [ on ] # HAVE_LIBBPF_SUPPORT
$ perf check -q feature bpf && echo "BPF support is present"
BPF support is present
$ perf check -q feature Bogus && echo "Bogus support is present"
$
Reviewed-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Cc: Disha Goel <disgoel@linux.vnet.ibm.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20240904061836.55873-3-adityag@linux.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2024-09-04 11:48:31 +05:30
|
|
|
libbfd / HAVE_LIBBFD_SUPPORT
|
2025-06-12 12:49:35 -07:00
|
|
|
libbpf-strings / HAVE_LIBBPF_STRINGS_SUPPORT
|
perf check: Introduce 'check' subcommand
Currently the presence of a feature is checked with a combination of
perf version --build-options and greps, such as:
perf version --build-options | grep " on .* HAVE_FEATURE"
Instead of this, introduce a subcommand "perf check feature", with which
scripts can test for presence of a feature, such as:
perf check feature HAVE_FEATURE
'perf check feature' command is expected to have exit status of 0 if
feature is built-in, and 1 if it's not built-in or if feature is not known.
Multiple features can also be passed as a comma-separated list, in which
case the exit status will be 1 only if all of the passed features are
built-in. For example, with below command, it will have exit status of 0
only if both libtraceevent and bpf are enabled, else 1 in all other cases
perf check feature libtraceevent,bpf
The arguments are case-insensitive.
An array 'supported_features' has also been introduced that can be used by
other commands like 'perf version --build-options', so that new features
can be added in one place, with the array
Committer testing:
$ perf check feature libtraceevent,bpf
libtraceevent: [ on ] # HAVE_LIBTRACEEVENT
bpf: [ on ] # HAVE_LIBBPF_SUPPORT
$ perf check feature libtraceevent
libtraceevent: [ on ] # HAVE_LIBTRACEEVENT
$ perf check feature bpf
bpf: [ on ] # HAVE_LIBBPF_SUPPORT
$ perf check -q feature bpf && echo "BPF support is present"
BPF support is present
$ perf check -q feature Bogus && echo "Bogus support is present"
$
Reviewed-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Cc: Disha Goel <disgoel@linux.vnet.ibm.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20240904061836.55873-3-adityag@linux.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2024-09-04 11:48:31 +05:30
|
|
|
libcapstone / HAVE_LIBCAPSTONE_SUPPORT
|
2024-10-16 17:13:53 -07:00
|
|
|
libdw-dwarf-unwind / HAVE_LIBDW_SUPPORT
|
perf check: Introduce 'check' subcommand
Currently the presence of a feature is checked with a combination of
perf version --build-options and greps, such as:
perf version --build-options | grep " on .* HAVE_FEATURE"
Instead of this, introduce a subcommand "perf check feature", with which
scripts can test for presence of a feature, such as:
perf check feature HAVE_FEATURE
'perf check feature' command is expected to have exit status of 0 if
feature is built-in, and 1 if it's not built-in or if feature is not known.
Multiple features can also be passed as a comma-separated list, in which
case the exit status will be 1 only if all of the passed features are
built-in. For example, with below command, it will have exit status of 0
only if both libtraceevent and bpf are enabled, else 1 in all other cases
perf check feature libtraceevent,bpf
The arguments are case-insensitive.
An array 'supported_features' has also been introduced that can be used by
other commands like 'perf version --build-options', so that new features
can be added in one place, with the array
Committer testing:
$ perf check feature libtraceevent,bpf
libtraceevent: [ on ] # HAVE_LIBTRACEEVENT
bpf: [ on ] # HAVE_LIBBPF_SUPPORT
$ perf check feature libtraceevent
libtraceevent: [ on ] # HAVE_LIBTRACEEVENT
$ perf check feature bpf
bpf: [ on ] # HAVE_LIBBPF_SUPPORT
$ perf check -q feature bpf && echo "BPF support is present"
BPF support is present
$ perf check -q feature Bogus && echo "Bogus support is present"
$
Reviewed-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Cc: Disha Goel <disgoel@linux.vnet.ibm.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20240904061836.55873-3-adityag@linux.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2024-09-04 11:48:31 +05:30
|
|
|
libelf / HAVE_LIBELF_SUPPORT
|
|
|
|
libnuma / HAVE_LIBNUMA_SUPPORT
|
|
|
|
libopencsd / HAVE_CSTRACE_SUPPORT
|
|
|
|
libperl / HAVE_LIBPERL_SUPPORT
|
|
|
|
libpfm4 / HAVE_LIBPFM
|
|
|
|
libpython / HAVE_LIBPYTHON_SUPPORT
|
|
|
|
libslang / HAVE_SLANG_SUPPORT
|
|
|
|
libtraceevent / HAVE_LIBTRACEEVENT
|
|
|
|
libunwind / HAVE_LIBUNWIND_SUPPORT
|
|
|
|
lzma / HAVE_LZMA_SUPPORT
|
|
|
|
numa_num_possible_cpus / HAVE_LIBNUMA_SUPPORT
|
|
|
|
zlib / HAVE_ZLIB_SUPPORT
|
|
|
|
zstd / HAVE_ZSTD_SUPPORT
|
|
|
|
|
|
|
|
OPTIONS
|
|
|
|
-------
|
|
|
|
-q::
|
|
|
|
--quiet::
|
|
|
|
Do not print any messages or warnings
|
|
|
|
|
|
|
|
This can be used along with subcommands such as 'perf check feature'
|
|
|
|
to hide unnecessary output in test scripts, eg.
|
|
|
|
'perf check feature --quiet libtraceevent'
|