Re: perf tools: remove option --tail-synthesize ?

2018-11-21 Thread Wangnan (F)
On 2018/11/21 21:11, Arnaldo Carvalho de Melo wrote: > Em Wed, Nov 21, 2018 at 07:45:28AM +, Song Liu escreveu: >> Hi, >> >> I found perf-record --tail-synthesize without --overwrite breaks symbols >> for perf-script, perf-report, etc. For example: >> >> [root@]# ~/perf record -ag --tail-syn

Re: [tools/perf] perf test LLVM failure on 4.9

2018-01-23 Thread Wangnan (F)
On 2018/1/23 20:37, Pintu Kumar wrote: Hi All, I am verifying all perf tests on Ubuntu-16 x86-64 platform using the kernel version 4.9.20. I have installed several others packages including: clang, llvm But, when I run 'perf test' I get some FAILURE. Specially, 'perf test LLVM' is failing. P

Re: perf test BPF failing on 4.15.0-rc6

2018-01-03 Thread Wangnan (F)
On 2018/1/4 4:13, Arnaldo Carvalho de Melo wrote: Em Wed, Jan 03, 2018 at 03:33:07PM -0300, Arnaldo Carvalho de Melo escreveu: Em Wed, Jan 03, 2018 at 03:27:01PM -0300, Arnaldo Carvalho de Melo escreveu: Continuing investigation... After applying the fallback patch to allow new tools to work

Re: perf test BPF failing on 4.15.0-rc6

2018-01-02 Thread Wangnan (F)
ord: Captured and wrote 0.016 MB perf.data (100 samples) ] I guess in your configuration you would get 3 tracepoints, and can get 0 sample from them. Thank you. On 2018/1/3 12:42, Wangnan (F) wrote: Unable to reproduce. In my kernel configuration, SyS_epoll_wait is not inlined at all. From the

Re: perf test BPF failing on 4.15.0-rc6

