Skip to contentSkip to conversation

perf test: Silence perf check subcommand when not supported

PATCH In review Thomas Richter 3 participants 3 messages Sep 11, 2024 – Sep 26, 2024 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf test: Silence perf check subcommand when not supported

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.

---
 tools/perf/tests/shell/lib/probe_vfs_getname.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/shell/lib/probe_vfs_getname.sh +1 -1
index 5c33ec7a5a63..697fbe296a62 100644
@@ -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
 }
Signature · 1 line
2.46.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 2 lines · Thomas Richter

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.

Quoted 21 lines
  # 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.

---
  tools/perf/tests/shell/lib/probe_vfs_getname.sh | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/shell/lib/probe_vfs_getname.sh +0 -0
index 5c33ec7a5a63..697fbe296a62 100644

tools/perf/tests/shell/lib/probe_vfs_getname.sh skip_if_no_debuginfo() { · line 35

Quoted 5 lines
tools/perf/tests/shell/lib/probe_vfs_getname.sh +1 -1
@@ -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:

maintainer
#2 lore raw
Quoted 18 lines · James Clark
Quoted 2 lines · Thomas Richter

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.

Quoted 7 lines
  # 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

Quoted 25 lines
Quoted 14 lines

#

Drop this error message, the return code is sufficient.

---
  tools/perf/tests/shell/lib/probe_vfs_getname.sh | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/shell/lib/probe_vfs_getname.sh +0 -0
index 5c33ec7a5a63..697fbe296a62 100644

tools/perf/tests/shell/lib/probe_vfs_getname.sh skip_if_no_debuginfo() { · line 35

Quoted 5 lines
tools/perf/tests/shell/lib/probe_vfs_getname.sh +1 -1
@@ -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: