path: root/tools/perf/perf.c
diff options
authorArnaldo Carvalho de Melo <>2011-01-11 12:42:00 -0200
committerArnaldo Carvalho de Melo <>2011-01-11 12:51:03 -0200
commitbd3bfe9eda94d3c050830217c1e1c338808de5b2 (patch)
treed2be87a7e681192994c2434592dac685f5178cc9 /tools/perf/perf.c
parent3d03e2ea74103a50c23d6ab1906cf73399c0dafb (diff)
perf evsel: Fix order of event list deletion
We need to defer calling perf_evsel_list__delete() till after atexit registered routines, because we need to traverse the events being recorded at that time at least on 'perf record'. This fixes the problem reported by Thomas Renninger where cmd_record called by cmd_timechart would not write the tracing data to the file header because the evsel_list at atexit (control+C on 'perf timechart record') time would be empty, being already deleted by run_builtin(), and thus 'perf timechart' when trying to process such file would die with: "no trace data in the file" Problem introduced in 70d544d. Reported-by: Thomas Renninger <> Cc: Frederic Weisbecker <> Cc: Ingo Molnar <> Cc: Mike Galbraith <> Cc: Paul Mackerras <> Cc: Peter Zijlstra <> Cc: Stephane Eranian <> Cc: Thomas Renninger <> Cc: Tom Zanussi <> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <>
Diffstat (limited to 'tools/perf/perf.c')
1 files changed, 0 insertions, 2 deletions
diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index 5b1ecd66bb36..595d0f4a7103 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -286,8 +286,6 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
status = p->fn(argc, argv, prefix);
- perf_evsel_list__delete();
if (status)
return status & 0xff;