Commit-ID: 44df1afdb174fd6038e419f80efd914c0b5f2f85
Gitweb: https://git.kernel.org/tip/44df1afdb174fd6038e419f80efd914c0b5f2f85
Author: Wang Nan
AuthorDate: Wed, 6 Dec 2017 01:50:40 +
Committer: Arnaldo Carvalho de Melo
CommitDate: Mon, 8 Jan 2018 11:11:57 -0300
perf tools: Fix
o such file or directory
make[4]: *** [util/libunwind/x86_32.o] Error 1
make[3]: *** [util] Error 2
make[2]: *** [libperf-in.o] Error 2
make[1]: *** [sub-make] Error 2
make: *** [all] Error 2
It happens when libunwind-x86 feature is detected.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de M
Commit-ID: 7fb4b407a1242dbc85ea3ed1be065dca8f9a6f5b
Gitweb: https://git.kernel.org/tip/7fb4b407a1242dbc85ea3ed1be065dca8f9a6f5b
Author: Wang Nan
AuthorDate: Mon, 4 Dec 2017 16:51:06 +
Committer: Arnaldo Carvalho de Melo
CommitDate: Tue, 5 Dec 2017 15:59:37 -0300
perf mmap: Don
Commit-ID: 0b72d69a542873ee098867deeb37d27ad4629c64
Gitweb: https://git.kernel.org/tip/0b72d69a542873ee098867deeb37d27ad4629c64
Author: Wang Nan
AuthorDate: Mon, 4 Dec 2017 16:51:07 +
Committer: Arnaldo Carvalho de Melo
CommitDate: Tue, 5 Dec 2017 16:02:39 -0300
perf tools: Rename
Commit-ID: 71f566a34986f4a86a8c546c7a36f70f0132b8a9
Gitweb: https://git.kernel.org/tip/71f566a34986f4a86a8c546c7a36f70f0132b8a9
Author: Wang Nan
AuthorDate: Mon, 4 Dec 2017 16:51:05 +
Committer: Arnaldo Carvalho de Melo
CommitDate: Tue, 5 Dec 2017 15:45:36 -0300
perf mmap: Fix
Commit-ID: 8eb7a1fe31612fd3e8ae8042dd2ebaf7575504cb
Gitweb: https://git.kernel.org/tip/8eb7a1fe31612fd3e8ae8042dd2ebaf7575504cb
Author: Wang Nan
AuthorDate: Sun, 3 Dec 2017 02:00:41 +
Committer: Arnaldo Carvalho de Melo
CommitDate: Tue, 5 Dec 2017 15:43:54 -0300
perf mmap: Remove
Commit-ID: ca6a9a05391960be5e8161a59a9854b32325d901
Gitweb: https://git.kernel.org/tip/ca6a9a05391960be5e8161a59a9854b32325d901
Author: Wang Nan
AuthorDate: Sun, 3 Dec 2017 02:00:40 +
Committer: Arnaldo Carvalho de Melo
CommitDate: Tue, 5 Dec 2017 15:43:54 -0300
perf mmap: Remove
Commit-ID: 144b9a4fc53039c09007b71a06640560a6e62140
Gitweb: https://git.kernel.org/tip/144b9a4fc53039c09007b71a06640560a6e62140
Author: Wang Nan
AuthorDate: Sun, 3 Dec 2017 02:00:39 +
Committer: Arnaldo Carvalho de Melo
CommitDate: Tue, 5 Dec 2017 15:43:54 -0300
perf evlist
Commit-ID: 7a276ff6c3202697c3c15cad757dec3bb07d14bf
Gitweb: https://git.kernel.org/tip/7a276ff6c3202697c3c15cad757dec3bb07d14bf
Author: Wang Nan
AuthorDate: Sun, 3 Dec 2017 02:00:38 +
Committer: Arnaldo Carvalho de Melo
CommitDate: Tue, 5 Dec 2017 15:43:53 -0300
perf evlist
Commit-ID: f74b9d3a1ac2b9c3ae1475f474ca0e6644746fbf
Gitweb: https://git.kernel.org/tip/f74b9d3a1ac2b9c3ae1475f474ca0e6644746fbf
Author: Wang Nan
AuthorDate: Sun, 3 Dec 2017 02:00:37 +
Committer: Arnaldo Carvalho de Melo
CommitDate: Tue, 5 Dec 2017 15:43:53 -0300
perf evlist
o such file or directory
make[4]: *** [util/libunwind/x86_32.o] Error 1
make[3]: *** [util] Error 2
make[2]: *** [libperf-in.o] Error 2
make[1]: *** [sub-make] Error 2
make: *** [all] Error 2
It happens when libunwind-x86 feature is detected.
Signed-off-by: Wang Nan
---
tools/perf/arch/x
md->prev is still
available.
Signed-off-by: Wang Nan
Tested-by: Kan Liang
---
tools/perf/util/mmap.c | 33 +++--
1 file changed, 15 insertions(+), 18 deletions(-)
diff --git a/tools/perf/util/mmap.c b/tools/perf/util/mmap.c
index 3f262e7..5f8cb15 100644
--- a/too
Remove the backward/forward concept to make it uniform with user
interface (the '--overwrite' option).
Signed-off-by: Wang Nan
---
tools/perf/builtin-record.c | 14 +++---
tools/perf/tests/backward-ring-buffer.c | 4 ++--
tools/perf/util/evlist.c
1 (1,
12cc330, 4, 7fc237280370, 7fc2373d0700, 2c7b0)
python 2545 [000] 11079.280850: raw_syscalls:sys_exit: NR 1 = 4
Signed-off-by: Wang Nan
---
tools/perf/util/evlist.c | 11 ---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/tools/perf/util/evlist.c b/tools/perf
Simplify patch 1/3 following Namhyung's suggestion.
Context adjustment for patch 2 and 3.
Wang Nan (3):
perf mmap: Fix perf backward recording
perf tools: Don't discard prev in backward mode
perf tools: Replace 'backward' to 'overwrite' in evlist. mmap and
een two dumpping commands.
Patch 8 is 's/backward/overwrite'. After patch 8, the concept of
'backward' is removed from most of the code, make it uniform with
user interface ('--overwrite').
Cc: Kan Liang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
Cc: Namhyung Ki
30, 4, 7fc237280370, 7fc2373d0700, 2c7b0)
python 2545 [000] 11079.280850: raw_syscalls:sys_exit: NR 1 = 4
Signed-off-by: Wang Nan
---
tools/perf/util/evlist.c | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evl
md->prev is still
available.
Signed-off-by: Wang Nan
Tested-by: Kan Liang
---
tools/perf/util/mmap.c | 33 +++--
1 file changed, 15 insertions(+), 18 deletions(-)
diff --git a/tools/perf/util/mmap.c b/tools/perf/util/mmap.c
index 3f262e7..5f8cb15 100644
--- a/too
All perf_mmap__read_forward() read from read-write ring buffer,
so no need check_messup. Reading from backward ring buffer doesn't
require check_messup because it never mess up. Cleanup arguments
lists.
Signed-off-by: Wang Nan
---
tools/perf/util/evlist.c | 2 +-
tools/perf/util/mmap.c
'overwrite' argument is always 'false'. Revmove it from arguments
list of perf_mmap__push.
Signed-off-by: Wang Nan
---
tools/perf/builtin-record.c | 2 +-
tools/perf/util/mmap.c | 6 +++---
tools/perf/util/mmap.h | 2 +-
3 files changed, 5 insertions(+), 5 deleti
All users of perf_evlist__mmap_ex set !overwrite. Remove it from its
arguments list.
Signed-off-by: Wang Nan
---
tools/perf/builtin-record.c | 2 +-
tools/perf/util/evlist.c| 8
tools/perf/util/evlist.h| 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/tools
Remove the backward/forward concept to make it uniform with user
interface (the '--overwrite' option).
Signed-off-by: Wang Nan
---
tools/perf/builtin-record.c | 14 +++---
tools/perf/tests/backward-ring-buffer.c | 4 ++--
tools/perf/util/evlist.c
Now all perf_evlist__mmap's users doesn't set 'overwrite'. Remove it from
arguments list.
Signed-off-by: Wang Nan
---
tools/perf/arch/x86/tests/perf-time-to-tsc.c | 2 +-
tools/perf/builtin-kvm.c | 2 +-
tools/perf/builtin-top.c | 2 +-
evlist->overwrite is set to false in all users. It can be removed.
Signed-off-by: Wang Nan
---
tools/perf/builtin-record.c | 2 +-
tools/perf/util/evlist.c| 5 ++---
tools/perf/util/evlist.h| 1 -
3 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/tools/perf/builtin-recor
Commit-ID: a0e3dd79cdd8ad838cbcefeff530a15193f8336e
Gitweb: https://git.kernel.org/tip/a0e3dd79cdd8ad838cbcefeff530a15193f8336e
Author: Wang Nan
AuthorDate: Mon, 13 Nov 2017 01:38:07 +
Committer: Arnaldo Carvalho de Melo
CommitDate: Thu, 16 Nov 2017 14:49:58 -0300
perf tests: Set
Commit-ID: 677b0601768881934f658bebb1713c3c843893fa
Gitweb: https://git.kernel.org/tip/677b0601768881934f658bebb1713c3c843893fa
Author: Wang Nan
AuthorDate: Mon, 13 Nov 2017 01:38:05 +
Committer: Arnaldo Carvalho de Melo
CommitDate: Thu, 16 Nov 2017 14:49:57 -0300
perf tests: Set
Commit-ID: d492326f160e44e08fcf132a63163b36dd8e8839
Gitweb: https://git.kernel.org/tip/d492326f160e44e08fcf132a63163b36dd8e8839
Author: Wang Nan
AuthorDate: Mon, 13 Nov 2017 01:38:04 +
Committer: Arnaldo Carvalho de Melo
CommitDate: Thu, 16 Nov 2017 14:49:57 -0300
perf tests: Set
Commit-ID: 301d724aa19add1c0cf3ec8cad0d10151d30393f
Gitweb: https://git.kernel.org/tip/301d724aa19add1c0cf3ec8cad0d10151d30393f
Author: Wang Nan
AuthorDate: Mon, 13 Nov 2017 01:38:06 +
Committer: Arnaldo Carvalho de Melo
CommitDate: Thu, 16 Nov 2017 14:49:58 -0300
perf tests: Set
After removing the concept of 'overwrite' in code level, now the
prot is determinated by write_backward. There's no need to pass
prot from perf_evlist__mmap_ex().
Signed-off-by: Wang Nan
---
tools/perf/util/evlist.c | 17 ++---
tools/perf/util/mmap.c | 4 ++--
Changing ringbuffer to !overwrite in this task is harmless because
this test uses a very low frequency (1) and using a very simple
program (true). There should have only 3 events in the whole test.
Overwriting is impossible to happen.
Signed-off-by: Wang Nan
---
tools/perf/tests/task-exit.c | 2
30, 4, 7fc237280370, 7fc2373d0700, 2c7b0)
python 2545 [000] 11079.280850: raw_syscalls:sys_exit: NR 1 = 4
Signed-off-by: Wang Nan
---
tools/perf/util/evlist.c | 8 +++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
Based on previous discussion, perf needs to support only two types
of ringbuffer: read-write + forward, readonly + backward. This patchset
completly removes the concept of 'overwrite' from code level, controls
mapping permission using write_backward instead.
Wang Nan (7):
perf mmap
Unsetting overwrite when calling perf_evlist__mmap is harmless. This commit
passes false to it, makes following commits eliminate the overwrite argument
easier.
Signed-off-by: Wang Nan
---
tools/perf/tests/sw-clock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf
In this test, a large ring buffer is required so all events can feed into,
so overwrite or not is meaningless.
Change to !overwrite so following commits can remove this argument.
Signed-off-by: Wang Nan
---
tools/perf/tests/mmap-basic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion
Setting overwrite in perf_evlist__mmap() is meaningless because the
event in this evlist is already have 'overwrite' postfix and goes to
backward ring buffer automatically. Pass 'false' to perf_evlist__mmap()
to make it similar to others.
Signed-off-by: Wang Nan
---
tools
s no 'overwrite' concept. Each evlist has two
ringbuffer groups. One is read-write/forward, another is readonly/backward.
Don't support read-write/backward and readonly/forward.
2. In user interface, we keep '--overwrite' and translate it into
write_backward
i
reover, a copy_to_user() can also
write to these pages without generating page fault, causes use-after-free
bugs.
This patch gathers each vma instead of gathering full vm space.
In this case tlb->fullmm is not true. The behavior of oom reaper become
similar to munmapping before do_exit, which s
mm is not true. The behavior of oom reaper become similar
to munmapping before do_exit, which should be safe for all archs.
Signed-off-by: Wang Nan
Cc: Bob Liu
Cc: Michal Hocko
Cc: Andrew Morton
Cc: Michal Hocko
Cc: David Rientjes
Cc: Ingo Molnar
Cc: Roman Gushchin
Cc: Konstantin Khle
er, wraps
them into a record mode. In flight recorder mode, perf only dumps data before
something happen.
Signed-off-by: Wang Nan
---
tools/perf/Documentation/perf-record.txt | 8
tools/perf/builtin-record.c | 4 ++--
tools/perf/perf.h| 2 +-
to
by introducing the concept of 'flightrecorder' and convert many 'overwrite'
to it to clarify that what we really want is a perf record flightrecorder
mode, not only mapping the ring buffer overwritable.
Wang Nan (2):
perf mmap: Fix perf backward recording
perf record: Replace 'o
1 (1,
12cc330, 4, 7fc237280370, 7fc2373d0700, 2c7b0)
python 2545 [000] 11079.280850: raw_syscalls:sys_exit: NR 1 = 4
Signed-off-by: Wang Nan
---
tools/perf/util/evlist.c | 8 +++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evl
md->prev is still
available.
Signed-off-by: Wang Nan
Cc: Liang Kan
---
tools/perf/util/mmap.c | 33 +++--
1 file changed, 15 insertions(+), 18 deletions(-)
diff --git a/tools/perf/util/mmap.c b/tools/perf/util/mmap.c
index 9fe5f9c..df1de55 100644
--- a/tools/perf
ata.2017101221540551 |
head -n 1
dd 5126 [003] 183076.108093: raw_syscalls:sys_enter: NR 1 (1, af8000, 200,
871, 0, af8060)
$ ~/linux/tools/perf$ sudo ./perf script -i ./perf.data.2017101221540651 |
head -n 1
dd 5126 [003] 183077.109676: raw_syscalls:sys_exit: NR 1 = 512
Signed-
Commit-ID: db26984a363e8b8e35783c402978e8acdf9041a5
Gitweb: http://git.kernel.org/tip/db26984a363e8b8e35783c402978e8acdf9041a5
Author: Wang Nan
AuthorDate: Tue, 15 Aug 2017 11:21:59 +0200
Committer: Arnaldo Carvalho de Melo
CommitDate: Wed, 16 Aug 2017 10:31:11 -0300
perf bpf: Fix
argument and converts data from
memory to expected type.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Thomas Richter
Cc: Alexei Starovoitov
Cc: Hendrik Brueckner
Cc: Li Zefan
---
tools/perf/tests/bpf-script-test-prologue.c | 4 ++-
tools/perf/util/bpf-prologue.c
Perf BPF prologue generator unconditionally fetches 8 bytes for function
parameters. On big endian machine, a casting is resquired if the parameter
is not u64.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Thomas Richter
Cc: Alexei Starovoitov
Cc: Hendrik Brueckner
Cc: Li Zefan
Commit-ID: 9b57fb7e35957c6838f89f4ed7e3f8433a4bbfc5
Gitweb: http://git.kernel.org/tip/9b57fb7e35957c6838f89f4ed7e3f8433a4bbfc5
Author: Wang Nan
AuthorDate: Wed, 21 Jun 2017 02:32:03 +0800
Committer: Arnaldo Carvalho de Melo
CommitDate: Mon, 19 Jun 2017 16:11:26 -0300
perf test llvm
make it passes perf test.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Thomas-Mich Richter
Cc: Hendrik Brueckner
Cc: Alexei Starovoitov
Cc: Li Zefan
---
tools/perf/tests/bpf-script-test-prologue.c | 9 +
1 file changed, 9 insertions(+)
diff --git a/tools/perf/tests/
t;perf: Fix event->ctx locking")
Link:
http://lkml.kernel.org/r/20170106131444.gz3...@twins.programming.kicks-ass.net
Signed-off-by: Ingo Molnar
Signed-off-by: Wang Nan
[ - Correct code context
- Use group_flags instead of group_caps
]
---
kernel/events/core.c | 57
Signed-off-by: Peter Zijlstra (Intel)
Cc: Alexander Shishkin
Cc: Linus Torvalds
Cc: Peter Zijlstra
Cc: Thomas Gleixner
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar
Signed-off-by: Wang Nan
---
kernel/events/core.c | 49 -
1 file
These two patch are needed for stable 4.1. They fix CVE-2017-6001.
Peter Zijlstra (2):
perf: Restructure perf syscall point of no return
perf/core: Fix concurrent sys_perf_event_open() vs. 'move_group' race
kernel/events/core.c | 102 +--
1 fil
pf reports:
libbpf: bpf relocation: map_idx 3 large than 2
Fix map relocation by checking the exact offset of maps when doing
relocation.
Fixes: 4708bbda5cb2 ("tools lib bpf: Fix maps resolution")
Signed-off-by: Joe Stringer
Signed-off-by: Wang Nan
[Allow different map size in an ob
de: 912040a5 d0001c00 f873d821 911c6000 (b8656822)
---[ end trace 98933da8f92b0c9a ]---
Signed-off-by: Wang Nan
Cc: Xia Kaixu
Cc: Li Zefan
Cc: Mathieu Poirier
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
---
drivers/hwtracing/coresight/coresight-etm-perf.c | 1 +
1
Commit-ID: a940cad331e79cc03d9ae74f56a2c7cb810bdce9
Gitweb: http://git.kernel.org/tip/a940cad331e79cc03d9ae74f56a2c7cb810bdce9
Author: Wang Nan
AuthorDate: Tue, 6 Dec 2016 07:22:30 +
Committer: Arnaldo Carvalho de Melo
CommitDate: Tue, 6 Dec 2016 13:21:55 -0300
perf build: Check
Commit-ID: edd695b032ba3a90c3bb07d934500b2c390a61ff
Gitweb: http://git.kernel.org/tip/edd695b032ba3a90c3bb07d934500b2c390a61ff
Author: Wang Nan
AuthorDate: Sat, 26 Nov 2016 07:03:39 +
Committer: Arnaldo Carvalho de Melo
CommitDate: Mon, 5 Dec 2016 15:51:45 -0300
perf clang
Commit-ID: 5e08a76525b8f5e9aeb8b27d0466614abec070a9
Gitweb: http://git.kernel.org/tip/5e08a76525b8f5e9aeb8b27d0466614abec070a9
Author: Wang Nan
AuthorDate: Sat, 26 Nov 2016 07:03:38 +
Committer: Arnaldo Carvalho de Melo
CommitDate: Mon, 5 Dec 2016 15:51:44 -0300
perf clang
Commit-ID: a9495fe9dc63bee1166772b6f10e199ef1747892
Gitweb: http://git.kernel.org/tip/a9495fe9dc63bee1166772b6f10e199ef1747892
Author: Wang Nan
AuthorDate: Sat, 26 Nov 2016 07:03:36 +
Committer: Arnaldo Carvalho de Melo
CommitDate: Mon, 5 Dec 2016 15:51:44 -0300
perf clang: Allow
Commit-ID: e67d52d411c3562263735479db2efd2ebd178db9
Gitweb: http://git.kernel.org/tip/e67d52d411c3562263735479db2efd2ebd178db9
Author: Wang Nan
AuthorDate: Sat, 26 Nov 2016 07:03:37 +
Committer: Arnaldo Carvalho de Melo
CommitDate: Mon, 5 Dec 2016 15:51:44 -0300
perf clang: Update
Commit-ID: 77dfa84a843c0bc935a6c8664f2556573e30845f
Gitweb: http://git.kernel.org/tip/77dfa84a843c0bc935a6c8664f2556573e30845f
Author: Wang Nan
AuthorDate: Sat, 26 Nov 2016 07:03:35 +
Committer: Arnaldo Carvalho de Melo
CommitDate: Mon, 5 Dec 2016 15:51:44 -0300
perf clang: Use
Commit-ID: 00b86691c77c6576861b82a3cfe4d609800758fe
Gitweb: http://git.kernel.org/tip/00b86691c77c6576861b82a3cfe4d609800758fe
Author: Wang Nan
AuthorDate: Sat, 26 Nov 2016 07:03:34 +
Committer: Arnaldo Carvalho de Melo
CommitDate: Mon, 5 Dec 2016 15:51:43 -0300
perf clang: Add
Commit-ID: d58ac0bf8d1e6ffbfcb0a77e459cf4737b131b75
Gitweb: http://git.kernel.org/tip/d58ac0bf8d1e6ffbfcb0a77e459cf4737b131b75
Author: Wang Nan
AuthorDate: Sat, 26 Nov 2016 07:03:33 +
Committer: Arnaldo Carvalho de Melo
CommitDate: Mon, 5 Dec 2016 15:51:43 -0300
perf build: Add
Commit-ID: cb40d55b595cd117ef7c1880247605875b2115e8
Gitweb: http://git.kernel.org/tip/cb40d55b595cd117ef7c1880247605875b2115e8
Author: Wang Nan
AuthorDate: Sat, 26 Nov 2016 07:03:31 +
Committer: Arnaldo Carvalho de Melo
CommitDate: Mon, 5 Dec 2016 15:51:42 -0300
tools build: Add
Commit-ID: c7fb4f62e2a97bd25d555263ef501fe053edcbb6
Gitweb: http://git.kernel.org/tip/c7fb4f62e2a97bd25d555263ef501fe053edcbb6
Author: Wang Nan
AuthorDate: Sat, 26 Nov 2016 07:03:32 +
Committer: Arnaldo Carvalho de Melo
CommitDate: Mon, 5 Dec 2016 15:51:43 -0300
tools build: Add
Commit-ID: 2bd42de0e196f89994cbae1990d2c7c5a9b6a529
Gitweb: http://git.kernel.org/tip/2bd42de0e196f89994cbae1990d2c7c5a9b6a529
Author: Wang Nan
AuthorDate: Sat, 26 Nov 2016 07:03:30 +
Committer: Arnaldo Carvalho de Melo
CommitDate: Mon, 5 Dec 2016 15:51:42 -0300
perf llvm: Extract
Commit-ID: 8ad85e9e6fdaf996bf3ff60303ea00e696bcdd36
Gitweb: http://git.kernel.org/tip/8ad85e9e6fdaf996bf3ff60303ea00e696bcdd36
Author: Wang Nan
AuthorDate: Sat, 26 Nov 2016 07:03:29 +
Committer: Arnaldo Carvalho de Melo
CommitDate: Mon, 5 Dec 2016 15:51:42 -0300
perf tools: Pass
ff-by: Wang Nan
Cc: Alexei Starovoitov
Cc: Arnaldo Carvalho de Melo
Cc: He Kuang
Cc: Jiri Olsa
Cc: Joe Stringer
Cc: Zefan Li
Cc: pi3or...@163.com
---
tools/build/feature/Makefile | 8 ++--
tools/build/feature/test-llvm-version.cpp | 11 +++
tools/build/feature
iled: -95, try external compiler
I.e. it falls back to using the external compiler.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc: He Kuang
Cc: Jiri Olsa
Cc: Zefan Li
Cc: pi3or...@163.com
---
tools/perf/util/c++/clang.cpp | 105 +++
Follow Alexei's suggestion, remove "-ferror-limit=19",
"-fmessage-length=127", "-vectorize-loops" and "-vectorize-slp"
clang options: they are meaningless. Add comment for
"-Wno-unused-value" and "-Wno-pointer-sign".
Signed-off-b
upport dynamic linking LLVM and clang libraries.
4. Rebase to Arnaldo's newest perf/core.
Wang Nan (18):
perf build: Check LLVM version in feature check
perf build: Support dynamic linking clang libraries
perf clang: Cleanup clang options
perf clang: Pass full path to builtin clang
If clang changes its working directory, relative path passed to
perf_clang__compile_bpf() becomes invalid. Before running clang,
convert it to absolute path so file can be found even working directory
is changed.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc
969M /home/wn/perf
$ strip ~/perf
$ ls -sh ~/perf
52M /home/wn/perf
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc: He Kuang
Cc: Jiri Olsa
Cc: Zefan Li
Cc: pi3or...@163.com
---
tools/perf/Makefile.perf | 20 ++--
1 file changed, 18 insert
ff-by: Wang Nan
Cc: Alexei Starovoitov
Cc: Arnaldo Carvalho de Melo
Cc: He Kuang
Cc: Jiri Olsa
Cc: Joe Stringer
Cc: Zefan Li
Cc: pi3or...@163.com
---
tools/build/feature/Makefile | 8 ++--
tools/build/feature/test-llvm-version.cpp | 12
tools/build/feature
like this so they won't be compiled
into BPF objects.
Signed-off-by: Wang Nan
Acked-by: Alexei Starovoitov
Cc: Arnaldo Carvalho de Melo
Cc: He Kuang
Cc: Jiri Olsa
Cc: Zefan Li
Cc: pi3or...@163.com
---
tools/perf/util/c++/clang.cpp | 38 ++
to
Automatically include some commonly used macros and struct definitions
into BPF scripts. Script writers are no longer required to define
'SEC' and 'struct bpf_map_def' in each of their scripts.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc
***/
$ perf record -e ./test.c sleep 1
Welcom to perf record
[ perf record: Woken up 1 times to write data ]
Goodbye, perf record
[ perf record: Captured and wrote 0.014 MB perf.data ]
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Append declarations of helpers to default include file. All functions
appear in exported_funcs array should be declared here except
test__clang_callback, because it is used for perf test only.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc: He Kuang
Cc: Jiri
After this patch perf hooks can retrive pid of perf itself by calling
getpid. It is important for excluding event from perf.
This commit is also an example to show how to export more helpers to
hooked script.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc: He
During jitting, find the lowest address in maps section and store its
value to _map_base. Pass its value out through perf_clang__compile_bpf().
map_base is useful for jitted functions accessing BPF maps.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc: He Kuang
bpf__map_fd() is introduced to retrive fd of a BPF map through its
offset in BPF object. This function is going be used in further
commits which allow scripts jitted by builtin clang access BPF maps.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc: He Kuang
Cc
Use PerfModule wrap llvm::Module and return perf::PerfModule in APIs to
replace llvm::Module. Following commits are going to add new functions
to PerfModule.
getBPFObjectFromModule is merged to a method of perf::PerfModule.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei
hook functions right after jitted because bpf_object is unavailable
during jitting but it should be the context of jitted functions.
Signed-off-by: Wang Nan
Acked-by: Alexei Starovoitov
Cc: Arnaldo Carvalho de Melo
Cc: He Kuang
Cc: Jiri Olsa
Cc: Zefan Li
Cc: pi3or...@163.com
---
tools
After this patch functions attached on perf hooks is allowed to invoke
external functions. Add a testcase for this feature.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc: He Kuang
Cc: Jiri Olsa
Cc: Zefan Li
Cc: pi3or...@163.com
---
tools/perf/tests/Build
can be automatically defined, and keep
undefined when using external clang. Passing a
-UBUILTIN_CLANG_DEFAULT_INCLUDE to cancel this defaudefinition.
Test cases are updated to avoid redefinition of these functions.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc: He
e);
printf("Goodbye, perf record, value=%d\n", value);
}
char _license[] SEC("license") = "GPL";
int _version SEC("version") = LINUX_VERSION_CODE;
/***/
$ sudo perf record -e ./test.c echo Hehe
Welcom to perf record
Hehe
[ perf record: Woken up 1 t
wever, that script is fragile so not included by this commit.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc: He Kuang
Cc: Jiri Olsa
Cc: Zefan Li
Cc: pi3or...@163.com
---
tools/perf/util/c++/Build| 1 +
tools/perf/util/c++/bpf-funcs-str.c
Commit-ID: 5a6acad17d2e81765dd4c2fce7346a6f045eab25
Gitweb: http://git.kernel.org/tip/5a6acad17d2e81765dd4c2fce7346a6f045eab25
Author: Wang Nan
AuthorDate: Sat, 26 Nov 2016 07:03:27 +
Committer: Arnaldo Carvalho de Melo
CommitDate: Tue, 29 Nov 2016 12:10:19 -0300
tools lib bpf
Commit-ID: a074865e60edd762b99ec5dacec69b406f702e66
Gitweb: http://git.kernel.org/tip/a074865e60edd762b99ec5dacec69b406f702e66
Author: Wang Nan
AuthorDate: Sat, 26 Nov 2016 07:03:28 +
Committer: Arnaldo Carvalho de Melo
CommitDate: Tue, 29 Nov 2016 12:13:27 -0300
perf tools
Commit-ID: 9742da0150788e6ea7796372c3e643f876a49741
Gitweb: http://git.kernel.org/tip/9742da0150788e6ea7796372c3e643f876a49741
Author: Wang Nan
AuthorDate: Sat, 26 Nov 2016 07:03:25 +
Committer: Arnaldo Carvalho de Melo
CommitDate: Tue, 29 Nov 2016 12:09:36 -0300
tools lib bpf
Commit-ID: 10931d2413478239bdceac5546cce85d7a497a4e
Gitweb: http://git.kernel.org/tip/10931d2413478239bdceac5546cce85d7a497a4e
Author: Wang Nan
AuthorDate: Sat, 26 Nov 2016 07:03:26 +
Committer: Arnaldo Carvalho de Melo
CommitDate: Tue, 29 Nov 2016 12:09:41 -0300
tools lib bpf
wever, that script is fragile so not included by this commit.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc: He Kuang
Cc: Jiri Olsa
Cc: Zefan Li
Cc: pi3or...@163.com
---
tools/perf/util/c++/Build| 1 +
tools/perf/util/c++/bpf-funcs-str.c
ipt-example.c >> ./test.c
$ ./perf record -v --dry-run -e ./test.c 2>&1 | grep builtin
bpf: builtin compiling successful
Can't pass cflags so unable to include kernel headers now. Will be fixed
by following commits.
Signed-off-by: Wang Nan
Cc: Alexei Starovoitov
Cc: He Kuang
-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 293 count: 2
syscall 8 count: 7
syscall 11count: 763
syscall 4 count: 43
syscall 21count: 48
***/
$ perf record -e ./test.c sleep 1
Welcom to perf record
[ perf record: Woken up 1 times to write data ]
Goodbye, perf record
[ perf record: Captured and wrote 0.014 MB perf.data ]
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
d new clang breaking libraries ordering, use
--start-group and --end-group.
In this test case, manually identify required clang libs and hope it to
be stable. Putting all clang libraries here is possible (use make's
wildcard), but then feature checking becomes very slow.
Signed-off-by: Wang Na
Pass a pointer to perf hook functions so they receive context
information created durnig setup.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc: He Kuang
Cc: Jiri Olsa
Cc: Zefan Li
Cc: pi3or...@163.com
---
tools/perf/tests/perf-hooks.c | 14
: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc: He Kuang
Cc: Jiri Olsa
Cc: Zefan Li
Cc: pi3or...@163.com
---
tools/perf/tests/Build | 1 +
tools/perf/tests/builtin-test.c| 9
tools/perf/tests/clang.c | 42 +
tools/perf/tests
e);
printf("Goodbye, perf record, value=%d\n", value);
}
char _license[] SEC("license") = "GPL";
int _version SEC("version") = LINUX_VERSION_CODE;
/***/
$ sudo perf record -e ./test.c echo Hehe
Welcom to perf record
Hehe
[ perf record: Woken up 1 time
Append declarations of helpers to default include file. All functions
appear in exported_funcs array should be declared here except
test__clang_callback, because it is used for perf test only.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc: He Kuang
Cc: Jiri
Use PerfModule wrap llvm::Module and return perf::PerfModule in APIs to
replace llvm::Module. Following commits are going to add new functions
to PerfModule.
getBPFObjectFromModule is merged to a method of perf::PerfModule.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei
Improve getModuleFromSource() API to accept a cflags list. This feature
will be used to pass LINUX_VERSION_CODE and -I flags.
Signed-off-by: Wang Nan
Cc: Alexei Starovoitov
Cc: He Kuang
Cc: Jiri Olsa
Cc: Zefan Li
Cc: pi3or...@163.com
Link:
http://lkml.kernel.org/r/1474874832-134786-9-git
1 - 100 of 2221 matches
Mail list logo