Messages in this thread Patch in this message | | | From | Jiri Olsa <> | Subject | [PATCH 06/16] perf tools: Fix dwarf unwind max_stack processing | Date | Tue, 7 Jan 2014 13:47:23 +0100 |
| |
The 'unwind__get_entries' function currently returns 'max_stack + 1' entries (instead of exact max_stack entries), because max_stack value does not get decremented for the first entry.
This fix makes dwarf-unwind test pass.
Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Cc: David Ahern <dsahern@gmail.com> Cc: Jean Pihet <jean.pihet@linaro.org> --- tools/perf/util/unwind.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/unwind.c b/tools/perf/util/unwind.c index 0efd539..87509d8 100644 --- a/tools/perf/util/unwind.c +++ b/tools/perf/util/unwind.c @@ -611,5 +611,5 @@ int unwind__get_entries(unwind_entry_cb_t cb, void *arg, if (ret) return -ENOMEM; - return get_entries(&ui, cb, arg, max_stack); + return --max_stack > 0 ? get_entries(&ui, cb, arg, max_stack) : 0; } -- 1.8.3.1
| |