[RFC PATCH 2/5] perf/trace: Add perf extra percpu trace buffer

2015-06-30 Thread He Kuang
Introduce another trace buffer besides perf_trace_buffer, so other utilities like bpf can generate and fill perf event data to it extraly and the data can be collected to the original buffer afterwards. The life cycle of this extra buffer is the same as the original one. Signed-off-by: He Kuang

[RFC PATCH 1/5] bpf: Put perf_events check ahead of bpf prog

2015-06-30 Thread He Kuang
k count=3 $ cat /sys/kernel/debug/tracing/trace dd-994 [000] d...46.386754: : generic_perform_write: tgid=994, pid=994 dd-994 [000] d...46.389167: : generic_perform_write: tgid=994, pid=994 dd-994 [000] d...46.389551: : generic_perform_write: tgid=994, pid=994 Signed-o

[RFC PATCH 5/5] tracing/kprobe: Combine extra trace buf into perf trace buf

2015-06-30 Thread He Kuang
processed by perf-script. Signed-off-by: He Kuang --- kernel/trace/trace_kprobe.c | 34 -- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c index 16ad88e..88642ee 100644 --- a/kernel/trace

[RFC PATCH 0/5] Make eBPF programs output data to perf event

2015-06-30 Thread He Kuang
063753: perf_bpf_probe:generic_perform_write: (81140b60) Next step, we'll let the userspace perf tools to parse this extra data generated by eBPF. Thank you. He Kuang (5): bpf: Put perf_events check ahead of bpf prog perf/trace: Add perf extra percpu trace buffer tracing/kpro

[RFC PATCH 3/5] tracing/kprobe: Separate inc recursion count out of perf_trace_buf_prepare

2015-06-30 Thread He Kuang
t a second time. Signed-off-by: He Kuang --- include/linux/ftrace_event.h| 2 ++ kernel/trace/trace_event_perf.c | 27 ++- kernel/trace/trace_kprobe.c | 28 ++-- 3 files changed, 46 insertions(+), 11 deletions(-) diff --git a/inc

[PATCH 2/4] perf probe: Fix failure to probe online module

2015-07-01 Thread He Kuang
probe:skb_is_nonlinear (on skb_is_nonlinear in test_bpf) You can now use it in all perf tools, such as: perf record -e probe:skb_is_nonlinear -aR sleep 1 Signed-off-by: He Kuang --- tools/perf/util/probe-event.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/perf/util/pro

[PATCH 4/4] perf probe: Add failure check when show variable range

2015-07-01 Thread He Kuang
Change improper type size_t to diffptr_t to make consistent with libdw and handle error code. Signed-off-by: He Kuang --- tools/perf/util/dwarf-aux.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/dwarf-aux.c b/tools/perf/util/dwarf-aux.c index

[PATCH 3/4] perf probe: Enable --range option according to libdw version

2015-07-01 Thread He Kuang
The option --range uses functions in libdw (elfutils version >= 1.57), this patch check if elfutils version meets the requirements before enable this feature, so that perf can be built with old libdw. Reported-by: Alexei Starovoitov Signed-off-by: He Kuang --- tools/perf/builtin-probe.c |

[PATCH 1/4] perf record: Use %ld for long type sample counter

2015-07-01 Thread He Kuang
enter_write -- dd if=/dev/zero of=/dev/null bs=4k count=1000 1000+0 records in 1000+0 records out [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.077 MB perf.data (1001 samples) ] Signed-off-by: He Kuang --- tools/perf/builtin-record.c | 2 +- 1 file

[PATCH v2 2/2] perf probe: Add failure check when show variable range

2015-07-01 Thread He Kuang
Change improper type size_t to diffptr_t to make consistent with libdw and handle error code. Signed-off-by: He Kuang --- tools/perf/util/dwarf-aux.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/dwarf-aux.c b/tools/perf/util/dwarf-aux.c

[PATCH v2 1/2] perf probe: Enable --range option according to libdw version

2015-07-01 Thread He Kuang
e, so that perf can be built with old libdw. Reported-by: Alexei Starovoitov Signed-off-by: He Kuang --- tools/perf/builtin-probe.c | 2 ++ tools/perf/util/dwarf-aux.c | 2 ++ tools/perf/util/dwarf-aux.h | 13 - 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/tools

Re: [PATCH 4/4] perf probe: Add failure check when show variable range

2015-07-01 Thread He Kuang
hi, Masami On 2015/7/1 19:00, Masami Hiramatsu wrote: > On 2015/07/01 18:05, He Kuang wrote: >> Change improper type size_t to diffptr_t to make consistent with libdw >> and handle error code. >> >> Signed-off-by: He Kuang >> --- >> tools/perf/util/

Re: [RFC PATCH 0/5] Make eBPF programs output data to perf event

2015-07-01 Thread He Kuang
On 2015/7/2 10:48, Alexei Starovoitov wrote: On 7/1/15 4:58 AM, Peter Zijlstra wrote: But why create a separate trace buffer, it should go into the regular perf buffer. +1 I think +static char __percpu *perf_extra_trace_buf[PERF_NR_CONTEXTS]; is redundant. It adds quite a bit of unnecessar

