perf hists browser: Cleanup callchain print functions
authorNamhyung Kim <namhyung@kernel.org>
Thu, 21 Aug 2014 01:15:45 +0000 (10:15 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 22 Aug 2014 16:12:12 +0000 (13:12 -0300)
commitc09a7e755c025558cb882fa20a5f30da738536fa
tree4d39a5d1ee49bcb397152df63d829fad4c18eb0c
parentfbe2af45f6bd27ee69fd775303c936c3af4a4807
perf hists browser: Cleanup callchain print functions

The hist_browser__show_callchain() and friends don't need to be that
complex.  They're splitted in 3 pieces - one for traversing top-level
tree, other one for special casing first chains in the top-level
entries, and last one for recursive traversing inner trees.  It led to
code duplication and unnecessary complexity IMHO.

Simplify the function and consolidate the logic into a single function
- it can recursively call itself.  A little difference in printing
  callchains in top-level tree can be handled with a small change.

It should have no functional change.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1408583746-5540-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/ui/browsers/hists.c