diff --git a/[refs] b/[refs] index 1e247198d5e0..d864ed00b2ec 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: fec9cbd15b9e99bab9bc50f1ed7e20a1087d7c6d +refs/heads/master: 712a4b6049724278121d56aba683151d86c8c35a diff --git a/trunk/tools/perf/builtin-record.c b/trunk/tools/perf/builtin-record.c index a4aaadcb4c8b..db4cd1e7b51a 100644 --- a/trunk/tools/perf/builtin-record.c +++ b/trunk/tools/perf/builtin-record.c @@ -538,11 +538,6 @@ static int __cmd_record(int argc, const char **argv) if (have_tracepoints(&evsel_list->entries)) perf_header__set_feat(&session->header, HEADER_TRACE_INFO); - /* - * perf_session__delete(session) will be called at atexit_header() - */ - atexit(atexit_header); - if (forks) { child_pid = fork(); if (child_pid < 0) { @@ -601,6 +596,11 @@ static int __cmd_record(int argc, const char **argv) perf_session__set_sample_type(session, sample_type); + /* + * perf_session__delete(session) will be called at atexit_header() + */ + atexit(atexit_header); + if (pipe_output) { err = perf_header__write_pipe(output); if (err < 0)