[RFC PATCH v2 4/4] tracing/kprobe: Combine bpf output and perf event output

2015-07-02 Thread He Kuang
perf-script. Signed-off-by: He Kuang --- kernel/trace/trace_kprobe.c | 36 ++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c index 16ad88e..274735b 100644 --- a/kernel/trace/trace_kprobe.c

[RFC PATCH v2 0/4] Make eBPF programs output data to perf event

2015-07-02 Thread He Kuang
perf_trace_buf at the stage of perf_trace_prepare_buf. v1-v2: - Remove additional perf_trace_buf. Use the end of perf_trace_buf as a temporary region to store bpf data. - Rename bpf_output_sample to bpf_output_data. - New bpf API added to the end of the function list. Thank you. He

[RFC PATCH v2 1/4] bpf: Put perf_events check ahead of bpf prog

2015-07-02 Thread He Kuang
k count=3 $ cat /sys/kernel/debug/tracing/trace dd-994 [000] d...46.386754: : generic_perform_write: tgid=994, pid=994 dd-994 [000] d...46.389167: : generic_perform_write: tgid=994, pid=994 dd-994 [000] d...46.389551: : generic_perform_write: tgid=994, pid=994 Signed-o

[RFC PATCH v2 2/4] tracing/kprobe: Separate inc recursion count out of perf_trace_buf_prepare

2015-07-02 Thread He Kuang
econd time. Signed-off-by: He Kuang --- include/linux/ftrace_event.h| 2 ++ kernel/trace/trace_event_perf.c | 27 ++- kernel/trace/trace_kprobe.c | 28 ++-- 3 files changed, 46 insertions(+), 11 deletions(-) diff --git a/include/linux/ftrace

[RFC PATCH v2 3/4] bpf: Introduce function for outputing data to perf event

2015-07-02 Thread He Kuang
type but does not increase the recursion count. Signed-off-by: He Kuang --- include/linux/ftrace_event.h| 2 ++ include/linux/perf_event.h | 2 ++ include/uapi/linux/bpf.h| 3 +++ kernel/events/core.c| 6 ++ kernel/events/internal.h| 17

Re: [tip:perf/core] tools: Add err.h with ERR_PTR PTR_ERR interface

2015-09-29 Thread He Kuang
On 2015/9/29 15:57, Jiri Olsa wrote: On Tue, Sep 29, 2015 at 03:52:09PM +0800, He Kuang wrote: hi, jirka On 2015/9/29 15:20, Jiri Olsa wrote: On Tue, Sep 29, 2015 at 09:14:10AM +0200, Jiri Olsa wrote: SNIP $ gcc --version gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16) Copyright (C) 2010

[BUG] perf cross-compile error dual to fixdep not host-exe

2015-09-29 Thread He Kuang
Hi, perf cross-compile error dual to fixdep is not a host executable, first bad commit is 7c422f557266("tools build: Build fixdep helper from perf and basic libs") Cross-compiling an aarch64 target on x86_64 host, error like this: $ make ARCH=aarch64 O=xx/aarch64 CROSS_COMPILE=aarch64-linux-

[PATCH] perf report: Don't shadow inlined symbol with different addr range

2019-02-19 Thread He Kuang
hould be within the range of [sym.start, sym.end]. The error message is like: "0x36aea60 [0x8]: failed to process type: 68". The second parameter of symbol__new() is the length of the fake symbol for the inline frame, which is the subtraction of the end and start address of base_sym. Si

[PATCH] perf top: Fix wrong hottest instruction highlighted

2019-01-20 Thread He Kuang
e and makes things right. The problem can be reproduced by pressing 'H' in perf top annotation view. It should highlight the instruction line which has the highest sampling percentage. Signed-off-by: He Kuang --- tools/perf/ui/browsers/annotate.c | 16 ++-- 1 file changed, 1

[PATCH 2/2] perf tools: Introduce regs_query_register_offset() for arm64

2017-01-24 Thread He Kuang
tions are consistent with x86. Signed-off-by: He Kuang --- tools/perf/arch/arm64/Makefile | 1 + tools/perf/arch/arm64/util/dwarf-regs.c | 123 ++-- 2 files changed, 71 insertions(+), 53 deletions(-) diff --git a/tools/perf/arch/arm64/Makefile b/tools/perf

[PATCH 1/2] perf probe: Fix wrong register name for arm64

2017-01-24 Thread He Kuang
.358653: sys_write: (SyS_write+0x0/0xc8) count=86 Signed-off-by: He Kuang --- tools/perf/arch/arm64/include/dwarf-regs-table.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/perf/arch/arm64/include/dwarf-regs-table.h b/tools/perf/arch/arm64/include/dwarf

[PATCH 0/2] Support bpf prologue for arm64

2017-01-24 Thread He Kuang
Two patches here makes bpf prologue available for arm64. He Kuang (2): perf probe: Fix wrong register name for arm64 perf tools: Introduce regs_query_register_offset() for arm64 tools/perf/arch/arm64/Makefile | 1 + tools/perf/arch/arm64/include/dwarf-regs-table.h | 12

