linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] perf test: Do not fail Intel-PT misc test w/o libpython
@ 2022-10-21 18:10 Namhyung Kim
  2022-10-21 22:00 ` Ian Rogers
  2022-10-23 16:46 ` Adrian Hunter
  0 siblings, 2 replies; 4+ messages in thread
From: Namhyung Kim @ 2022-10-21 18:10 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Jiri Olsa
  Cc: Ingo Molnar, Peter Zijlstra, LKML, Ian Rogers, Adrian Hunter,
	linux-perf-users, Ammy Yi

The virtuall LBR test uses a python script to check the max size of
branch stack in the Intel-PT generated LBR.  But it didn't check whether
python scripting is available (as it's optional).

Let's skip the test if the python support is not available.

Fixes: f77811a0f625 ("perf test: test_intel_pt.sh: Add 9 tests")
Cc: Ammy Yi <ammy.yi@intel.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/tests/shell/test_intel_pt.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/perf/tests/shell/test_intel_pt.sh b/tools/perf/tests/shell/test_intel_pt.sh
index 4c0aabbe33bd..f5ed7b1af419 100755
--- a/tools/perf/tests/shell/test_intel_pt.sh
+++ b/tools/perf/tests/shell/test_intel_pt.sh
@@ -526,6 +526,12 @@ test_kernel_trace()
 test_virtual_lbr()
 {
 	echo "--- Test virtual LBR ---"
+	# Check if python script is supported
+	libpython=$(perf version --build-options | grep python | grep -cv OFF)
+	if [ "${libpython}" != "1" ] ; then
+		echo "SKIP: python scripting is not supported"
+		return 2
+	fi
 
 	# Python script to determine the maximum size of branch stacks
 	cat << "_end_of_file_" > "${maxbrstack}"
-- 
2.38.0.135.g90850a2211-goog


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] perf test: Do not fail Intel-PT misc test w/o libpython
  2022-10-21 18:10 [PATCH v2] perf test: Do not fail Intel-PT misc test w/o libpython Namhyung Kim
@ 2022-10-21 22:00 ` Ian Rogers
  2022-10-24 11:39   ` Arnaldo Carvalho de Melo
  2022-10-23 16:46 ` Adrian Hunter
  1 sibling, 1 reply; 4+ messages in thread
From: Ian Rogers @ 2022-10-21 22:00 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Arnaldo Carvalho de Melo, Jiri Olsa, Ingo Molnar, Peter Zijlstra,
	LKML, Adrian Hunter, linux-perf-users, Ammy Yi

On Fri, Oct 21, 2022 at 11:11 AM Namhyung Kim <namhyung@kernel.org> wrote:
>
> The virtuall LBR test uses a python script to check the max size of

nit: virtual

> branch stack in the Intel-PT generated LBR.  But it didn't check whether
> python scripting is available (as it's optional).
>
> Let's skip the test if the python support is not available.
>
> Fixes: f77811a0f625 ("perf test: test_intel_pt.sh: Add 9 tests")
> Cc: Ammy Yi <ammy.yi@intel.com>
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>

Acked-by: Ian Rogers <irogers@google.com>

Thanks,
Ian

> ---
>  tools/perf/tests/shell/test_intel_pt.sh | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/tools/perf/tests/shell/test_intel_pt.sh b/tools/perf/tests/shell/test_intel_pt.sh
> index 4c0aabbe33bd..f5ed7b1af419 100755
> --- a/tools/perf/tests/shell/test_intel_pt.sh
> +++ b/tools/perf/tests/shell/test_intel_pt.sh
> @@ -526,6 +526,12 @@ test_kernel_trace()
>  test_virtual_lbr()
>  {
>         echo "--- Test virtual LBR ---"
> +       # Check if python script is supported
> +       libpython=$(perf version --build-options | grep python | grep -cv OFF)
> +       if [ "${libpython}" != "1" ] ; then
> +               echo "SKIP: python scripting is not supported"
> +               return 2
> +       fi
>
>         # Python script to determine the maximum size of branch stacks
>         cat << "_end_of_file_" > "${maxbrstack}"
> --
> 2.38.0.135.g90850a2211-goog
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] perf test: Do not fail Intel-PT misc test w/o libpython
  2022-10-21 18:10 [PATCH v2] perf test: Do not fail Intel-PT misc test w/o libpython Namhyung Kim
  2022-10-21 22:00 ` Ian Rogers
@ 2022-10-23 16:46 ` Adrian Hunter
  1 sibling, 0 replies; 4+ messages in thread
From: Adrian Hunter @ 2022-10-23 16:46 UTC (permalink / raw)
  To: Namhyung Kim, Arnaldo Carvalho de Melo, Jiri Olsa
  Cc: Ingo Molnar, Peter Zijlstra, LKML, Ian Rogers, linux-perf-users, Ammy Yi

On 21/10/22 21:10, Namhyung Kim wrote:
> The virtuall LBR test uses a python script to check the max size of
> branch stack in the Intel-PT generated LBR.  But it didn't check whether
> python scripting is available (as it's optional).
> 
> Let's skip the test if the python support is not available.
> 
> Fixes: f77811a0f625 ("perf test: test_intel_pt.sh: Add 9 tests")
> Cc: Ammy Yi <ammy.yi@intel.com>
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>

Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
>  tools/perf/tests/shell/test_intel_pt.sh | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/tools/perf/tests/shell/test_intel_pt.sh b/tools/perf/tests/shell/test_intel_pt.sh
> index 4c0aabbe33bd..f5ed7b1af419 100755
> --- a/tools/perf/tests/shell/test_intel_pt.sh
> +++ b/tools/perf/tests/shell/test_intel_pt.sh
> @@ -526,6 +526,12 @@ test_kernel_trace()
>  test_virtual_lbr()
>  {
>  	echo "--- Test virtual LBR ---"
> +	# Check if python script is supported
> +	libpython=$(perf version --build-options | grep python | grep -cv OFF)
> +	if [ "${libpython}" != "1" ] ; then
> +		echo "SKIP: python scripting is not supported"
> +		return 2
> +	fi
>  
>  	# Python script to determine the maximum size of branch stacks
>  	cat << "_end_of_file_" > "${maxbrstack}"


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] perf test: Do not fail Intel-PT misc test w/o libpython
  2022-10-21 22:00 ` Ian Rogers
@ 2022-10-24 11:39   ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2022-10-24 11:39 UTC (permalink / raw)
  To: Ian Rogers
  Cc: Namhyung Kim, Jiri Olsa, Ingo Molnar, Peter Zijlstra, LKML,
	Adrian Hunter, linux-perf-users, Ammy Yi

Em Fri, Oct 21, 2022 at 03:00:04PM -0700, Ian Rogers escreveu:
> On Fri, Oct 21, 2022 at 11:11 AM Namhyung Kim <namhyung@kernel.org> wrote:
> >
> > The virtuall LBR test uses a python script to check the max size of
> 
> nit: virtual

Thanks, fixed and applied.

- Arnaldo
 
> > branch stack in the Intel-PT generated LBR.  But it didn't check whether
> > python scripting is available (as it's optional).
> >
> > Let's skip the test if the python support is not available.
> >
> > Fixes: f77811a0f625 ("perf test: test_intel_pt.sh: Add 9 tests")
> > Cc: Ammy Yi <ammy.yi@intel.com>
> > Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> 
> Acked-by: Ian Rogers <irogers@google.com>
> 
> Thanks,
> Ian
> 
> > ---
> >  tools/perf/tests/shell/test_intel_pt.sh | 6 ++++++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/tools/perf/tests/shell/test_intel_pt.sh b/tools/perf/tests/shell/test_intel_pt.sh
> > index 4c0aabbe33bd..f5ed7b1af419 100755
> > --- a/tools/perf/tests/shell/test_intel_pt.sh
> > +++ b/tools/perf/tests/shell/test_intel_pt.sh
> > @@ -526,6 +526,12 @@ test_kernel_trace()
> >  test_virtual_lbr()
> >  {
> >         echo "--- Test virtual LBR ---"
> > +       # Check if python script is supported
> > +       libpython=$(perf version --build-options | grep python | grep -cv OFF)
> > +       if [ "${libpython}" != "1" ] ; then
> > +               echo "SKIP: python scripting is not supported"
> > +               return 2
> > +       fi
> >
> >         # Python script to determine the maximum size of branch stacks
> >         cat << "_end_of_file_" > "${maxbrstack}"
> > --
> > 2.38.0.135.g90850a2211-goog
> >

-- 

- Arnaldo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-10-24 22:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-21 18:10 [PATCH v2] perf test: Do not fail Intel-PT misc test w/o libpython Namhyung Kim
2022-10-21 22:00 ` Ian Rogers
2022-10-24 11:39   ` Arnaldo Carvalho de Melo
2022-10-23 16:46 ` Adrian Hunter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).