Skip to contentSkip to conversation

perf test: Allow running just a subset of the available tests

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Dec 5, 2011 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  e60770a01bd889707faaaeb794f1e278e7160458
Gitweb:     http://git.kernel.org/tip/e60770a01bd889707faaaeb794f1e278e7160458
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Tue, 29 Nov 2011 12:52:07 -0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Tue, 29 Nov 2011 14:04:35 -0200

perf test: Allow running just a subset of the available tests

To obtain a list of available tests:

[root@emilia linux]# perf test list
1: vmlinux symtab matches kallsyms
2: detect open syscall event
3: detect open syscall event on all cpus
4: read samples using the mmap interface
5: parse events tests
[root@emilia linux]#

To list just a subset:

[root@emilia linux]# perf test list syscall
2: detect open syscall event
3: detect open syscall event on all cpus
[root@emilia linux]#

To run a subset:

[root@emilia linux]# perf test detect
2: detect open syscall event: Ok
3: detect open syscall event on all cpus: Ok
[root@emilia linux]#

Specific tests can be chosen by number:

[root@emilia linux]# perf test 1 3 parse
1: vmlinux symtab matches kallsyms: Ok
3: detect open syscall event on all cpus: Ok
5: parse events tests: Ok
[root@emilia linux]#

Now to write more tests!

---
 tools/perf/Documentation/perf-test.txt |    8 +++-
 tools/perf/builtin-test.c              |   81 +++++++++++++++++++++++--------
 2 files changed, 67 insertions(+), 22 deletions(-)
tools/perf/Documentation/perf-test.txt +7 -1
index 2c3b462..b24ac40 100644
@@ -8,13 +8,19 @@ perf-test - Runs sanity tests.
 SYNOPSIS
 --------
 [verse]
-'perf test <options>'
+'perf test [<options>] [{list <test-name-fragment>|[<test-name-fragments>|<test-numbers>]}]'
 
 DESCRIPTION
 -----------
 This command does assorted sanity tests, initially through linked routines but
 also will look for a directory with more tests in the form of scripts.
 
+To get a list of available tests use 'perf test list', specifying a test name
+fragment will show all tests that have it.
+
+To run just specific tests, inform test name fragments or the numbers obtained
+from 'perf test list'.
+
 OPTIONS
 -------
 -v::
tools/perf/builtin-test.c +60 -21

120 lines not on this page · raw message