[PATCH 2/2 v2] perf tools: Enable bpf prologue for arm64

2017-01-24 Thread He Kuang
tions are consistent with x86. Signed-off-by: He Kuang --- tools/perf/arch/arm64/Makefile | 1 + tools/perf/arch/arm64/util/dwarf-regs.c | 124 ++-- 2 files changed, 72 insertions(+), 53 deletions(-) diff --git a/tools/perf/arch/arm64/Makefile b/tools/perf

[PATCH 4/5] perf tools: Let python use correct gcc for build_ext

2016-06-21 Thread He Kuang
nd anwsered on stackoverflow. Link: http://stackoverflow.com/questions/5986256/python-distutils-gcc-path Signed-off-by: He Kuang --- tools/perf/Makefile.perf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index bde8cba..d0a2cb1 100

[PATCH 5/5] perf tools: Fix NULL pointer deference when vdso not found

2016-06-21 Thread He Kuang
We should check if 'dso' is a null pointer before passing it to the function dso__type(), otherwise a segfault will be raised in dso__data_get_fd(). In function machine__find_vdso(), the return value checking of 'dso' is missed and this patch fixes this issue. Signed-off-by:

[PATCH 1/5] perf unwind: Change macro names of perf register

2016-06-21 Thread He Kuang
Use macro name prefixed with "LIBUNWIND_ARCH" for better understanding that the regs used by callbacks of libunwind are arch specific. The real regs used should be defined in the wrapper file of "unwind-libunwind-local.c" for each supported arch. Signed-off-by: He Kuang

[PATCH 0/5] Fixes on perf unwind

2016-06-21 Thread He Kuang
ld_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 unwi

[PATCH 3/5] perf unwind: Fix wrongly used regs for aarch64 unwind

2016-06-22 Thread He Kuang
By default, "unwind-libunwind-local.c" gets SP/IP register number according to the host platform, for remote unwind, we should use register number for target platform. Fix this by define LIBUNWIND_ARCH_REG_SP/IP in the wrapper file of aarch64 platform. Signed-off-by: He Kuang Acked-by:

[PATCH 2/5] perf unwind: Fix wrongly used regs for x86_32 unwind

2016-06-22 Thread He Kuang
By default, "unwind-libunwind-local.c" gets SP/IP register number according to the host platform, for remote unwind, we should use register number for target platform. Fix this by define LIBUNWIND_ARCH_REG_SP/IP in the wrapper file of x86_32 platform. Signed-off-by: He Kuang Acked-by:

[PATCH] perf unwind: Fix compile error for static cross build

2016-06-15 Thread He Kuang
nd, this patch introduces a new variable EXTLIBS_LIBUNWIND for storing remote libunwind libraries instead. Signed-off-by: He Kuang --- tools/perf/config/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile index 098874b..80018fe 100644

[PATCH] tools include: Fix wrong macro definitions for cpu_to_le* for big endian

2016-06-15 Thread He Kuang
From: Wang Nan The cpu_to_le* macros in kernel.h are defined without considering endianese. This patch includes "byteoder/generic.h" instead to fix the bug, and removes redundant le64_to_cpu definition in intel-bts.c. Signed-off-by: Wang Nan Signed-off-by: He Kuang --- tools/inc

[PATCH 1/2] tools include: Sync byteorder/generic.h

2016-06-15 Thread He Kuang
From: Wang Nan This patch copies "include/linux/byteorder/generic.h" to "tools/include/linux/byteorder/generic.h" to enable other libraries to use macros in it. tools/perf/MANIFEST is also updated for 'make perf-*-src-pkg'. Signed-off-by: Wang Nan Signed-off-by

[PATCH] tools include: Fix wrong macro definitions for cpu_to_le* for big endian

2016-06-15 Thread He Kuang
From: Wang Nan The cpu_to_le* macros in kernel.h are defined without considering endianese. This patch includes "byteoder/generic.h" instead to fix the bug, and removes redundant le64_to_cpu definition in intel-bts.c. Signed-off-by: Wang Nan Signed-off-by: He Kuang --- tools/inc

[PATCH 2/2] tools include: Fix wrong macro definitions for cpu_to_le* for big endian

2016-06-15 Thread He Kuang
From: Wang Nan The cpu_to_le* macros in kernel.h are defined without considering endianese. This patch includes "byteoder/generic.h" instead to fix the bug, and removes redundant le64_to_cpu definition in intel-bts.c. Signed-off-by: Wang Nan Signed-off-by: He Kuang --- tools/inc

[PATCH v2 2/2] tools include: Fix wrong macro definitions for cpu_to_le* for big endian

2016-06-16 Thread He Kuang
From: Wang Nan The cpu_to_le* macros in kernel.h are defined without considering endianese. This patch includes "byteoder/generic.h" instead to fix the bug, and removes redundant definitions of those macros in intel-bts.c and intel-pt-pkt-decoder.c. Signed-off-by: Wang Nan Signed-

