Skip to contentSkip to conversation

perf tests: Let 'perf test list' display subtests

tip:perf/core tip-bot for Hendrik Brueckner 1 participant 1 message May 2, 2018 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  ea40b6d3222e5feef178d9b49baead28e9b5fe20
Gitweb:     https://git.kernel.org/tip/ea40b6d3222e5feef178d9b49baead28e9b5fe20
Author:     Hendrik Brueckner <[email protected]>
AuthorDate: Fri, 13 Apr 2018 09:42:23 +0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Thu, 26 Apr 2018 13:47:07 -0300

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

LPU-Reference: [email protected]

---
 tools/perf/tests/builtin-test.c | 9 +++++++++
 1 file changed, 9 insertions(+)
tools/perf/tests/builtin-test.c +9 -0
index cac8f8889bc3..2bde505e2e7e 100644
@@ -654,6 +654,15 @@ static int perf_test__list(int argc, const char **argv)
 			continue;
 
 		pr_info("%2d: %s\n", i, t->desc);
+
+		if (t->subtest.get_nr) {
+			int subn = t->subtest.get_nr();
+			int subi;
+
+			for (subi = 0; subi < subn; subi++)
+				pr_info("%2d:%1d: %s\n", i, subi + 1,
+					t->subtest.get_desc(subi));
+		}
 	}
 
 	perf_test__list_shell(argc, argv, i);