linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/7] Add support for remote unwind
@ 2016-05-12  8:43 He Kuang
  2016-05-12  8:43 ` [PATCH v3 1/7] perf tools: Set vdso name to vdso[64,32] depending on platform He Kuang
                   ` (6 more replies)
  0 siblings, 7 replies; 55+ messages in thread
From: He Kuang @ 2016-05-12  8:43 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

v2 url:
  http://thread.gmane.org/gmane.linux.kernel/2218373

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 adds build tests for the supported platforms for remote
unwinding, and 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)

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 (7):
  perf tools: Set vdso name to vdso[64,32] depending on platform
  perf tools: Store vdso buildid unconditionally
  perf tools: Remove the logical that skip buildid cache if symfs is
    given
  perf tools: Promote proper messages for cross-platform unwind
  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 +-
 .../arch/x86/include/libunwind/libunwind-arch.h    |  18 ++++
 tools/perf/arch/x86/util/unwind-libunwind.c        |  42 ++++++++
 tools/perf/config/Makefile                         |  35 ++++++-
 tools/perf/util/Build                              |  13 ++-
 tools/perf/util/build-id.c                         |   2 +-
 tools/perf/util/dso.c                              |   6 +-
 tools/perf/util/thread.c                           |   7 +-
 tools/perf/util/thread.h                           |  14 ++-
 tools/perf/util/unwind-libunwind.c                 |  49 +++++++--
 tools/perf/util/unwind-libunwind_common.c          | 114 +++++++++++++++++++++
 tools/perf/util/unwind.h                           |  48 +++++++--
 tools/perf/util/vdso.h                             |   7 +-
 14 files changed, 348 insertions(+), 30 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] 55+ messages in thread
* [PATCH 0/5] Fixes on perf unwind
@ 2016-06-22  6:57 He Kuang
  2016-06-22  6:57 ` [PATCH 1/5] perf unwind: Change macro names of perf register He Kuang
                   ` (5 more replies)
  0 siblings, 6 replies; 55+ messages in thread
From: He Kuang @ 2016-06-22  6:57 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

hi,

Patch 1-3 fix wrongly used PERF_REG_SP/IP by redefining
those macros in the wrapper file according to the target platform, for
example in "util/libunwind/x86_32.c".
The first 3 patches have been acked-by "Jiri Olsa" and not touched.

Patch 4 catches an error on python build_ext build.

Patch 5 fixes a NULL pointer deference which can cause segfault when
the desired dso is not found.

Thank you.

He Kuang (5):
  perf unwind: Change macro names of perf register
  perf unwind: Fix wrongly used regs for x86_32 unwind
  perf unwind: Fix wrongly used regs for aarch64 unwind
  perf tools: Let python use correct gcc for build_ext
  perf tools: Fix NULL pointer deference when vdso not found

 tools/perf/Makefile.perf                 | 3 ++-
 tools/perf/util/libunwind/arm64.c        | 5 +++++
 tools/perf/util/libunwind/x86_32.c       | 6 ++++++
 tools/perf/util/unwind-libunwind-local.c | 6 ++++--
 tools/perf/util/unwind.h                 | 9 +++++++++
 tools/perf/util/vdso.c                   | 2 +-
 6 files changed, 27 insertions(+), 4 deletions(-)

-- 
1.8.5.2

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

end of thread, other threads:[~2016-06-26 10:57 UTC | newest]