[PATCH v2 1/2] tools include: Adopt byte ordering macros from byteorder/generic.h

2016-06-16 Thread He Kuang
From: Wang Nan This patch adopts the macros for byte order conversion from "include/linux/byteorder/generic.h" to "tools/include/linux/byteorder/generic.h" tools/perf/MANIFEST is also updated for 'make perf-*-src-pkg'. Signed-off-by: Wang Nan Signed-off-by: He K

[PATCH v8 02/14] perf tools: Decouple thread->address_space on libunwind

2016-06-02 Thread He Kuang
void *' instead to decouple the dependence on libunwind. Signed-off-by: He Kuang --- tools/perf/util/thread.h | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h index 45fba13..aa3a8ff 100644 --- a/tools/perf/util/thread.

[PATCH v8 04/14] perf tools: Move unwind__prepare_access from thread_new into thread__insert_map

2016-06-02 Thread He Kuang
. Meanwhile, let thread__insert_map() return value and show messages on error. Signed-off-by: He Kuang --- tools/perf/util/machine.c | 14 -- tools/perf/util/thread.c | 13 + tools/perf/util/thread.h | 2 +- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/tools

[PATCH v8 10/14] perf tools: Check the target platform before assigning unwind methods

2016-06-02 Thread He Kuang
assigning unwind methods. In the latter patches in this series, we can use this info to assign the right unwind methods for supported platforms. Signed-off-by: He Kuang --- tools/perf/util/thread.c | 2 +- tools/perf/util/unwind-libunwind.c | 24 +++- tools/perf/util

[PATCH v8 12/14] perf tools: Introduce flag to separate local/remote unwind compilation

2016-06-02 Thread He Kuang
This is a preparation for including unwind-libunwind-local.c in other files for remote libunwind. Signed-off-by: He Kuang --- tools/perf/util/unwind-libunwind-local.c | 4 1 file changed, 4 insertions(+) diff --git a/tools/perf/util/unwind-libunwind-local.c b/tools/perf/util/unwind

[PATCH v8 13/14] perf callchain: Support x86 target platform

2016-06-02 Thread He Kuang
Support x86(32-bit) cross platform callchain unwind. Signed-off-by: He Kuang --- tools/perf/arch/x86/util/unwind-libunwind.c | 6 +++-- tools/perf/config/Makefile | 8 +++ tools/perf/util/Build | 1 + tools/perf/util/libunwind/x86_32.c | 37

[PATCH v8 14/14] perf callchain: Support aarch64 cross-platform

2016-06-02 Thread He Kuang
Support aarch64 cross platform callchain unwind. Signed-off-by: He Kuang --- tools/perf/arch/arm64/util/unwind-libunwind.c | 4 ++- tools/perf/config/Makefile| 12 + tools/perf/util/Build | 1 + tools/perf/util/libunwind/arm64.c

[PATCH v8 09/14] perf tools: Export normalize_arch() function

2016-06-02 Thread He Kuang
Export normalize_arch() function, so other part of perf can get normalized form of arch string. Signed-off-by: He Kuang --- tools/perf/arch/common.c | 2 +- tools/perf/arch/common.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/perf/arch/common.c b/tools/perf/arch

[PATCH v8 11/14] perf tools: Change fixed name of libunwind__arch_reg_id to macro

2016-06-02 Thread He Kuang
. Signed-off-by: He Kuang --- tools/perf/util/unwind-libunwind-local.c | 2 +- tools/perf/util/unwind.h | 5 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/unwind-libunwind-local.c b/tools/perf/util/unwind-libunwind-local.c index 9c70486

[PATCH v8 01/14] perf tools: Use LIBUNWIND_DIR for remote libunwind feature check

2016-06-02 Thread He Kuang
Pass LIBUNWIND_DIR to feature check flags for remote libunwind tests. So perf can be able to detect remote libunwind libraries from arbitrary directory. Signed-off-by: He Kuang --- tools/perf/config/Makefile | 9 + 1 file changed, 9 insertions(+) diff --git a/tools/perf/config/Makefile

[PATCH v8 08/14] perf tools: Extract common API out of unwind-libunwind-local.c

2016-06-02 Thread He Kuang
This patch extracts common unwind-libunwind APIs out of unwind-libunwind-local.c, this part will be used by both local and remote libunwind. Signed-off-by: He Kuang --- tools/perf/util/Build| 1 + tools/perf/util/unwind-libunwind-local.c | 38

[PATCH v8 07/14] perf tools: Rename unwind-libunwind.c to unwind-libunwind-local.c

2016-06-02 Thread He Kuang
Since unwind-libunwind.c contains code for specific arithecture, we change it's name to unwind-libunwind-local.c, and let it only be built if local libunwind is supported. Signed-off-by: He Kuang --- tools/perf/util/Build| 2 +- tools/perf

[PATCH v8 00/14] Add support for remote unwind

