linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/6] Add support for remote unwind
@ 2016-05-19 11:47 He Kuang
  2016-05-19 11:47 ` [PATCH v4 1/6] perf tools: Set buildid dir under symfs when --symfs is provided He Kuang
                   ` (5 more replies)
  0 siblings, 6 replies; 17+ messages in thread
From: He Kuang @ 2016-05-19 11:47 UTC (permalink / raw)
  To: peterz, mingo, acme, alexander.shishkin, jolsa, wangnan0,
	hekuang, jpoimboe, ak, eranian, namhyung, adrian.hunter, sukadev,
	masami.hiramatsu.pt, tumanova, kan.liang, penberg, dsahern
  Cc: linux-kernel

v3 url:
  http://thread.gmane.org/gmane.linux.kernel/2220387

Currently, perf script uses host unwind methods(local unwind) to parse
perf.data callchain info regardless of the target architecture. So we
get wrong result and no promotion when do remote unwind on other
platforms/machines.

This patchset checks whether a dso is 32-bit or 64-bit according to
elf class info for each thread to let perf use the correct remote
unwind methods instead.

Only x86 and aarch64 is added in this patchset to show the work flow,
other platforms can be added easily.

We can see the right result for unwind info on different machines, for
example: perf.data recorded on i686 qemu with '-g' option and parsed
on x86_64 machine.

before this patchset:

  hello  1219 [001] 72190.667975: probe:sys_close: (c1169d60)
                  c1169d61 sys_close ([kernel.kallsyms])
                  c189c0d7 sysenter_past_esp ([kernel.kallsyms])
                  b777aba9 [unknown] ([vdso32])

after:
(Add vdso into buildid-cache first by 'perf buildid-cache -a' and
libraries are provided in symfs dir)

  hello  1219 [001] 72190.667975: probe:sys_close: (c1169d60)
                  c1169d61 sys_close ([kernel.kallsyms])
                  c189c0d7 sysenter_past_esp ([kernel.kallsyms])
                  b777aba9 __kernel_vsyscall ([vdso32])
                  b76971cc close (/lib/libc-2.22.so)
                   804842e fib (/tmp/hello)
                   804849d main (/tmp/hello)
                  b75d746e __libc_start_main (/lib/libc-2.22.so)
                   8048341 _start (/tmp/hello)

v4:

 - Move reference of buildid dir to 'symfs/.debug' if --symfs is
   given.
 - Split makefile changes out of patch 'Add support for
   cross-platform unwind'.
 - Use existing code normalize_arch() for testing the arch of
   perf.data.

v3:

 - Remove --vdso option, store vdso buildid in perf.data and let perf
   fetch it automatically.
 - Use existing dso__type() function to test if dso is 32-bit or
   64-bit.

v2:

 - Explain the reason why we can omit dwarf judgement when recording
   in commit message.
 - Elaborate on why we need to add a custom vdso path option, and
   change the type name to DSO_BINARY_TYPE__VDSO.
 - Hide the build tests status for cross platform unwind.
 - Keep generic version of libunwind-debug-frame test.
 - Put 32/64-bit test functions into separate patch.
 - Extract unwind related functions to unwind-libunwind.c and add new
   file for common parts used by both local and remote unwind.
 - Eliminate most of the ifdefs in .c file.

Thanks.

He Kuang (6):
  perf tools: Set buildid dir under symfs when --symfs is provided
  perf tools: Promote proper messages for cross-platform unwind
  perf tools: Separate local and remote unwind support detection
  perf callchain: Add support for cross-platform unwind
  perf callchain: Support x86 target platform
  perf callchain: Support aarch64 cross-platform

 .../arch/arm64/include/libunwind/libunwind-arch.h  |  18 ++++
 tools/perf/arch/arm64/util/unwind-libunwind.c      |   5 +-
 tools/perf/arch/common.c                           |   2 +-
 tools/perf/arch/common.h                           |   1 +
 .../arch/x86/include/libunwind/libunwind-arch.h    |  18 ++++
 tools/perf/arch/x86/util/unwind-libunwind.c        |  12 ++-
 tools/perf/builtin-annotate.c                      |   5 +-
 tools/perf/builtin-diff.c                          |   5 +-
 tools/perf/builtin-report.c                        |   5 +-
 tools/perf/builtin-script.c                        |   5 +-
 tools/perf/builtin-timechart.c                     |   5 +-
 tools/perf/config/Makefile                         |  37 ++++++-
 tools/perf/util/Build                              |  13 ++-
 tools/perf/util/dso.c                              |   4 +-
 tools/perf/util/symbol.c                           |  23 +++++
 tools/perf/util/symbol.h                           |   2 +
 tools/perf/util/thread.c                           |   7 +-
 tools/perf/util/thread.h                           |  14 ++-
 tools/perf/util/unwind-libunwind.c                 |  48 +++++++--
 tools/perf/util/unwind-libunwind_common.c          | 109 +++++++++++++++++++++
 tools/perf/util/unwind.h                           |  45 +++++++--
 21 files changed, 341 insertions(+), 42 deletions(-)
 create mode 100644 tools/perf/arch/arm64/include/libunwind/libunwind-arch.h
 create mode 100644 tools/perf/arch/x86/include/libunwind/libunwind-arch.h
 create mode 100644 tools/perf/util/unwind-libunwind_common.c

-- 
1.8.5.2

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2016-05-20 17:47 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-19 11:47 [PATCH v4 0/6] Add support for remote unwind He Kuang
2016-05-19 11:47 ` [PATCH v4 1/6] perf tools: Set buildid dir under symfs when --symfs is provided He Kuang
2016-05-19 14:23   ` David Ahern
2016-05-19 16:07   ` Jiri Olsa
2016-05-20 17:46   ` [tip:perf/urgent] " tip-bot for He Kuang
2016-05-19 11:47 ` [PATCH v4 2/6] perf tools: Promote proper messages for cross-platform unwind He Kuang
2016-05-19 14:50   ` Arnaldo Carvalho de Melo
2016-05-19 16:19     ` Jiri Olsa
2016-05-20  3:00       ` Hekuang
2016-05-19 16:46   ` Jiri Olsa
2016-05-19 17:15     ` Jiri Olsa
2016-05-20  2:59     ` Hekuang
2016-05-20  9:53       ` Jiri Olsa
2016-05-19 11:47 ` [PATCH v4 3/6] perf tools: Separate local and remote unwind support detection He Kuang
2016-05-19 11:47 ` [PATCH v4 4/6] perf callchain: Add support for cross-platform unwind He Kuang
2016-05-19 11:47 ` [PATCH v4 5/6] perf callchain: Support x86 target platform He Kuang
2016-05-19 11:47 ` [PATCH v4 6/6] perf callchain: Support aarch64 cross-platform He Kuang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).