Skip to contentSkip to conversation

perf trace: Drop thread refcount in trace__event_handler()

tip:perf/urgent tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Oct 26, 2018 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  a937c6658b8e77e1f65cde2be9970811752121bb
Gitweb:     https://git.kernel.org/tip/a937c6658b8e77e1f65cde2be9970811752121bb
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Sat, 20 Oct 2018 09:27:52 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 22 Oct 2018 12:37:52 -0300

perf trace: Drop thread refcount in trace__event_handler()

We must pair:

   thread = machine__findnew_thread();

with thread__put(thread). Fix it.

Cc Adrian Hunter <[email protected]>
Cc David Ahern <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Wang Nan <[email protected]>
Fixes c4191e55b874 ("perf trace: Show comm and tid for tracepoint events")
---
 tools/perf/builtin-trace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/builtin-trace.c +1 -1
index 77b8748ad5ed..589e0412652a 100644
@@ -2152,8 +2152,8 @@ newline:
 		trace__fprintf_callchain(trace, sample);
 	else if (callchain_ret < 0)
 		pr_err("Problem processing %s callchain, skipping...\n", perf_evsel__name(evsel));
-	thread__put(thread);
 out:
+	thread__put(thread);
 	return 0;
 }