2016-06-02 Thread He Kuang
in file 'util/libunwind/arm64.c', 'util/libunwind/x86_32.c', and explain the reason for debug-frame flag in non-arm arch. Thanks. He Kuang (14): perf tools: Use LIBUNWIND_DIR for remote libunwind feature check perf tools: Decouple thread->address_space

[PATCH v8 05/14] perf tools: Don't mix LIBUNWIND_LIBS into LIBUNWIND_LDFLAGS

2016-06-02 Thread He Kuang
LIBUNWIND_LIBS contains libunwind libraries used for local only, don't mix this into LIBUNWIND_LDFLAGS so we can later use LIBUNWIND_LDFLAGS both for local and remote libunwind. Signed-off-by: He Kuang --- tools/perf/config/Makefile | 7 +++ 1 file changed, 3 insertions(+), 4 dele

[PATCH v8 03/14] perf tools: Introducing struct unwind_libunwind_ops for local unwind

2016-06-02 Thread He Kuang
methods of libunwind operations to thread/map related, and each thread can have indivadual libunwind operations. Local libunwind methods are registered as default value. Signed-off-by: He Kuang --- tools/perf/util/thread.h | 4 ++- tools/perf/util/unwind-libunwind.c | 57

[PATCH v8 06/14] perf tools: Separate local/remote libunwind config

2016-06-02 Thread He Kuang
. LIBUNWIND_LIBS is eliminated in LDFLAGS if local libunwind is not supported. Signed-off-by: He Kuang --- tools/perf/arch/arm/util/Build | 2 +- tools/perf/arch/arm64/util/Build | 2 +- tools/perf/arch/x86/util/Build | 2 +- tools/perf/config/Makefile | 20 +--- 4 files changed

[PATCH v9 02/14] perf tools: Decouple thread->address_space on libunwind

2016-06-02 Thread He Kuang
void *' instead to decouple the dependence on libunwind. Signed-off-by: He Kuang --- tools/perf/util/thread.h | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h index 45fba13..aa3a8ff 100644 --- a/tools/perf/util/thread.

[PATCH v9 13/14] perf callchain: Support x86 target platform

2016-06-02 Thread He Kuang
Support x86(32-bit) cross platform callchain unwind. Signed-off-by: He Kuang --- tools/perf/arch/x86/util/unwind-libunwind.c | 6 +++-- tools/perf/config/Makefile | 8 +++ tools/perf/util/Build | 1 + tools/perf/util/libunwind/x86_32.c | 37

[PATCH v9 00/14] Add support for remote unwind

2016-06-02 Thread He Kuang
wind__prepare_access() in patch 10. Thanks. He Kuang (14): perf tools: Use LIBUNWIND_DIR for remote libunwind feature check perf tools: Decouple thread->address_space on libunwind perf tools: Introducing struct unwind_libunwind_ops for local unwind perf tools: Move unwind__prepare_acce

[PATCH v9 05/14] perf tools: Don't mix LIBUNWIND_LIBS into LIBUNWIND_LDFLAGS

2016-06-02 Thread He Kuang
LIBUNWIND_LIBS contains libunwind libraries used for local only, don't mix this into LIBUNWIND_LDFLAGS so we can later use LIBUNWIND_LDFLAGS both for local and remote libunwind. Signed-off-by: He Kuang --- tools/perf/config/Makefile | 7 +++ 1 file changed, 3 insertions(+), 4 dele

[PATCH v9 08/14] perf tools: Extract common API out of unwind-libunwind-local.c

2016-06-02 Thread He Kuang
This patch extracts common unwind-libunwind APIs out of unwind-libunwind-local.c, this part will be used by both local and remote libunwind. Signed-off-by: He Kuang --- tools/perf/util/Build| 1 + tools/perf/util/unwind-libunwind-local.c | 39

[PATCH v9 07/14] perf tools: Rename unwind-libunwind.c to unwind-libunwind-local.c

2016-06-02 Thread He Kuang
Since unwind-libunwind.c contains code for specific arithecture, we change it's name to unwind-libunwind-local.c, and let it only be built if local libunwind is supported. Signed-off-by: He Kuang --- tools/perf/util/Build| 2 +- tools/perf

[PATCH v9 01/14] perf tools: Use LIBUNWIND_DIR for remote libunwind feature check

2016-06-02 Thread He Kuang
Pass LIBUNWIND_DIR to feature check flags for remote libunwind tests. So perf can be able to detect remote libunwind libraries from arbitrary directory. Signed-off-by: He Kuang --- tools/perf/config/Makefile | 9 + 1 file changed, 9 insertions(+) diff --git a/tools/perf/config/Makefile

[PATCH v9 11/14] perf tools: Change fixed name of libunwind__arch_reg_id to macro

2016-06-02 Thread He Kuang
. Signed-off-by: He Kuang --- tools/perf/util/unwind-libunwind-local.c | 2 +- tools/perf/util/unwind.h | 5 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/unwind-libunwind-local.c b/tools/perf/util/unwind-libunwind-local.c index 9c70486

[PATCH v9 12/14] perf tools: Introduce flag to separate local/remote unwind compilation

