[PATCH v1 5/6] perf test intel-pt: Skip jitdump test if no libelf

Ian Rogers posted 6 patches 3 months, 1 week ago
There is a newer version of this series
[PATCH v1 5/6] perf test intel-pt: Skip jitdump test if no libelf
Posted by Ian Rogers 3 months, 1 week ago
jitdump support is only present if building with libelf. Skip the
intel-pt jitdump test if perf isn't compiled with libelf support.

Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/perf/tests/shell/test_intel_pt.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/perf/tests/shell/test_intel_pt.sh b/tools/perf/tests/shell/test_intel_pt.sh
index f3a9a040bacc..32a9b8dcb200 100755
--- a/tools/perf/tests/shell/test_intel_pt.sh
+++ b/tools/perf/tests/shell/test_intel_pt.sh
@@ -288,6 +288,11 @@ test_jitdump()
 	jitdump_incl_dir="${script_dir}/../../util"
 	jitdump_h="${jitdump_incl_dir}/jitdump.h"
 
+        if ! perf check feature -q libelf ; then
+		echo "SKIP: libelf is needed for jitdump"
+		return 2
+	fi
+
 	if [ ! -e "${jitdump_h}" ] ; then
 		echo "SKIP: Include file jitdump.h not found"
 		return 2
-- 
2.49.0.1204.g71687c7c1d-goog
Re: [PATCH v1 5/6] perf test intel-pt: Skip jitdump test if no libelf
Posted by Arnaldo Carvalho de Melo 3 months, 1 week ago
On Tue, May 27, 2025 at 11:07:02AM -0700, Ian Rogers wrote:
> jitdump support is only present if building with libelf. Skip the
> intel-pt jitdump test if perf isn't compiled with libelf support.

Thanks, applied to perf-tools-next,

- Arnaldo
 
> Signed-off-by: Ian Rogers <irogers@google.com>
> ---
>  tools/perf/tests/shell/test_intel_pt.sh | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/tools/perf/tests/shell/test_intel_pt.sh b/tools/perf/tests/shell/test_intel_pt.sh
> index f3a9a040bacc..32a9b8dcb200 100755
> --- a/tools/perf/tests/shell/test_intel_pt.sh
> +++ b/tools/perf/tests/shell/test_intel_pt.sh
> @@ -288,6 +288,11 @@ test_jitdump()
>  	jitdump_incl_dir="${script_dir}/../../util"
>  	jitdump_h="${jitdump_incl_dir}/jitdump.h"
>  
> +        if ! perf check feature -q libelf ; then
> +		echo "SKIP: libelf is needed for jitdump"
> +		return 2
> +	fi
> +
>  	if [ ! -e "${jitdump_h}" ] ; then
>  		echo "SKIP: Include file jitdump.h not found"
>  		return 2
> -- 
> 2.49.0.1204.g71687c7c1d-goog