2018-01-02 Thread Wangnan (F)
Unable to reproduce. In my kernel configuration, SyS_epoll_wait is not inlined at all. From the log you sent, it seems that all 3 instances are attached. This testcase should work if the last one (SyS_epoll_wait) get probed correctly. Could you please have a look if the 3rd kprobe event (p:p

Re: Php-fpm will crash when perf runs with call graph option

2017-12-24 Thread Wangnan (F)
Have you tried updating your kernel to a recent version? On 2017/12/25 14:58, ufo19890607 wrote: From: yuzhoujian I use perf to analyze the performance overhead for the server. There are several dockers in the server. The php-fpm in the docker will crash as long as the perf collects samples f

Re: [PATCH V2 2/8] perf tools: rewrite perf mmap read for overwrite

2017-12-18 Thread Wangnan (F)
On 2017/12/19 3:07, Liang, Kan wrote: -union perf_event *perf_mmap__read_backward(struct perf_mmap *map) +union perf_event *perf_mmap__read_backward(struct perf_mmap *map, + u64 *start, u64 end) { - u64 head, end; - u64 start = map->prev;

Re: [PATCH V2 6/8] perf top: add overwrite fall back

2017-12-18 Thread Wangnan (F)
On 2017/12/7 7:33, kan.li...@intel.com wrote: From: Kan Liang Switch to non-overwrite mode if kernel doesnot support overwrite ringbuffer. It's only effect when overwrite mode is supported. No change to current behavior. Signed-off-by: Kan Liang --- tools/perf/builtin-top.c | 35

Re: [PATCH V2 2/8] perf tools: rewrite perf mmap read for overwrite

2017-12-18 Thread Wangnan (F)
On 2017/12/7 7:32, kan.li...@intel.com wrote: From: Kan Liang perf_mmap__read_catchup and perf_mmap__read_backward are used to read events one by one from ring buffer under overwrite mode. It always read the stale buffer which is already processed. Because the previous location of processed r

Re: [PATCH V2 1/8] perf tools: remove stale perf evlist mmap read for backward

2017-12-17 Thread Wangnan (F)
On 2017/12/7 7:32, kan.li...@intel.com wrote: From: Kan Liang perf_evlist__mmap_read_catchup and perf_evlist__mmap_read_backward are only for overwrite mode. But they read the evlist->mmap buffer which is for non-overwrite mode. It did not bring any serious problem yet, because there is no o

Re: [PATCH 4/5] perf top: switch to overwrite mode

2017-12-05 Thread Wangnan (F)
On 2017/12/6 6:39, kan.li...@intel.com wrote: From: Kan Liang perf_top__mmap_read has severe performance issue in Knights Landing/Mill, when monitoring in heavy load system. It costs several minutes to finish, which is unacceptable. Currently, perf top is non overwrite mode. For non overwrit

Re: [RFC PATCH] mm, oom_reaper: gather each vma to prevent leaking TLB entry

2017-11-06 Thread Wangnan (F)
On 2017/11/6 19:57, Michal Hocko wrote: On Mon 06-11-17 19:03:34, Wangnan (F) wrote: On 2017/11/6 18:40, Michal Hocko wrote: On Mon 06-11-17 17:59:54, Wangnan (F) wrote: On 2017/11/6 16:52, Michal Hocko wrote: On Mon 06-11-17 15:04:40, Bob Liu wrote: On Mon, Nov 6, 2017 at 11:36 AM, Wang

Re: [RFC PATCH] mm, oom_reaper: gather each vma to prevent leaking TLB entry

2017-11-06 Thread Wangnan (F)
On 2017/11/6 18:40, Michal Hocko wrote: On Mon 06-11-17 17:59:54, Wangnan (F) wrote: On 2017/11/6 16:52, Michal Hocko wrote: On Mon 06-11-17 15:04:40, Bob Liu wrote: On Mon, Nov 6, 2017 at 11:36 AM, Wang Nan wrote: tlb_gather_mmu(&tlb, mm, 0, -1) means gathering all virtual memory s

Re: [RFC PATCH] mm, oom_reaper: gather each vma to prevent leaking TLB entry

2017-11-06 Thread Wangnan (F)
On 2017/11/6 16:52, Michal Hocko wrote: On Mon 06-11-17 15:04:40, Bob Liu wrote: On Mon, Nov 6, 2017 at 11:36 AM, Wang Nan wrote: tlb_gather_mmu(&tlb, mm, 0, -1) means gathering all virtual memory space. In this case, tlb->fullmm is true. Some archs like arm64 doesn't flush TLB when tlb->ful

Re: [PATCH 1/2] perf mmap: Fix perf backward recording

2017-11-01 Thread Wangnan (F)
On 2017/11/1 21:57, Liang, Kan wrote: On 2017/11/1 20:00, Namhyung Kim wrote: On Wed, Nov 01, 2017 at 06:32:50PM +0800, Wangnan (F) wrote: On 2017/11/1 17:49, Namhyung Kim wrote: Hi, On Wed, Nov 01, 2017 at 05:53:26AM +, Wang Nan wrote: perf record backward recording doesn't wo

Re: [PATCH 2/2] perf record: Replace 'overwrite' by 'flightrecorder' for better naming

2017-11-01 Thread Wangnan (F)
On 2017/11/1 23:04, Liang, Kan wrote: On 2017/11/1 22:22, Liang, Kan wrote: On 2017/11/1 21:26, Liang, Kan wrote: The meaning of perf record's "overwrite" option and many "overwrite" in source code are not clear. In perf's code, the 'overwrite' has 2 meanings: 1. Make ringbuffer readonl

Re: [PATCH 2/2] perf record: Replace 'overwrite' by 'flightrecorder' for better naming

2017-11-01 Thread Wangnan (F)
On 2017/11/1 22:22, Liang, Kan wrote: On 2017/11/1 21:26, Liang, Kan wrote: The meaning of perf record's "overwrite" option and many "overwrite" in source code are not clear. In perf's code, the 'overwrite' has 2 meanings: 1. Make ringbuffer readonly (perf_evlist__mmap_ex's argument). 2.

Re: [PATCH 2/2] perf record: Replace 'overwrite' by 'flightrecorder' for better naming

2017-11-01 Thread Wangnan (F)
On 2017/11/1 21:26, Liang, Kan wrote: The meaning of perf record's "overwrite" option and many "overwrite" in source code are not clear. In perf's code, the 'overwrite' has 2 meanings: 1. Make ringbuffer readonly (perf_evlist__mmap_ex's argument). 2. Set evsel's "backward" attribute (in app

Re: [PATCH 1/2] perf mmap: Fix perf backward recording

2017-11-01 Thread Wangnan (F)
On 2017/11/1 20:39, Jiri Olsa wrote: On Wed, Nov 01, 2017 at 08:10:49PM +0800, Wangnan (F) wrote: SNIP diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index c6c891e154a6..27ebe355e794 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -838,6 +838,11

Re: [PATCH 1/2] perf mmap: Fix perf backward recording

2017-11-01 Thread Wangnan (F)
On 2017/11/1 20:00, Namhyung Kim wrote: On Wed, Nov 01, 2017 at 06:32:50PM +0800, Wangnan (F) wrote: On 2017/11/1 17:49, Namhyung Kim wrote: Hi, On Wed, Nov 01, 2017 at 05:53:26AM +, Wang Nan wrote: perf record backward recording doesn't work as we expected: it never overwrite

Re: [PATCH 1/2] perf mmap: Fix perf backward recording

2017-11-01 Thread Wangnan (F)
On 2017/11/1 17:49, Namhyung Kim wrote: Hi, On Wed, Nov 01, 2017 at 05:53:26AM +, Wang Nan wrote: perf record backward recording doesn't work as we expected: it never overwrite when ring buffer full. Test: (Run a busy printing python task background like this: while True: print

Re: [PATCH 2/2] perf record: Replace 'overwrite' by 'flightrecorder' for better naming

2017-11-01 Thread Wangnan (F)
On 2017/11/1 18:03, Namhyung Kim wrote: On Wed, Nov 01, 2017 at 05:53:27AM +, Wang Nan wrote: The meaning of perf record's "overwrite" option and many "overwrite" in source code are not clear. In perf's code, the 'overwrite' has 2 meanings: 1. Make ringbuffer readonly (perf_evlist__mmap_

Re: [PATCH 2/2] perf, tools: Don't force MetricExprs to lower case

2017-10-12 Thread Wangnan (F)
On 2017/10/12 23:59, Jiri Olsa wrote: On Thu, Oct 12, 2017 at 11:31:51PM +0800, Wangnan (F) wrote: SNIP Ok. If it works it's fine for me. well it works, but it means that bpf file cannot contains any directory part.. which im not sure is ok with bpf folks ;-) anyone? Sorry I didn&

Re: [PATCH 2/2] perf, tools: Don't force MetricExprs to lower case

2017-10-12 Thread Wangnan (F)
On 2017/10/9 22:39, Jiri Olsa wrote: On Mon, Oct 09, 2017 at 11:12:58AM -0300, Arnaldo Carvalho de Melo wrote: Em Mon, Oct 09, 2017 at 07:07:29AM -0700, Andi Kleen escreveu: On Mon, Oct 09, 2017 at 03:41:51PM +0200, Jiri Olsa wrote: On Wed, Oct 04, 2017 at 09:27:11AM -0700, Andi Kleen wrote:

Re: [PATCH] perf tool: Don't discard prev in backward mode

2017-10-12 Thread Wangnan (F)
Hi Kan, Please see if this patch works for you. On 2017/10/14 7:16, Wang Nan wrote: Perf record can switch output. The new output should only store the data after switching. However, in overwrite backward mode, the new output still have the data from old output. That also brings extra overhead.

Re: [PATCH] perf tools: fix: Force backward ring buffer mapped readonly

2017-10-12 Thread Wangnan (F)
On 2017/10/12 22:46, Wangnan (F) wrote: On 2017/10/12 22:45, Liang, Kan wrote: On 2017/10/12 20:56, Liang, Kan wrote: On 2017/10/11 21:16, Liang, Kan wrote: perf record's --overwrite option doesn't work as we expect. For example: [SNIP] In the above example we get same record

Re: [PATCH] perf tools: fix: Force backward ring buffer mapped readonly

2017-10-12 Thread Wangnan (F)
On 2017/10/12 22:45, Liang, Kan wrote: On 2017/10/12 20:56, Liang, Kan wrote: On 2017/10/11 21:16, Liang, Kan wrote: perf record's --overwrite option doesn't work as we expect. For example: [SNIP] In the above example we get same records from the backward ring buffer all the time. Overwrit

Re: [PATCH 02/10] perf tool: fix: Don't discard prev in backward mode

2017-10-12 Thread Wangnan (F)
On 2017/10/12 20:49, Liang, Kan wrote: From 8b058ea6977a97e5705aa2f64bdd014fd76d1247 Mon Sep 17 00:00:00 2001 From: Kan Liang Date: Wed, 11 Oct 2017 07:39:34 -0700 Subject: [PATCH] perf tool: fix: Don't discard prev in backward mode Perf record can switch output. The new output should onl

Re: [PATCH] perf tools: fix: Force backward ring buffer mapped readonly

2017-10-12 Thread Wangnan (F)
On 2017/10/12 20:56, Liang, Kan wrote: On 2017/10/11 21:16, Liang, Kan wrote: perf record's --overwrite option doesn't work as we expect. For example: [SNIP] In the above example we get same records from the backward ring buffer all the time. Overwriting is not triggered. This commit maps

Re: [PATCH 02/10] perf tool: fix: Don't discard prev in backward mode

2017-10-11 Thread Wangnan (F)
On 2017/10/11 22:57, Liang, Kan wrote: If you really want to avoid record duplication, you need to changes record__mmap_read()'s logic. Now it complains "failed to keep up with mmap data" and avoid dumping data when size of newly generated data is larger than the size of the ring buffer. It is

Re: [PATCH] perf tools: fix: Force backward ring buffer mapped readonly

2017-10-11 Thread Wangnan (F)
On 2017/10/11 21:16, Liang, Kan wrote: perf record's --overwrite option doesn't work as we expect. For example: [SNIP] In the above example we get same records from the backward ring buffer all the time. Overwriting is not triggered. This commit maps backward ring buffers readonly, make i

Re: [PATCH 03/10] perf tool: new iterfaces to read event from ring buffer

2017-10-10 Thread Wangnan (F)
On 2017/10/11 3:55, Liang, Kan wrote: On 2017/10/11 3:17, Arnaldo Carvalho de Melo wrote: Em Wed, Oct 11, 2017 at 03:10:37AM +0800, Wangnan (F) escreveu: On 2017/10/11 3:00, Arnaldo Carvalho de Melo wrote: Em Tue, Oct 10, 2017 at 03:36:28PM -0300, Arnaldo Carvalho de Melo escreveu: Em Tue

Re: [PATCH 02/10] perf tool: fix: Don't discard prev in backward mode

2017-10-10 Thread Wangnan (F)
On 2017/10/11 3:50, Liang, Kan wrote: On 2017/10/11 2:23, Wangnan (F) wrote: On 2017/10/11 1:20, kan.li...@intel.com wrote: From: Kan Liang Perf record can switch output. The new output should only store the data after switching. However, in overwrite backward mode, the new output still

Re: [PATCH 03/10] perf tool: new iterfaces to read event from ring buffer

2017-10-10 Thread Wangnan (F)
On 2017/10/11 3:17, Arnaldo Carvalho de Melo wrote: Em Wed, Oct 11, 2017 at 03:10:37AM +0800, Wangnan (F) escreveu: On 2017/10/11 3:00, Arnaldo Carvalho de Melo wrote: Em Tue, Oct 10, 2017 at 03:36:28PM -0300, Arnaldo Carvalho de Melo escreveu: Em Tue, Oct 10, 2017 at 03:34:55PM -0300

Re: [PATCH 03/10] perf tool: new iterfaces to read event from ring buffer

2017-10-10 Thread Wangnan (F)
On 2017/10/11 3:00, Arnaldo Carvalho de Melo wrote: Em Tue, Oct 10, 2017 at 03:36:28PM -0300, Arnaldo Carvalho de Melo escreveu: Em Tue, Oct 10, 2017 at 03:34:55PM -0300, Arnaldo Carvalho de Melo escreveu: Em Tue, Oct 10, 2017 at 06:28:18PM +, Liang, Kan escreveu: Em Tue, Oct 10, 2017 at

Re: [PATCH 02/10] perf tool: fix: Don't discard prev in backward mode

2017-10-10 Thread Wangnan (F)
On 2017/10/11 2:23, Wangnan (F) wrote: On 2017/10/11 1:20, kan.li...@intel.com wrote: From: Kan Liang Perf record can switch output. The new output should only store the data after switching. However, in overwrite backward mode, the new output still have the data from old output. At the

Re: [PATCH 02/10] perf tool: fix: Don't discard prev in backward mode

2017-10-10 Thread Wangnan (F)
On 2017/10/11 1:20, kan.li...@intel.com wrote: From: Kan Liang Perf record can switch output. The new output should only store the data after switching. However, in overwrite backward mode, the new output still have the data from old output. At the end of mmap_read, the position of processed

Re: [PATCHv2] perf bpf: Fix endianness problem when loading parameters in prologue

2017-08-15 Thread Wangnan (F)
On 2017/8/15 14:42, Thomas-Mich Richter wrote: On 08/14/2017 06:39 PM, Arnaldo Carvalho de Melo wrote: Em Mon, Aug 14, 2017 at 01:46:44PM +0200, Thomas Richter escreveu: Perf BPF prologue generator unconditionally fetches 8 bytes for function parameters, which causes problem on big endian mac

Re: perf bpf: Reworked fix endianness problem when loading parameters in prologue

2017-08-14 Thread Wangnan (F)
OK. On 2017/8/14 18:58, Thomas-Mich Richter wrote: On 08/14/2017 12:30 PM, Wangnan (F) wrote: Hi Thomas, Your patch looks good to me. I've tested in my environment and it works. Please resend it to lkml and let Arnaldo to collect it. Thank you. Will do, I take this as an Acked-b

Re: perf bpf: Reworked fix endianness problem when loading parameters in prologue

2017-08-14 Thread Wangnan (F)
Hi Thomas, Your patch looks good to me. I've tested in my environment and it works. Please resend it to lkml and let Arnaldo to collect it. Thank you. On 2017/8/14 17:47, Thomas Richter wrote: Perf BPF prologue generator unconditionally fetches 8 bytes for function parameters, which causes pro

Re: [PATCH] perf bpf: Fix endianness problem when loading parameters in prologue

2017-08-11 Thread Wangnan (F)
Hi Thomas, Please try this patch on your machine and give me the result. Thank you. On 2017/8/13 2:49, Wang Nan wrote: Perf BPF prologue generator unconditionally fetches 8 bytes for function parameters, which causes problem on big endian machine. Thomas gives a detail analysis for this proble

Re: perf test BPF subtest bpf-prologue test fails on s390x

2017-08-11 Thread Wangnan (F)
On 2017/8/11 17:17, Thomas-Mich Richter wrote: On 08/11/2017 07:19 AM, Wangnan (F) wrote: On 2017/8/11 2:13, Arnaldo Carvalho de Melo wrote: Thomas, please try to find who wrote that test and CC him, I'm doing it this time, Wang, can you please take a look at this? I also added lkml t

Re: perf test BPF subtest bpf-prologue test fails on s390x

2017-08-10 Thread Wangnan (F)
On 2017/8/11 2:13, Arnaldo Carvalho de Melo wrote: Thomas, please try to find who wrote that test and CC him, I'm doing it this time, Wang, can you please take a look at this? I also added lkml to the CC list, here we have more users of perf, lkml is the more developer centric perf list, as pe

Re: change uprobe_events default ? Was: [PATCH] perf: Rename CONFIG_[UK]PROBE_EVENT to CONFIG_[UK]PROBE_EVENTS

2017-03-15 Thread Wangnan (F)
On 2017/3/16 9:06, Arnaldo Carvalho de Melo wrote: Added more people to the CC list. Em Wed, Mar 15, 2017 at 05:58:19PM -0700, Alexei Starovoitov escreveu: On Thu, Feb 16, 2017 at 05:00:50PM +1100, Anton Blanchard wrote: We have uses of CONFIG_UPROBE_EVENT and CONFIG_KPROBE_EVENT as well as

Re: [PATCH net-next v1] bpf: Remove redundant ifdef

2017-02-14 Thread Wangnan (F)
On 2017/2/15 1:07, David Miller wrote: From: "Wangnan (F)" Date: Mon, 13 Feb 2017 09:53:49 +0800 On 2017/2/12 3:37, Mickaël Salaün wrote: Remove a useless ifdef __NR_bpf as requested by Wang Nan. Inline one-line static functions as it was in the bpf_sys.h file. Signed-off-b

Re: [PATCH net-next v1] bpf: Remove redundant ifdef

2017-02-12 Thread Wangnan (F)
On 2017/2/12 3:37, Mickaël Salaün wrote: Remove a useless ifdef __NR_bpf as requested by Wang Nan. Inline one-line static functions as it was in the bpf_sys.h file. Signed-off-by: Mickaël Salaün Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: David S. Miller Cc: Wang Nan Link: https://lkm

Re: [PATCH v4 0/3] Miscellaneous fixes for BPF (perf tree)

2017-02-12 Thread Wangnan (F)
On 2017/2/9 4:27, Mickaël Salaün wrote: This series brings some fixes and small improvements to the BPF samples. This is intended for the perf tree and apply on 7a5980f9c006 ("tools lib bpf: Add missing header to the library"). Changes since v3: * remove applied patch 1/5 * remove patch 2/5 o

Re: [PATCH net-next v5 04/11] bpf: Use bpf_load_program() from the library

2017-02-09 Thread Wangnan (F)
On 2017/2/10 10:25, Wangnan (F) wrote: On 2017/2/10 7:21, Mickaël Salaün wrote: Replace bpf_prog_load() with bpf_load_program() calls. Signed-off-by: Mickaël Salaün Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Shuah Khan --- tools/lib/bpf/bpf.c | 6

Re: [PATCH net-next v5 10/11] bpf: Remove bpf_sys.h from selftests

2017-02-09 Thread Wangnan (F)
On 2017/2/10 7:21, Mickaël Salaün wrote: Add require dependency headers. Signed-off-by: Mickaël Salaün Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Shuah Khan --- tools/lib/bpf/bpf.c | 6 ++ tools/testing/selftests/bpf/bpf_sys.h | 27

Re: [PATCH net-next v5 04/11] bpf: Use bpf_load_program() from the library

2017-02-09 Thread Wangnan (F)
On 2017/2/10 7:21, Mickaël Salaün wrote: Replace bpf_prog_load() with bpf_load_program() calls. Signed-off-by: Mickaël Salaün Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Shuah Khan --- tools/lib/bpf/bpf.c | 6 +++--- tools/lib/bpf/bpf.h

Re: [PATCH v2 1/5] bpf: Add missing header to the library

2017-02-07 Thread Wangnan (F)
Please add me into the cc list of all of the 5 patches. Thank you. On 2017/2/7 4:40, Mickaël Salaün wrote: Include stddef.h to define size_t. Signed-off-by: Mickaël Salaün Cc: Alexei Starovoitov Cc: Arnaldo Carvalho de Melo Cc: Daniel Borkmann Cc: Wang Nan --- tools/lib/bpf/bpf.h | 1 +

Re: [PATCH v3 1/5] bpf: Add missing header to the library

2017-02-07 Thread Wangnan (F)
On 2017/2/8 4:56, Mickaël Salaün wrote: Include stddef.h to define size_t. Signed-off-by: Mickaël Salaün Cc: Alexei Starovoitov Cc: Arnaldo Carvalho de Melo Cc: Daniel Borkmann Cc: Wang Nan --- tools/lib/bpf/bpf.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/lib/bpf/bpf.h

Re: [PATCH v3 2/5] bpf: Simplify bpf_load_program() error handling in the library

2017-02-07 Thread Wangnan (F)
On 2017/2/8 4:56, Mickaël Salaün wrote: Do not call a second time bpf(2) when a program load failed. BPF_PROG_LOAD should success most of the time. Setting log_level to 0 by default and require log buffer when failure can make it faster in normal case. Thank you. Signed-off-by: Mickaël Sal

Re: [PATCHv2 perf/core 5/7] tools lib bpf: Add bpf_program__pin()

2017-01-24 Thread Wangnan (F)
On 2017/1/25 9:16, Joe Stringer wrote: On 24 January 2017 at 17:06, Wangnan (F) wrote: On 2017/1/25 9:04, Wangnan (F) wrote: On 2017/1/23 9:11, Joe Stringer wrote: Add a new API to pin a BPF program to the filesystem. The user can specify the path full path within a BPF filesystem to

Re: [PATCHv2 perf/core 5/7] tools lib bpf: Add bpf_program__pin()

2017-01-24 Thread Wangnan (F)
On 2017/1/25 9:04, Wangnan (F) wrote: On 2017/1/23 9:11, Joe Stringer wrote: Add a new API to pin a BPF program to the filesystem. The user can specify the path full path within a BPF filesystem to pin the program. Programs with multiple instances are pinned as 'foo', 'foo_1

Re: [PATCHv2 perf/core 5/7] tools lib bpf: Add bpf_program__pin()

2017-01-24 Thread Wangnan (F)
On 2017/1/23 9:11, Joe Stringer wrote: Add a new API to pin a BPF program to the filesystem. The user can specify the path full path within a BPF filesystem to pin the program. Programs with multiple instances are pinned as 'foo', 'foo_1', 'foo_2', and so on. Signed-off-by: Joe Stringer --- v

Re: [PATCH perf/core 0/6] Libbpf improvements

2017-01-19 Thread Wangnan (F)
On 2017/1/19 7:57, Joe Stringer wrote: Patch 1 fixes an issue when using drastically different BPF map definitions inside ELFs from a client using libbpf, vs the map definition libbpf uses. Patch 2 is a trivial typo fix. Patches 3-5 add some simple, useful helper functions for setting prog ty

Re: [PATCH perf/core 6/6] tools lib bpf: Add bpf_object__pin()

2017-01-19 Thread Wangnan (F)
On 2017/1/19 7:57, Joe Stringer wrote: Add a new API to pin a BPF object to the filesystem. The user can specify a subdirectory under the BPF filesystem to pin these programs. For example, with the subdirectory 'foo', programs and maps are pinned: /sys/fs/bpf/foo/progs/PROG_NAME /sys/fs/bpf/fo

Re: [PATCH perf/core 2/6] tools lib bpf: Fix grammar in map_idx warning

2017-01-19 Thread Wangnan (F)
On 2017/1/19 7:57, Joe Stringer wrote: "Larger" is the comparative adjective form of "large". Signed-off-by: Joe Stringer --- tools/lib/bpf/libbpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index 350ee4c59f85..653b1

Re: [PATCH perf/core 1/6] tools lib bpf: Fix map offsets in relocation

2017-01-18 Thread Wangnan (F)
On 2017/1/19 7:57, Joe Stringer wrote: Commit 4708bbda5cb2 ("tools lib bpf: Fix maps resolution") attempted to fix map resolution by identifying the number of symbols that point to maps, and using this number to resolve each of the maps. However, during relocation the original definition of th

Re: [PATCH 0/7] perf tools: Add switch-output size and time threshold options

2017-01-03 Thread Wangnan (F)
On 2017/1/3 16:19, Jiri Olsa wrote: hi, adding a way to configure switch data output for size and time, like: $ sudo perf record -e 'sched:*' --switch-output=10M -avg callchain: type FP switch-output with 10M size threshold mmap size 528384B [ perf record: dump data: Woken up 37

coresight: Problem caused by resetting enable_sink

2016-12-26 Thread Wangnan (F)
Hi Mathieu, I meet problems caused by your commit d52c9750f150 ('coresight: reset "enable_sink" flag when need be'). Not only the one I posted in the previous patch. My use case is a simple 'perf record -e cs_etm// ls'. It works properly before this commit, and failed when allocating aux buffer

Re: [PATCHv3 perf/core 5/7] samples/bpf: Switch over to libbpf

2016-12-08 Thread Wangnan (F)
On 2016/12/9 13:04, Wangnan (F) wrote: On 2016/12/9 10:46, Joe Stringer wrote: [SNIP] diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile index 62d89d50fcbd..616bd55f3be8 100644 --- a/tools/lib/bpf/Makefile +++ b/tools/lib/bpf/Makefile @@ -149,6 +149,8 @@ CMD_TARGETS

Re: [PATCHv3 perf/core 5/7] samples/bpf: Switch over to libbpf

2016-12-08 Thread Wangnan (F)
On 2016/12/9 10:46, Joe Stringer wrote: Now that libbpf under tools/lib/bpf/* is synced with the version from samples/bpf, we can get rid most of the libbpf library here. Signed-off-by: Joe Stringer --- v3: First post. --- samples/bpf/Makefile | 60 +- samples/bp

Re: [PATCHv3 perf/core 3/7] tools lib bpf: Add flags to bpf_create_map()

2016-12-08 Thread Wangnan (F)
On 2016/12/9 10:46, Joe Stringer wrote: The map_flags argument to bpf_create_map() was previously not exposed. By exposing it, users can access flags such as whether or not to preallocate the map. Signed-off-by: Joe Stringer Please mention commit 6c90598174322b029e40dd84a4eb01f56afe in

Re: [PATCHv3 perf/core 2/7] tools lib bpf: use __u32 from linux/types.h

2016-12-08 Thread Wangnan (F)
On 2016/12/9 10:46, Joe Stringer wrote: Fixes the following issue when building without access to 'u32' type: ./tools/lib/bpf/bpf.h:27:23: error: unknown type name ‘u32’ Signed-off-by: Joe Stringer --- v3: Split from "tools lib bpf: Sync with samples/bpf/libbpf" --- tools/lib/bpf/bpf.c | 4

Re: [PATCH v4 01/18] perf build: Check LLVM version in feature check

2016-12-05 Thread Wangnan (F)
On 2016/12/6 15:13, Wang Nan wrote: Cancel builtin llvm and clang support when LLVM version is less than 3.9.0: following commits uses newer API. Since Clang/LLVM's API is not guaranteed to be stable, add a test-llvm-version.cpp feature checker, issue warning if LLVM found in compiling environ

Re: [PATCH v3 10/30] perf clang: Add builtin clang support ant test case

2016-12-05 Thread Wangnan (F)
On 2016/12/6 5:48, Arnaldo Carvalho de Melo wrote: Em Mon, Dec 05, 2016 at 07:02:48PM -0200, Arnaldo Carvalho de Melo escreveu: Em Mon, Dec 05, 2016 at 08:51:01AM -0800, Alexei Starovoitov escreveu: yeah. it's kinda high. I'm guessing rpm llvm libs are in debug mode. Try llvm-config --build-m

Re: [PATCH v3 10/30] perf clang: Add builtin clang support ant test case

2016-12-04 Thread Wangnan (F)
On 2016/12/5 10:36, Wangnan (F) wrote: On 2016/12/2 23:44, Arnaldo Carvalho de Melo wrote: Em Sat, Nov 26, 2016 at 07:03:34AM +, Wang Nan escreveu: Add basic clang support in clang.cpp and test__clang() testcase. The first testcase checks if builtin clang is able to generate LLVM IR

Re: [PATCH v3 10/30] perf clang: Add builtin clang support ant test case

2016-12-04 Thread Wangnan (F)
On 2016/12/2 23:44, Arnaldo Carvalho de Melo wrote: Em Sat, Nov 26, 2016 at 07:03:34AM +, Wang Nan escreveu: Add basic clang support in clang.cpp and test__clang() testcase. The first testcase checks if builtin clang is able to generate LLVM IR. tests/clang.c is a proxy. Real testcase res

Re: [PATCH v3 14/30] perf clang: Support compile IR to BPF object and add testcase

2016-11-28 Thread Wangnan (F)
On 2016/11/28 14:32, Wangnan (F) wrote: On 2016/11/27 1:25, Alexei Starovoitov wrote: On Sat, Nov 26, 2016 at 07:03:38AM +, Wang Nan wrote: getBPFObjectFromModule() is introduced to compile LLVM IR(Module) to BPF object. Add new testcase for it. Test result: $ ./buildperf/perf test

Re: [PATCH v3 10/30] perf clang: Add builtin clang support ant test case

2016-11-27 Thread Wangnan (F)
On 2016/11/27 1:17, Alexei Starovoitov wrote: On Sat, Nov 26, 2016 at 07:03:34AM +, Wang Nan wrote: Add basic clang support in clang.cpp and test__clang() testcase. The first testcase checks if builtin clang is able to generate LLVM IR. tests/clang.c is a proxy. Real testcase resides in u

Re: [PATCH v3 20/30] perf clang jit: add PerfModule::doJIT to JIT perfhook functions

2016-11-27 Thread Wangnan (F)
On 2016/11/27 1:29, Alexei Starovoitov wrote: On Sat, Nov 26, 2016 at 07:03:44AM +, Wang Nan wrote: PerfModule::doJIT JIT compile perfhook functions and saves result into a map. Add a test case for it. At this stage perfhook functions can do no useful things because they can't invoke exte

Re: [PATCH v3 14/30] perf clang: Support compile IR to BPF object and add testcase

2016-11-27 Thread Wangnan (F)
On 2016/11/27 1:25, Alexei Starovoitov wrote: On Sat, Nov 26, 2016 at 07:03:38AM +, Wang Nan wrote: getBPFObjectFromModule() is introduced to compile LLVM IR(Module) to BPF object. Add new testcase for it. Test result: $ ./buildperf/perf test -v clang 51: Test builtin clang support

Re: [PATCHv2 perf/core 2/2] tools lib bpf: Sync with samples/bpf/libbpf

2016-11-16 Thread Wangnan (F)
On 2016/11/17 10:46, Joe Stringer wrote: On 16 November 2016 at 18:10, Wangnan (F) wrote: I'm also working on improving bpf.c. Please have a look at: https://lkml.org/lkml/2016/11/14/1078 Since bpf.c is simple, I think we can add more functions and fixes gradually, instead of a full

Re: [PATCH 05/34] tools lib bpf: Add missing bpf map functions

2016-11-16 Thread Wangnan (F)
On 2016/11/15 12:05, Wang Nan wrote: Add more BPF map operations to libbpf. Signed-off-by: Wang Nan Cc: Alexei Starovoitov Cc: Arnaldo Carvalho de Melo Cc: Li Zefan --- tools/lib/bpf/bpf.c | 56 + tools/lib/bpf/bpf.h | 7 +++ 2 f

Re: [PATCHv2 perf/core 2/2] tools lib bpf: Sync with samples/bpf/libbpf

2016-11-16 Thread Wangnan (F)
On 2016/11/17 10:46, Joe Stringer wrote: On 16 November 2016 at 18:10, Wangnan (F) wrote: I'm also working on improving bpf.c. Please have a look at: https://lkml.org/lkml/2016/11/14/1078 Since bpf.c is simple, I think we can add more functions and fixes gradually, instead of a full

Re: [PATCHv2 perf/core 2/2] tools lib bpf: Sync with samples/bpf/libbpf

2016-11-16 Thread Wangnan (F)
I'm also working on improving bpf.c. Please have a look at: https://lkml.org/lkml/2016/11/14/1078 Since bpf.c is simple, I think we can add more functions and fixes gradually, instead of a full copy. See my inline comment below. On 2016/11/17 1:43, Joe Stringer wrote: Extend the tools/ versio

Re: [PATCHv2 perf/core 1/2] tools lib bpf: Sync {tools,}/include/uapi/linux/bpf.h

2016-11-16 Thread Wangnan (F)
On 2016/11/17 1:43, Joe Stringer wrote: The tools version of this header is out of date; update it to the latest version from the kernel headers. Signed-off-by: Joe Stringer --- v2: No change. --- tools/include/uapi/linux/bpf.h | 51 ++ 1 file change

Re: [PATCH 00/34] perf clang: Builtin clang and perfhook support

2016-11-14 Thread Wangnan (F)
On 2016/11/15 13:21, Alexei Starovoitov wrote: On Mon, Nov 14, 2016 at 9:03 PM, Wangnan (F) wrote: On 2016/11/15 12:57, Alexei Starovoitov wrote: On Mon, Nov 14, 2016 at 8:05 PM, Wang Nan wrote: This is version 2 of perf builtin clang patch series. Compare to v1, add an exciting feature

Re: [PATCH 00/34] perf clang: Builtin clang and perfhook support

2016-11-14 Thread Wangnan (F)
On 2016/11/15 12:57, Alexei Starovoitov wrote: On Mon, Nov 14, 2016 at 8:05 PM, Wang Nan wrote: This is version 2 of perf builtin clang patch series. Compare to v1, add an exciting feature: jit compiling perf hook functions. This features allows script writer report result through BPF map in

Re: [PATCH 00/34] perf clang: Builtin clang and perfhook support

2016-11-14 Thread Wangnan (F)
On 2016/11/15 12:05, Wang Nan wrote: $ sudo -s # ulimit -l unlimited # perf record -e ./count_syscalls.c echo "Haha" Start count, perfpid=25209 Haha [ perf record: Woken up 1 times to write data ] syscall 8count: 6 syscall 11 count: 1 syscall 4count: 6 sy

Re: [PATCH 7/8] tools lib bpf: fix maps resolution

2016-11-08 Thread Wangnan (F)
Hi Eric, During testing this patch I find a segfault, please see inline comment. In addition, since both the BPF map array and map names should be done after symbol table is collected, merging bpf_object__init_maps and bpf_object__init_maps_name would be a good practice, making code simpler. So

Re: [PATCH 7/8] tools lib bpf: fix maps resolution

2016-11-07 Thread Wangnan (F)
Hi Eric, Are you still working in this patch set? Now I know why maps section is not a simple array from a patch set from Joe Stringer: https://www.mail-archive.com/netdev@vger.kernel.org/msg135088.html So I think this patch is really useful. Are you going to resend the whole patch set? If no

Re: [PATCH 2/2] perf_event_open.2: Document write_backward

2016-10-23 Thread Wangnan (F)
On 2016/10/22 18:05, Michael Kerrisk (man-pages) wrote: On 10/21/2016 11:25 PM, Vince Weaver wrote: On Fri, 21 Oct 2016, Wang Nan wrote: context_switch : 1, /* context switch data */ - - __reserved_1 : 37; + write_backward : 1, /* Write ring buffer from en

Re: [PATCH 1/5] perf core: Introduce new ioctl options to pause and resume ring buffer

2016-10-21 Thread Wangnan (F)
On 2016/10/21 15:06, Michael Kerrisk (man-pages) wrote: Hello Wangnan, The patch below seems to have landed in Linux 4.7, commit 86e7972f690c1017fd086cdfe53d8524e68c661c Could you draft a man-pages patch for this interface change, please? Or, failing that, a plain-text description that we can

Re: [PATCH 1/8] tools lib bpf: add error functions

2016-10-18 Thread Wangnan (F)
On 2016/10/19 6:52, Joe Stringer wrote: On 16 October 2016 at 14:18, Eric Leblond wrote: The include of err.h is not explicitely needed in exported functions and it was causing include conflict with some existing code due to redefining some macros. To fix this, let's have error handling func

Re: [PATCH 7/8] tools lib bpf: fix maps resolution

2016-10-16 Thread Wangnan (F)
On 2016/10/17 5:18, Eric Leblond wrote: It is not correct to assimilate the elf data of the maps section to an array of map definition. In fact the sizes differ. The offset provided in the symbol section has to be used instead. This patch fixes a bug causing a elf with two maps not to load cor

Re: [PATCH 6/8] tools lib bpf: improve warning

2016-10-16 Thread Wangnan (F)
On 2016/10/17 5:18, Eric Leblond wrote: Signed-off-by: Eric Leblond Please add some commit messages. Thank you. --- tools/lib/bpf/libbpf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index 7cd341e..1fe4532 100644

Re: [PATCH 5/8] tools lib bpf: add missing functions

2016-10-16 Thread Wangnan (F)
On 2016/10/17 5:18, Eric Leblond wrote: Some functions were missing in the library to be able to use it in the case where the userspace is handling the maps in kernel. The patch also renames functions to have a homogeneous naming convention. Signed-off-by: Eric Leblond --- tools/lib/bpf/bp

Re: [PATCH 4/8] tools lib bpf: export function to set type

2016-10-16 Thread Wangnan (F)
On 2016/10/17 5:18, Eric Leblond wrote: Current API was not allowing the user to set a type like socket filter. To avoid a setter function for each type, the patch simply exports a set function that takes the type in parameter. Signed-off-by: Eric Leblond --- tools/lib/bpf/libbpf.c | 19 +++

Re: [PATCH 3/8] tools: Sync tools/include/uapi/linux/bpf.h with the kernel

2016-10-16 Thread Wangnan (F)
On 2016/10/17 5:18, Eric Leblond wrote: Signed-off-by: Eric Leblond Commit message is required. Thank you. --- tools/include/uapi/linux/bpf.h | 52 ++ 1 file changed, 52 insertions(+) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/u

Re: [PATCH 1/8] tools lib bpf: add error functions

2016-10-16 Thread Wangnan (F)
On 2016/10/17 5:18, Eric Leblond wrote: The include of err.h is not explicitely needed in exported functions and it was causing include conflict with some existing code due to redefining some macros. To fix this, let's have error handling functions provided by the library. Furthermore this wil

Re: [PATCH 1/3] perf, tools: Handle events including .c and .o

2016-10-07 Thread Wangnan (F)
On 2016/10/7 4:18, Arnaldo Carvalho de Melo wrote: Em Wed, Oct 05, 2016 at 12:47:10PM -0700, Andi Kleen escreveu: From: Andi Kleen This is a generic bug fix, but it helps with Sukadev's JSON event tree where such events can happen. Any event inclduing a .c/.o/.bpf currently triggers BPF com

Re: [PATCH v2 00/18] perf clang: Support compiling BPF script on the fly

2016-10-07 Thread Wangnan (F)
On 2016/10/6 7:20, Arnaldo Carvalho de Melo wrote: Em Mon, Sep 26, 2016 at 07:26:54AM +, Wang Nan escreveu: This patch add builtin clang, allow perf compile BPF scripts on the fly. This is the first step to implement what I announced at LinuxCon 2016 NA: Ok, so I refreshed this series to

Re: [PATCH 00/14] perf clang: Support compiling BPF script use builtin clang

2016-09-26 Thread Wangnan (F)
On 2016/9/27 7:58, Arnaldo Carvalho de Melo wrote: Le 26 sept. 2016 8:47 PM, "Alexei Starovoitov" mailto:alexei.starovoi...@gmail.com>> a écrit : > > On Mon, Sep 26, 2016 at 09:49:30AM +0800, Wangnan (F) wrote: > > > > > > On 2016/9/24 23:16, Alexe

Re: [PATCH 00/14] perf clang: Support compiling BPF script use builtin clang

2016-09-25 Thread Wangnan (F)
On 2016/9/24 23:16, Alexei Starovoitov wrote: On Fri, Sep 23, 2016 at 12:49:47PM +, Wang Nan wrote: This patch set is the first step to implement features I announced in LinuxCon NA 2016. See page 31 of: http://events.linuxfoundation.org/sites/events/files/slides/Performance%20Monitori

Re: [PATCH] perf record: Fix segfault when running with suid and kptr_restrict is 1

2016-09-23 Thread Wangnan (F)
On 2016/9/22 23:41, Arnaldo Carvalho de Melo wrote: Em Wed, Sep 21, 2016 at 03:56:20AM +, Wang Nan escreveu: Before this patch perf panic if kptr_restrict set to 1 and perf is owned by root with suid set: $ whoami wangnan $ ls -l ./perf -rwsr-xr-x 1 root root 19781908 Sep 21 19:29

Re: [PATCH] perf record: Fix segfault when running with suid and kptr_restrict is 1

2016-09-20 Thread Wangnan (F)
On 2016/9/21 11:48, Wang Nan wrote: Before this patch perf panic if kptr_restrict set to 1 and perf is owned by root with suid set: $ whoami wangnan $ ls -l ./perf -rwsr-xr-x 1 root root 19781908 Sep 21 19:29 /home/wangnan/perf $ cat /proc/sys/kernel/kptr_restrict 1 $ cat /proc/s

Re: [PATCH] perf, tools: Handle events including .c and .o

2016-09-18 Thread Wangnan (F)
On 2016/9/18 22:56, Andi Kleen wrote: On Sun, Sep 18, 2016 at 06:20:04PM +0800, Wangnan (F) wrote: On 2016/9/18 9:02, Andi Kleen wrote: From: Andi Kleen This is a generic bug fix, but it helps with Sukadev's JSON event tree where such events can happen. Any event inclduing a .c/.o

  1   2   3   4   5   6   >