2016-06-02 Thread He Kuang
This is a preparation for including unwind-libunwind-local.c in other files for remote libunwind. Signed-off-by: He Kuang --- tools/perf/util/unwind-libunwind-local.c | 4 1 file changed, 4 insertions(+) diff --git a/tools/perf/util/unwind-libunwind-local.c b/tools/perf/util/unwind

[PATCH v9 14/14] perf callchain: Support aarch64 cross-platform

2016-06-02 Thread He Kuang
Support aarch64 cross platform callchain unwind. Signed-off-by: He Kuang --- tools/perf/arch/arm64/util/unwind-libunwind.c | 4 ++- tools/perf/config/Makefile| 12 + tools/perf/util/Build | 1 + tools/perf/util/libunwind/arm64.c

[PATCH v9 03/14] perf tools: Introducing struct unwind_libunwind_ops for local unwind

2016-06-02 Thread He Kuang
methods of libunwind operations to thread/map related, and each thread can have indivadual libunwind operations. Local libunwind methods are registered as default value. Signed-off-by: He Kuang --- tools/perf/util/thread.h | 4 ++- tools/perf/util/unwind-libunwind.c | 58

[PATCH v9 04/14] perf tools: Move unwind__prepare_access from thread_new into thread__insert_map

2016-06-02 Thread He Kuang
. Meanwhile, let thread__insert_map() return value and show messages on error. Signed-off-by: He Kuang --- tools/perf/util/machine.c | 14 -- tools/perf/util/thread.c | 13 + tools/perf/util/thread.h | 2 +- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/tools

[PATCH v9 10/14] perf tools: Check the target platform before assigning unwind methods

2016-06-02 Thread He Kuang
assigning unwind methods. In the latter patches in this series, we can use this info to assign the right unwind methods for supported platforms. Signed-off-by: He Kuang --- tools/perf/util/thread.c | 2 +- tools/perf/util/unwind-libunwind.c | 24 +++- tools/perf/util

[PATCH v9 09/14] perf tools: Export normalize_arch() function

2016-06-02 Thread He Kuang
Export normalize_arch() function, so other part of perf can get normalized form of arch string. Signed-off-by: He Kuang --- tools/perf/arch/common.c | 2 +- tools/perf/arch/common.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/perf/arch/common.c b/tools/perf/arch

[PATCH v9 06/14] perf tools: Separate local/remote libunwind config

2016-06-02 Thread He Kuang
. LIBUNWIND_LIBS is eliminated in LDFLAGS if local libunwind is not supported. Signed-off-by: He Kuang --- tools/perf/arch/arm/util/Build | 2 +- tools/perf/arch/arm64/util/Build | 2 +- tools/perf/arch/x86/util/Build | 2 +- tools/perf/config/Makefile | 20 +--- 4 files changed

[PATCH v6 06/11 1 update 1/2] perf tools: Rename unwind-libunwind.c to unwind-libunwind-local.c

2016-05-29 Thread He Kuang
Since unwind-libunwind.c contains code for specific arithecture, we change it's name to unwind-libunwind-local.c, and let it only be built if local libunwind is supported. Signed-off-by: He Kuang --- tools/perf/util/Build| 2 +- tools/perf

[PATCH v6 06/11 1 update 2/2] perf tools: Extract common API out of unwind-libunwind-local.c

2016-05-29 Thread He Kuang
This patch extracts common unwind-libunwind APIs out of unwind-libunwind-local.c, this part will be used by both local and remote libunwind. Signed-off-by: He Kuang --- tools/perf/util/Build| 1 + tools/perf/util/unwind-libunwind-local.c | 32

[PATCH v7 13/14] perf callchain: Support x86 target platform

2016-05-31 Thread He Kuang
Support x86(32-bit) cross platform callchain unwind. Signed-off-by: He Kuang --- tools/perf/arch/x86/util/unwind-libunwind.c | 6 -- tools/perf/config/Makefile | 8 tools/perf/util/Build | 1 + tools/perf/util/libunwind/x86_32.c

[PATCH v7 12/14] perf tools: Introduce flag to separate local/remote unwind compilation

2016-05-31 Thread He Kuang
This is a preparation for including unwind-libunwind-local.c in other files for remote libunwind. Signed-off-by: He Kuang --- tools/perf/util/unwind-libunwind-local.c | 4 1 file changed, 4 insertions(+) diff --git a/tools/perf/util/unwind-libunwind-local.c b/tools/perf/util/unwind

[PATCH v7 14/14] perf callchain: Support aarch64 cross-platform

2016-05-31 Thread He Kuang
Support aarch64 cross platform callchain unwind. Signed-off-by: He Kuang --- tools/perf/arch/arm64/util/unwind-libunwind.c | 4 +++- tools/perf/config/Makefile| 12 tools/perf/util/Build | 1 + tools/perf/util/libunwind/arm64.c

[PATCH v7 02/14] perf tools: Decouple thread->address_space on libunwind

2016-05-31 Thread He Kuang
void *' instead to decouple the dependence on libunwind. Signed-off-by: He Kuang --- tools/perf/util/thread.h | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h index 45fba13..aa3a8ff 100644 --- a/tools/perf/util/thread.

