Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf tests: Let 'perf test list' display subtests

The output of perf test and perf test list differ because perf test list
does not display subtests. Correct this behavior and also let perf test
list report subtests.

For example:

$ ./perf test 2>&1 |wc -l
65

Without this commit:
$ ./perf test list 2>&1 |wc -l
57

With this commit:
$ ./perf test list 2>&1 |wc -l
65

Signed-off-by: Hendrik Brueckner <brueckner@linux.ibm.com>
Reviewed-by: Thomas Richter <tmricht@linux.ibm.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: linux-s390@vger.kernel.org
LPU-Reference: 1523605343-11970-1-git-send-email-brueckner@linux.ibm.com
Link: https://lkml.kernel.org/n/tip-efb74jw7x2xs2bucp5hf4ilu@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Hendrik Brueckner and committed by
Arnaldo Carvalho de Melo
ea40b6d3 f07a2d32

+9
+9
tools/perf/tests/builtin-test.c
··· 654 654 continue; 655 655 656 656 pr_info("%2d: %s\n", i, t->desc); 657 + 658 + if (t->subtest.get_nr) { 659 + int subn = t->subtest.get_nr(); 660 + int subi; 661 + 662 + for (subi = 0; subi < subn; subi++) 663 + pr_info("%2d:%1d: %s\n", i, subi + 1, 664 + t->subtest.get_desc(subi)); 665 + } 657 666 } 658 667 659 668 perf_test__list_shell(argc, argv, i);