perf callchain: Add order support for libunwind DWARF unwinder
authorJiri Olsa <jolsa@redhat.com>
Wed, 18 Nov 2015 07:52:47 +0000 (08:52 +0100)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 23 Nov 2015 21:30:41 +0000 (18:30 -0300)
commitcb1dc22dce6e54dbd1eac213c9216e1aa57084da
tree977a3f7b43d22a9e0173df61bb317de4c399956d
parentb26b218a1e9c5815cb8964e180b7fba3cd9bd509
perf callchain: Add order support for libunwind DWARF unwinder

As reported by Milian, currently for DWARF unwind (both libdw and
libunwind) we display callchain in callee order only.

Adding the support to follow callchain order setup to libunwind DWARF
unwinder, so we could get following output for report:

  $ perf record --call-graph dwarf ls
  ...
  $ perf report --no-children --stdio

    39.26%  ls       libc-2.21.so      [.] __strcoll_l
                 |
                 ---__strcoll_l
                    mpsort_with_tmp
                    mpsort_with_tmp
                    sort_files
                    main
                    __libc_start_main
                    _start
                    0

  $ perf report -g caller --no-children --stdio
    ...
    39.26%  ls       libc-2.21.so      [.] __strcoll_l
                 |
                 ---0
                    _start
                    __libc_start_main
                    main
                    sort_files
                    mpsort_with_tmp
                    mpsort_with_tmp
                    __strcoll_l

Based-on-patch-by: Milian Wolff <milian.wolff@kdab.com>
Reported-and-Tested-by: Milian Wolff <milian.wolff@kdab.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Tested-by: Wang Nan <wangnan0@huawei.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/20151118075247.GA5416@krava.brq.redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/unwind-libunwind.c