[PATCH v7 05/14] perf tools: Don't mix LIBUNWIND_LIBS into LIBUNWIND_LDFLAGS

2016-05-31 Thread He Kuang
LIBUNWIND_LIBS contains libunwind libraries used for local only, don't mix this into LIBUNWIND_LDFLAGS so we can later use LIBUNWIND_LDFLAGS both for local and remote libunwind. Signed-off-by: He Kuang --- tools/perf/config/Makefile | 7 +++ 1 file changed, 3 insertions(+), 4 dele

[PATCH v7 00/14] Add support for remote unwind

2016-05-31 Thread He Kuang
orted warnings to "Support x86 target platform" - Export $(ARCH)_unwind_libunwind_ops variables instead of functions. - Move arch/$(ARCH)/util/unwind-libunwind-$(ARCH).c into util/libunwind/ folder. Thanks. He Kuang (14): perf tools: Use LIBUNWIND_DIR for remote libunw

[PATCH v7 06/14] perf tools: Separate local/remote libunwind config

2016-05-31 Thread He Kuang
. LIBUNWIND_LIBS is eliminated in LDFLAGS if local libunwind is not supported. Signed-off-by: He Kuang --- tools/perf/arch/arm/util/Build | 2 +- tools/perf/arch/arm64/util/Build | 2 +- tools/perf/arch/x86/util/Build | 2 +- tools/perf/config/Makefile | 21 ++--- 4 files changed

[PATCH v7 04/14] perf tools: Move unwind__prepare_access from thread_new into thread__insert_map

2016-05-31 Thread He Kuang
. Meanwhile, let thread__insert_map() return value and show messages on error. Signed-off-by: He Kuang --- tools/perf/util/machine.c | 10 -- tools/perf/util/thread.c | 13 +++-- tools/perf/util/thread.h | 2 +- tools/perf/util/unwind-libunwind.c | 7

[PATCH v7 01/14] perf tools: Use LIBUNWIND_DIR for remote libunwind feature check

2016-05-31 Thread He Kuang
Pass LIBUNWIND_DIR to feature check flags for remote libunwind tests. So perf can be able to detect remote libunwind libraries from arbitrary directory. Signed-off-by: He Kuang --- tools/perf/config/Makefile | 9 + 1 file changed, 9 insertions(+) diff --git a/tools/perf/config/Makefile

[PATCH v7 03/14] perf tools: Introducing struct unwind_libunwind_ops for local unwind

2016-05-31 Thread He Kuang
methods of libunwind operations to thread/map related, and each thread can have indivadual libunwind operations. Local libunwind methods are registered as default value. Signed-off-by: He Kuang --- tools/perf/util/thread.c | 6 tools/perf/util/thread.h | 4 ++- tools/perf

[PATCH v7 10/14] perf tools: Check the target platform before assigning unwind methods

2016-05-31 Thread He Kuang
assigning unwind methods. In the latter patches in this series, we can use this info to assign the right unwind methods for supported platforms. Signed-off-by: He Kuang --- tools/perf/util/thread.c | 2 +- tools/perf/util/unwind-libunwind.c | 30 +++--- tools/perf

[PATCH v7 07/14] perf tools: Rename unwind-libunwind.c to unwind-libunwind-local.c

2016-05-31 Thread He Kuang
Since unwind-libunwind.c contains code for specific arithecture, we change it's name to unwind-libunwind-local.c, and let it only be built if local libunwind is supported. Signed-off-by: He Kuang --- tools/perf/util/Build| 2 +- tools/perf

[PATCH v7 08/14] perf tools: Extract common API out of unwind-libunwind-local.c

2016-05-31 Thread He Kuang
This patch extracts common unwind-libunwind APIs out of unwind-libunwind-local.c, this part will be used by both local and remote libunwind. Signed-off-by: He Kuang --- tools/perf/util/Build| 1 + tools/perf/util/unwind-libunwind-local.c | 38

[PATCH v7 09/14] perf tools: Export normalize_arch() function

2016-05-31 Thread He Kuang
Export normalize_arch() function, so other part of perf can get normalized form of arch string. Signed-off-by: He Kuang --- tools/perf/arch/common.c | 2 +- tools/perf/arch/common.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/perf/arch/common.c b/tools/perf/arch

[PATCH v7 11/14] perf tools: Change fixed name of libunwind__arch_reg_id to macro

2016-05-31 Thread He Kuang
. Signed-off-by: He Kuang --- tools/perf/util/unwind-libunwind-local.c | 2 +- tools/perf/util/unwind.h | 5 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/unwind-libunwind-local.c b/tools/perf/util/unwind-libunwind-local.c index 9c70486

[PATCH v4 1/2] perf tools arm64: Add support for generating bpf prologue

2017-02-06 Thread He Kuang
Since HAVE_KPROBES can be enabled in arm64, this patch introduces regs_query_register_offset() to convert register name to offset for arm64, so the BPF prologue feature is ready to use. Signed-off-by: He Kuang --- tools/perf/arch/arm64/Makefile | 1 + tools/perf/arch/arm64/util/dwarf

