diff options
Diffstat (limited to 'tools/perf/builtin-trace.c')
-rw-r--r-- | tools/perf/builtin-trace.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index d95a8f4d988c..211614fba217 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c | |||
@@ -1741,7 +1741,10 @@ static int trace__sys_enter(struct trace *trace, struct perf_evsel *evsel, | |||
1741 | } else | 1741 | } else |
1742 | ttrace->entry_pending = true; | 1742 | ttrace->entry_pending = true; |
1743 | 1743 | ||
1744 | trace->current = thread; | 1744 | if (trace->current != thread) { |
1745 | thread__put(trace->current); | ||
1746 | trace->current = thread__get(thread); | ||
1747 | } | ||
1745 | 1748 | ||
1746 | return 0; | 1749 | return 0; |
1747 | } | 1750 | } |
@@ -2274,6 +2277,8 @@ next_event: | |||
2274 | } | 2277 | } |
2275 | 2278 | ||
2276 | out_disable: | 2279 | out_disable: |
2280 | thread__zput(trace->current); | ||
2281 | |||
2277 | perf_evlist__disable(evlist); | 2282 | perf_evlist__disable(evlist); |
2278 | 2283 | ||
2279 | if (!err) { | 2284 | if (!err) { |