path: root/tools/perf/perf.c
diff options
authorJiri Olsa <>2012-10-31 15:52:47 +0100
committerArnaldo Carvalho de Melo <>2012-10-31 16:20:58 -0200
commit52502bf201a85b5b51a384037a002d0b39093df0 (patch)
treec4d2bcbc4c1f7c10693b132ad70951c06c2cee86 /tools/perf/perf.c
parent945aea220bb8f4bb37950549cc0b93bbec24c460 (diff)
perf tests: Add framework for automated perf_event_attr tests
The idea is run perf session with kidnapping sys_perf_event_open function. For each sys_perf_event_open call we store the perf_event_attr data to the file to be checked later against what we expect. You can run this by: $ python ./tests/ -d ./tests/attr/ -p ./perf -v v2 changes: - preserve errno value in the hook Signed-off-by: Jiri Olsa <> Cc: Arnaldo Carvalho de Melo <> Cc: Corey Ashford <> Cc: Frederic Weisbecker <> Cc: Ingo Molnar <> Cc: Paul Mackerras <> Cc: Peter Zijlstra <> Link: Signed-off-by: Arnaldo Carvalho de Melo <>
Diffstat (limited to 'tools/perf/perf.c')
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index e9683738d89f..a0ae2902f9c9 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -484,6 +484,8 @@ int main(int argc, const char **argv)
cmd = argv[0];
+ test_attr__init();
* We use PATH to find perf commands, but we prepend some higher
* precedence paths: the "--exec-path" option, the PERF_EXEC_PATH