diff options
| author | Frederic Weisbecker <[email protected]> | 2013-07-23 02:30:59 +0200 |
|---|---|---|
| committer | Ingo Molnar <[email protected]> | 2013-07-30 22:22:58 +0200 |
| commit | 6050cb0b0b366092d1383bc23d7b16cd26db00f0 (patch) | |
| tree | e29edecc20a04e17aa4c7f83d21a140d3e377356 /tools/perf/scripts/python/sched-migration.py | |
| parent | 7d9ffa8961482232d964173cccba6e14d2d543b2 (diff) | |
perf: Fix branch stack refcount leak on callchain init failure
On callchain buffers allocation failure, free_event() is
called and all the accounting performed in perf_event_alloc()
for that event is cancelled.
But if the event has branch stack sampling, it is unaccounted
as well from the branch stack sampling events refcounts.
This is a bug because this accounting is performed after the
callchain buffer allocation. As a result, the branch stack sampling
events refcount can become negative.
To fix this, move the branch stack event accounting before the
callchain buffer allocation.
Reported-by: Peter Zijlstra <[email protected]>
Signed-off-by: Frederic Weisbecker <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Stephane Eranian <[email protected]>
Signed-off-by: Peter Zijlstra <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/sched-migration.py')
0 files changed, 0 insertions, 0 deletions