[PATCH v4 2/2] perf tools: Add missing newline in debug messages

2017-02-06 Thread He Kuang
These two debug messages are missing the trailing newline. Signed-off-by: He Kuang --- tools/perf/util/bpf-loader.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c index 36c8611..bc6bc70 100644 --- a/tools/perf

[PATCH v2 2/3] perf tools: Enable bpf prologue for arm64

2017-02-03 Thread He Kuang
Since HAVE_KPROBES can be enabled in arm64, this patch introduces regs_query_register_offset() to convert register name to offset for arm64, so the BPF prologue feature is ready to use. Acked-by: Masami Hiramatsu Signed-off-by: He Kuang --- tools/perf/arch/arm64/Makefile | 1 + tools

[PATCH v2 3/3] perf tools: Add missing newline in debug messages

2017-02-03 Thread He Kuang
These two debug messages are missing the trailing newline. Signed-off-by: He Kuang --- tools/perf/util/bpf-loader.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c index 36c8611..bc6bc70 100644 --- a/tools/perf

[PATCH v2 1/3] perf tools: Use offset instead of dwarfnum in register table.

2017-02-03 Thread He Kuang
consistent with x86. Acked-by: Masami Hiramatsu Signed-off-by: He Kuang --- tools/perf/arch/arm64/util/dwarf-regs.c | 107 1 file changed, 52 insertions(+), 55 deletions(-) diff --git a/tools/perf/arch/arm64/util/dwarf-regs.c b/tools/perf/arch/arm64/util/dwarf-regs.c

[PATCH v3] perf tools arm64: Add support for generating bpf prologue

2017-02-04 Thread He Kuang
Since HAVE_KPROBES can be enabled in arm64, this patch introduces regs_query_register_offset() to convert register name to offset for arm64, so the BPF prologue feature is ready to use. Signed-off-by: He Kuang --- tools/perf/arch/arm64/Makefile | 1 + tools/perf/arch/arm64/util/dwarf

[PATCH 1/2] perf script: Show proper message when failed list scripts

2016-08-04 Thread He Kuang
Perf shows the usage message when perf scripts folder failed to open, which misleads users to let them think the command is mistyped. This patch shows proper message and guide the users to check PERF_EXEC_PATH environment in that case. Before: $ perf script --list Usage: perf script [] or:

[PATCH 2/2] perf script: Don't disable use_callchain if input is pipe

2016-08-04 Thread He Kuang
igned-off-by: He Kuang --- tools/perf/builtin-script.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index d47aef9..ec8df8f 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -371,14 +3

[PATCH 2/3] perf unwind: Fix wrongly used regs for x86_32 unwind

2016-06-08 Thread He Kuang
By default, "unwind-libunwind-local.c" gets SP/IP register number according to the host platform, for remote unwind, we should use register number for target platform. Fix this by define LIBUNWIND_ARCH_REG_SP/IP in the wrapper file of x86_32 platform. Signed-off-by: He Kuang --- tools

[PATCH 0/3] Fixes on remote unwind

2016-06-08 Thread He Kuang
atform analysis" is not on "origin/perf/unwind" branch, this patch was applied, please check if it was missed, the above test needs this patch. Thank you. He Kuang (3): perf unwind: Change macro names of perf register perf unwind: Fix wrongly used regs for x86_32 unwind perf

[PATCH 3/3] perf unwind: Fix wrongly used regs for aarch64 unwind

2016-06-08 Thread He Kuang
By default, "unwind-libunwind-local.c" gets SP/IP register number according to the host platform, for remote unwind, we should use register number for target platform. Fix this by define LIBUNWIND_ARCH_REG_SP/IP in the wrapper file of aarch64 platform. Signed-off-by: He Kuang ---

[PATCH 1/3] perf unwind: Change macro names of perf register

2016-06-08 Thread He Kuang
Use macro name prefixed with "LIBUNWIND_ARCH" for better understanding that the regs used by callbacks of libunwind are arch specific. The real regs used should be defined in the wrapper file of "unwind-libunwind-local.c" for each supported arch. Signed-off-by: He Kuang

[PATCH v9 10/14 UPDATE] perf tools: Check the target platform before assigning unwind methods

2016-06-03 Thread He Kuang
assigning unwind methods. In the latter patches in this series, we can use this info to assign the right unwind methods for supported platforms. Signed-off-by: He Kuang Acked-by: Jiri Olsa --- tools/perf/util/thread.c | 2 +- tools/perf/util/unwind-libunwind.c | 25

[PATCH] perf tools: Fix compiler error due to header file changes

2016-06-26 Thread He Kuang
: In function ‘bt_convert__perf2ctf’: util/data-convert-bt.c:1302:2: error: implicit declaration of function ‘perf_config’ [-Werror=implicit-function-declaration] perf_config(convert__config, &c); ^ Include the right header file to fix this. Signed-off-by: He Kuang --- tools/perf/util/data-conv

<    1   2   3   4   5   >