linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf test: Silence perf check subcommand when not supported
@ 2024-09-11 12:28 Thomas Richter
  2024-09-11 13:34 ` James Clark
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Richter @ 2024-09-11 12:28 UTC (permalink / raw)
  To: linux-kernel, linux-perf-users, acme
  Cc: agordeev, gor, sumanthk, hca, Thomas Richter

Perf subcommand check might not be supported and prints an
error message when used:

 # perf check feature -q libtraceevent
 perf: 'check' is not a perf-command. See 'perf --help'.

 Did you mean one of these?
        c2c
        sched
 #

Drop this error message, the return code is sufficient.

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
---
 tools/perf/tests/shell/lib/probe_vfs_getname.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/tests/shell/lib/probe_vfs_getname.sh b/tools/perf/tests/shell/lib/probe_vfs_getname.sh
index 5c33ec7a5a63..697fbe296a62 100644
--- a/tools/perf/tests/shell/lib/probe_vfs_getname.sh
+++ b/tools/perf/tests/shell/lib/probe_vfs_getname.sh
@@ -32,7 +32,7 @@ skip_if_no_debuginfo() {
 # check if perf is compiled with libtraceevent support
 skip_no_probe_record_support() {
 	if [ $had_vfs_getname -eq 1 ] ; then
-		perf check feature -q libtraceevent && return 1
+		perf check feature -q libtraceevent >/dev/null 2>&1 && return 1
 		return 2
 	fi
 }
-- 
2.46.0


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

* Re: [PATCH] perf test: Silence perf check subcommand when not supported
  2024-09-11 12:28 [PATCH] perf test: Silence perf check subcommand when not supported Thomas Richter
@ 2024-09-11 13:34 ` James Clark
  2024-09-26  5:35   ` Namhyung Kim
  0 siblings, 1 reply; 3+ messages in thread
From: James Clark @ 2024-09-11 13:34 UTC (permalink / raw)
  To: Thomas Richter, linux-kernel, linux-perf-users, acme
  Cc: agordeev, gor, sumanthk, hca



On 11/09/2024 13:28, Thomas Richter wrote:
> Perf subcommand check might not be supported and prints an
> error message when used:

Only in verbose mode though. Personally I don't like all the piping to 
/dev/null in the tests because I have to go and remove them every time a 
test fails, rather than just doing "-v". But as it's pretty much the 
pattern used I suppose we should continue.

> 
>   # perf check feature -q libtraceevent
>   perf: 'check' is not a perf-command. See 'perf --help'.
> 
>   Did you mean one of these?
>          c2c
>          sched
>   #
> 
> Drop this error message, the return code is sufficient.
> 
> Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
> ---
>   tools/perf/tests/shell/lib/probe_vfs_getname.sh | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/perf/tests/shell/lib/probe_vfs_getname.sh b/tools/perf/tests/shell/lib/probe_vfs_getname.sh
> index 5c33ec7a5a63..697fbe296a62 100644
> --- a/tools/perf/tests/shell/lib/probe_vfs_getname.sh
> +++ b/tools/perf/tests/shell/lib/probe_vfs_getname.sh
> @@ -32,7 +32,7 @@ skip_if_no_debuginfo() {
>   # check if perf is compiled with libtraceevent support
>   skip_no_probe_record_support() {
>   	if [ $had_vfs_getname -eq 1 ] ; then
> -		perf check feature -q libtraceevent && return 1
> +		perf check feature -q libtraceevent >/dev/null 2>&1 && return 1

There's another of the same in tools/perf/tests/shell/test_task_analyzer.sh

With that:

Reviewed-by: James Clark <james.clark@linaro.org>

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

* Re: [PATCH] perf test: Silence perf check subcommand when not supported
  2024-09-11 13:34 ` James Clark
@ 2024-09-26  5:35   ` Namhyung Kim
  0 siblings, 0 replies; 3+ messages in thread
From: Namhyung Kim @ 2024-09-26  5:35 UTC (permalink / raw)
  To: James Clark
  Cc: Thomas Richter, linux-kernel, linux-perf-users, acme, agordeev,
	gor, sumanthk, hca

On Wed, Sep 11, 2024 at 02:34:27PM +0100, James Clark wrote:
> 
> 
> On 11/09/2024 13:28, Thomas Richter wrote:
> > Perf subcommand check might not be supported and prints an
> > error message when used:
> 
> Only in verbose mode though. Personally I don't like all the piping to
> /dev/null in the tests because I have to go and remove them every time a
> test fails, rather than just doing "-v". But as it's pretty much the pattern
> used I suppose we should continue.
> 
> > 
> >   # perf check feature -q libtraceevent
> >   perf: 'check' is not a perf-command. See 'perf --help'.
> > 
> >   Did you mean one of these?
> >          c2c
> >          sched

I think perf test is supposed to run the latest build so perf check
command should be available.  Do you see this in the test result or just
in the command line?

Thanks,
Namhyung


> >   #
> > 
> > Drop this error message, the return code is sufficient.
> > 
> > Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
> > ---
> >   tools/perf/tests/shell/lib/probe_vfs_getname.sh | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/tools/perf/tests/shell/lib/probe_vfs_getname.sh b/tools/perf/tests/shell/lib/probe_vfs_getname.sh
> > index 5c33ec7a5a63..697fbe296a62 100644
> > --- a/tools/perf/tests/shell/lib/probe_vfs_getname.sh
> > +++ b/tools/perf/tests/shell/lib/probe_vfs_getname.sh
> > @@ -32,7 +32,7 @@ skip_if_no_debuginfo() {
> >   # check if perf is compiled with libtraceevent support
> >   skip_no_probe_record_support() {
> >   	if [ $had_vfs_getname -eq 1 ] ; then
> > -		perf check feature -q libtraceevent && return 1
> > +		perf check feature -q libtraceevent >/dev/null 2>&1 && return 1
> 
> There's another of the same in tools/perf/tests/shell/test_task_analyzer.sh
> 
> With that:
> 
> Reviewed-by: James Clark <james.clark@linaro.org>

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

end of thread, other threads:[~2024-09-26  5:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-11 12:28 [PATCH] perf test: Silence perf check subcommand when not supported Thomas Richter
2024-09-11 13:34 ` James Clark
2024-09-26  5:35   ` Namhyung Kim

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).