Thread overview: 55+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-12  8:43 [PATCH v3 0/7] Add support for remote unwind He Kuang
2016-05-12  8:43 ` [PATCH v3 1/7] perf tools: Set vdso name to vdso[64,32] depending on platform He Kuang
2016-05-12 10:06   ` Adrian Hunter
2016-05-13  8:51     ` [PATCH v3 1/7 UPDATE] perf tools: Find vdso with the consider of cross-platform He Kuang
2016-05-16 13:32       ` Arnaldo Carvalho de Melo
2016-05-17  7:34         ` Adrian Hunter
2016-05-17  7:33       ` Adrian Hunter
2016-05-17  9:04         ` [PATCH v3 1/7 UPDATE2] " He Kuang
2016-05-17  9:17           ` Adrian Hunter
2016-05-17 12:46             ` Arnaldo Carvalho de Melo
2016-06-15 13:34           ` Arnaldo Carvalho de Melo
2016-06-16  0:22             ` Hekuang
2016-06-16 13:00             ` Adrian Hunter
2016-06-16 16:33               ` Arnaldo Carvalho de Melo
2016-05-17  9:05         ` [PATCH v3 1/7 UPDATE] " Hekuang
2016-05-13  8:53     ` [PATCH v3 1/7] perf tools: Set vdso name to vdso[64,32] depending on platform Hekuang
2016-05-12  8:43 ` [PATCH v3 2/7] perf tools: Store vdso buildid unconditionally He Kuang
2016-05-12 13:09   ` Arnaldo Carvalho de Melo
2016-05-20  6:43   ` [tip:perf/urgent] perf symbols: " tip-bot for He Kuang
2016-05-12  8:43 ` [PATCH v3 3/7] perf tools: Remove the logical that skip buildid cache if symfs is given He Kuang
2016-05-12 13:09   ` Arnaldo Carvalho de Melo
2016-05-12 20:23     ` David Ahern
2016-05-12 20:33       ` Arnaldo Carvalho de Melo
2016-05-13  7:19       ` Hekuang
2016-05-13 14:27         ` David Ahern
2016-05-13 18:01           ` Arnaldo Carvalho de Melo
2016-05-14  8:19             ` [PATCH v3 3/7 UPDATE] perf tools: Add option for the path of buildid dsos under symfs He Kuang
2016-05-14 14:43               ` David Ahern
2016-05-16  1:30                 ` Hekuang
2016-05-16  2:50                   ` David Ahern
2016-05-16  6:40                     ` Hekuang
2016-05-18  1:47                     ` Hekuang
2016-05-18  1:51                       ` David Ahern
2016-05-18  2:48                         ` Hekuang
2016-05-18  3:04                           ` David Ahern
2016-05-12  8:43 ` [PATCH v3 4/7] perf tools: Promote proper messages for cross-platform unwind He Kuang
2016-05-12  8:43 ` [PATCH v3 5/7] perf callchain: Add support " He Kuang
2016-05-12  8:43 ` [PATCH v3 6/7] perf callchain: Support x86 target platform He Kuang
2016-05-12  8:43 ` [PATCH v3 7/7] perf callchain: Support aarch64 cross-platform He Kuang
2016-06-22  6:57 [PATCH 0/5] Fixes on perf unwind He Kuang
2016-06-22  6:57 ` [PATCH 1/5] perf unwind: Change macro names of perf register He Kuang
2016-06-26 10:56   ` [tip:perf/core] " tip-bot for He Kuang
2016-06-22  6:57 ` [PATCH 2/5] perf unwind: Fix wrongly used regs for x86_32 unwind He Kuang
2016-06-26 10:56   ` [tip:perf/core] " tip-bot for He Kuang
2016-06-22  6:57 ` [PATCH 3/5] perf unwind: Fix wrongly used regs for aarch64 unwind He Kuang
2016-06-26 10:57   ` [tip:perf/core] " tip-bot for He Kuang
2016-06-22  6:57 ` [PATCH 4/5] perf tools: Let python use correct gcc for build_ext He Kuang
2016-06-26 10:54   ` [tip:perf/core] " tip-bot for He Kuang
2016-06-22  6:57 ` [PATCH 5/5] perf tools: Fix NULL pointer deference when vdso not found He Kuang
2016-06-23  2:02   ` Wangnan (F)
2016-06-23  3:03     ` Hekuang
2016-06-23 12:07     ` Arnaldo Carvalho de Melo
2016-06-23 13:28       ` Arnaldo Carvalho de Melo
2016-06-26 10:55   ` [tip:perf/core] perf tools: Find right DSO taking into account if binary is 32 or 64-bit tip-bot for He Kuang
2016-06-23 13:30 ` [PATCH 0/5] Fixes on perf unwind Arnaldo Carvalho de Melo

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).