Hi, everyone.
I have a question regarding to select system call's code. In
do_select() function, after check each fd in the set, do_select() call
cond_resched(). That line, according to my view, is to reduce the
system freeze time when do the busy querying. But before the call,
when entering into t
and euid.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
---
tools/perf/util/symbol.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 19c9c55..9528702 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/
and euid.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
---
Resend with a meanless blank like removed.
---
tools/perf/util/symbol.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 19c9c55..c55e781 100644
--- a/tools/p
ward.
[1] http://lkml.kernel.org/r/20160616214724.gi13...@kernel.org
Signed-off-by: Wang Nan
Signed-off-by: Arnaldo Carvalho de Melo
Cc: He Kuang
Cc: Jiri Olsa
Cc: Masami Hiramatsu
Cc: Namhyung Kim
Cc: Zefan Li
Cc: pi3or...@163.com
---
tools/perf/util/evsel.c | 23 ++-
1 file chan
]
Signed-off-by: Wang Nan
Signed-off-by: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
Cc: Masami Hiramatsu
Cc: Namhyung Kim
Cc: Zefan Li
Cc: pi3or...@163.com
---
tools/perf/util/session.c | 22 +++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/
, enable_on_exec: 1, task: 1,
sample_id_all: 1, exclude_guest: 1, mmap2: 1, comm_exec: 1, write_backward: 1
# Tip: use 'perf evlist --trace-fields' to show fields for tracepoint events
Signed-off-by: Wang Nan
Signed-off-by: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
state to help us recording what we have done
to the ring buffer.
Signed-off-by: Wang Nan
Signed-off-by: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
Cc: Masami Hiramatsu
Cc: Namhyung Kim
Cc: Zefan Li
Cc: pi3or...@163.com
---
tools/perf/builti
s empty. However this is a cheaper choice. To
complete solve this problem we need to continously output non-sample
events. To satisify the requirement of daemonization, we need to merge
them periodically. It is possible but requires much more code and cycles.
Automatically select --tail-synthesize whe
creating aux evlist from another
aux evlist.
Improve perf_evlist__munmap_filtered(), so when recording, if an event
is terminated, unmap mmaps, from parent and children.
Signed-off-by: Wang Nan
Cc: He Kuang
Cc: Jiri Olsa
Cc: Masami Hiramatsu
Cc: Namhyung Kim
Cc: Zefan Li
Cc: pi3or...@163.com
-
Improve test backward-ring-buffer, trace both enter and exit event of
prctl() syscall, utilize auxiliary evlist to mmap enter and exit event
into separated mmaps.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
Cc: Masami Hiramatsu
Cc: Namhyung Kim
Cc: Zefan Li
Cc: He
an event goes to either rec->evlist or
rec->overwrite_evlist.
Signed-off-by: Wang Nan
Cc: He Kuang
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
Cc: Masami Hiramatsu
Cc: Namhyung Kim
Cc: Zefan Li
Cc: pi3or...@163.com
---
tools/perf/builtin-record.c | 132 +++
v5 -> v6: Improve filter pollfd related code.
v6 -> v7: Rebase to newest perf/core.
v7 -> v8: Unmap mmaps from parent and children in
perf_evlist__munmap_filtered(), hide more detail of aux evlist.
Add --tail-synthesize, do synthesize at the end of perf.data.
Wang N
Add new rule to compile .cpp file to .o use g++. C++ support is
required for built-in clang and LLVM support.
Linker side support will be introduced by following commits.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc: He Kuang
Cc: Jiri Olsa
---
tools/build
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: Arnaldo Carvalho de Melo
Cc: Alexei Star
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 utils/c++/clang-test.cpp
in c++ and exports C interface to perf test subsystem.
Signed-off-by: Wang Nan
Cc
Following commits will use builtin clang to compile BPF script.
llvm__get_kbuild_opts() is extracted to help it detect kbuild dir
and include options.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc: He Kuang
Cc: Jiri Olsa
---
tools/perf/util/llvm-utils.c | 44
test clang'. Patch 11 - 14 fixes missing
features like kbuild detection and some default macros.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc: He Kuang
Cc: Jiri Olsa
Wang Nan (14):
tools build: Support compiling C++ source file
perf tools: Add feature
Check if g++ is available. The result will be used by builtin clang and
LLVM support. Since LLVM requires C++11, this feature detector checks
std::move().
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc: He Kuang
Cc: Jiri Olsa
---
tools/build/Makefile.feature
Utilize clang's OverlayFileSystem facility to enable VFS passed to
CompilerInstance can access files in real file system, so '#include'
directive can be used. Add a new getModuleFromSource for real file.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoito
Allow C++ code to use util.h and tests/llvm.h. Let perf test
to compile a real BPF script.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc: He Kuang
Cc: Jiri Olsa
---
tools/perf/Makefile.config | 27 +++
tools/perf/tests/llvm
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: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc: He Kuang
Cc: Jiri Olsa
---
tools/perf/util/c++/clang-test.cpp | 5 +++--
tools/perf
Pass CFLAGS detected by kbuild detector to builtin clang so BPF scripts
can use kernel headers like external clang compiler.
Test:
# perf record --dry-run -e tools/perf/tests/bpf-script-test-kbuild.c ls 2>&1 |
grep built
bpf: builtin compiling successful
Signed-off-by: Wang Nan
Cc:
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
getBPFObjectFromModule() is introduced to use LLVM to convert Module
(LLVM IR) to BPF object code. Add new testcase for it.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc: He Kuang
Cc: Jiri Olsa
---
tools/perf/tests/clang.c | 6 -
tools/perf
Add necessary c++ flags and link libraries to support builtin clang
and LLVM. Add all llvm and clang libraries, so don't need to worry
about clang changes its libraries setting. However, linking perf
would take much longer than usual.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Mel
If clang changes its working directory, filename 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 different.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc: He
rement that LLVM should be new enough.
Old LLVM doesn't support BPF backend.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc: He Kuang
Cc: Jiri Olsa
---
tools/build/feature/Makefile | 8
tools/build/feature/test-llvm.cpp | 8
2 files cha
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: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc: He Kuang
Cc: Jiri Olsa
---
tools/perf/util/c++/clang-test.cpp | 5 +++--
tools/perf
rement that LLVM should be new enough.
Old LLVM doesn't support BPF backend.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc: He Kuang
Cc: Jiri Olsa
---
tools/build/feature/Makefile | 8
tools/build/feature/test-llvm.cpp | 8
2 files cha
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
By this macro BPF script knows what compiler it is being built with.
Scripts prefer external clang can force fall back to it by:
#ifdef PERF_BUILTIN_CLANG
# error I prefer external clang compiler
#endif
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc: He
Use a shell script to generate BPF functions declarations from kernel
source code, embedded the generated header into a C string. Following
commits will utilizes clang's virtual file system to automatically
include this header to all BPF scripts.
Signed-off-by: Wang Nan
Cc: Arnaldo Carval
Add necessary c++ flags and link libraries to support builtin clang
and LLVM. Add all llvm and clang libraries, so don't need to worry
about clang changes its libraries setting. However, linking perf
would take much longer than usual.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Mel
und at:
https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1238358.html
(should be
http://lkml.kernel.org/g/1474635001-153850-1-git-send-email-wangn...@huawei.com
but the link is broken)
Wang Nan (18):
tools build: Support compiling C++ source file
perf tools: Add feature detec
Automatically include common 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: He
Check if g++ is available. The result will be used by builtin clang and
LLVM support. Since LLVM requires C++11, this feature detector checks
std::move().
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc: He Kuang
Cc: Jiri Olsa
---
tools/build/Makefile.feature
getBPFObjectFromModule() is introduced to use LLVM to convert Module
(LLVM IR) to BPF object code. Add new testcase for it.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc: He Kuang
Cc: Jiri Olsa
---
tools/perf/tests/clang.c | 6 -
tools/perf
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: Arnaldo Carvalho de Melo
Cc: Alexei Star
Following commits will use builtin clang to compile BPF script.
llvm__get_kbuild_opts() and llvm__get_nr_cpus() are extracted to help
building '-DKERNEL_VERSION_CODE' and '-D__NR_CPUS__' macros.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc
If clang changes its working directory, filename 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: He
Use Clang's OverlayFileSystem, add '-include' options to make builtin
clang define BPF functions. After this patch BPF script writer needn't
define BPF functions by their own.
Test cases are updated to avoid redefine these functions.
Signed-off-by: Wang Nan
Cc: Arnaldo
ls 2>&1 |
grep built
bpf: builtin compiling successful
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc: He Kuang
Cc: Jiri Olsa
---
tools/perf/util/c++/clang.cpp| 105 +--
tools/perf/util/llvm-utils-cxx.
Add new rule to compile .cpp file to .o use g++. C++ support is
required for built-in clang and LLVM support.
Linker side support will be introduced by following commits.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc: He Kuang
Cc: Jiri Olsa
---
tools/build
Utilize clang's OverlayFileSystem facility to enable VFS passed to
CompilerInstance can access files in real file system, so '#include'
directive can be used. Add a new getModuleFromSource for real file.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoito
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 utils/c++/clang-test.cpp
in c++ and exports C interface to perf test subsystem.
Signed-off-by: Wang Nan
Cc
Allow C++ code to use util.h and tests/llvm.h. Let perf test
to compile a real BPF script.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc: He Kuang
Cc: Jiri Olsa
---
tools/perf/Makefile.config | 27 +++
tools/perf/tests/llvm
Naveen reports a building failure on powerpc because powerpc doesn't
define MMAP_32BIT. Fix it by ensure all macros required by perf is
defined.
Wang Nan (2):
perf trace beauty mmap: Add missing MADV_FREE
tools include: Add mman macros needed by perf for all arch
tools/arch/alpha/in
tools/perf/trace/beauty/mmap.c forgets to check MADV_FREE.
This patch fixes it.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Naveen N. Rao
---
tools/perf/trace/beauty/mmap.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/perf/trace/beauty/mmap.c b/tools/perf/trace
MADV_SEQUENTIAL
MADV_SOFT_OFFLINE
MADV_UNMERGEABLE
MADV_WILLNEED
MAP_32BIT
MAP_ANONYMOUS
MAP_DENYWRITE
MAP_EXECUTABLE
MAP_FILE
MAP_FIXED
MAP_GROWSDOWN
MAP_HUGETLB
MAP_LOCKED
MAP_NONBLOCK
MAP_NORESERVE
MAP_POPULATE
MAP_PRIVATE
MAP_SHARED
MAP_STACK
MAP_UNINITIALIZED
MREMAP_FIXED
MR
Detect hugetlbfs. hugetlbfs__mountpoint() will be used during recording
to help recorder identifying hugetlb mmaps: which should be recognized
as anon mapping.
Signed-off-by: Wang Nan
Cc: Hou Pengyang
Cc: He Kuang
Cc: Arnaldo Carvalho de Melo
---
tools/lib/api/fs/fs.c | 15
recognize hugetlbfs mapping as anon mapping.
Before this 3 patches user has no chance to use his/her own .map file
to resolve symbols because perf tries to use hugetlbfs file.
Wang Nan (3):
perf tools: Recognize hugetlb mapping as anon mapping
tools lib api fs: Add hugetlbfs filesystem detec
During synthesizing mmap events, add MAP_HUGETLB map flag if the
source of mapping is file in hugetlbfs.
After this patch, perf can identify hugetlb mapping even if perf
is started after the mapping of huge pages (like perf top).
Signed-off-by: Wang Nan
Cc: Hou Pengyang
Cc: He Kuang
Cc
hugetlb mapping as anon mapping.
Signed-off-by: Wang Nan
Signed-off-by: Hou Pengyang
Cc: He Kuang
Cc: Arnaldo Carvalho de Melo
---
tools/perf/util/map.c | 8 +---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index 728129a
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
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
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
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
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
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
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 ++--
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
: Test BPF prologue (2015-10-08 07:23:33 +)
EBPF support for perf
- Rebase to newest perf/core
- Fix a document problem in Makefile.perf: NO_BPF -> NO_LIBBPF
Signed-off-by: Wang
rf quit through exit() bpf__clear() is still called, so probing
points are cleared.
strerror style error reporting scaffold is created by this patch.
bpf__strerror_probe() is the first error reporting function in bpf-loader.c.
Signed-off-by: Wang Nan
Cc: Alexei Starovoitov
Cc: Brendan Gregg
Cc:
llback should return instructions arrays for each instances.
fd field in bpf_programs is replaced by instance, which has an nr field
and fds array. bpf_program__nth_fd() is introduced for read fd of
instances. Old interface bpf_program__fd() is reimplemented by
returning the first fd.
Signed-off-by: Wang Na
his code to an old kernel.
Error messages are also updated to notify users about the disable of BPF
support of 'perf record' if libelf is missed or BPF API check failed.
tools/lib/bpf is added into TAG_FOLDERS to allow us to navigate on
libbpf files when working on perf using tools/
The 'bpf-loader.[ch]' files are introduced in this patch. Which will be
the interface between perf and libbpf. bpf__prepare_load() resides in
bpf-loader.c. Following patches will enrich these two files.
Signed-off-by: Wang Nan
Signed-off-by: Arnaldo Carvalho de Melo
Acked-by: Alexei S
This patch utilizes bpf_object__load() provided by libbpf to load all
objects into kernel.
Signed-off-by: Wang Nan
Cc: Alexei Starovoitov
Cc: Brendan Gregg
Cc: Daniel Borkmann
Cc: David Ahern
Cc: He Kuang
Cc: Jiri Olsa
Cc: Kaixu Xia
Cc: Masami Hiramatsu
Cc: Namhyung Kim
Cc: Paul
When failure occures in add_probe_trace_event(), args in
probe_trace_event is incomplete. Since information in it may be used
in futher, this patch frees the allocated memory and set it to NULL
to avoid dangling pointer.
Signed-off-by: Wang Nan
Cc: Alexei Starovoitov
Cc: Brendan Gregg
Cc
kbuild testcase to check whether kernel headers can be correctly
found.
For example:
# perf test LLVM
38: Test LLVM searching and compiling:
(llvm.kbuild-dir can be fixed) Ok
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc: Brendan Gregg
-kernel function, and exit value
for eBPF program
* r1 - r5 - arguments from eBPF program to in-kernel function
* r6 - r9 - callee saved registers that in-kernel function will
preserve
* r10 - read-only frame pointer to access stack
Signed-off-by: He
regs_query_register_offset() in dwarf-regs.c is required by BPF prologue.
Make it be compiled if CONFIG_BPF_PROLOGUE is on to avoid building failure
when CONFIG_BPF_PROLOGUE is on but CONFIG_DWARF is not set.
Signed-off-by: Wang Nan
Signed-off-by: He Kuang
Acked-by: Masami Hiramatsu
Cc: Alexei
7;. This patch skips the short
option name and use '--vmlinux' for vmlinux path.
Signed-off-by: He Kuang
Signed-off-by: Wang Nan
Cc: Alexei Starovoitov
Cc: Brendan Gregg
Cc: Daniel Borkmann
Cc: David Ahern
Cc: He Kuang
Cc: Jiri Olsa
Cc: Kaixu Xia
Cc: Masami Hiramatsu
Cc: Nam
This patch utilizes qsort to
sort tevs. After sorting, tevs with identical argument list will be
grouped together.
Signed-off-by: Wang Nan
Cc: Alexei Starovoitov
Cc: Brendan Gregg
Cc: Daniel Borkmann
Cc: David Ahern
Cc: He Kuang
Cc: Jiri Olsa
Cc: Kaixu Xia
Cc: Masami Hiramatsu
Cc: Na
ns.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc: Brendan Gregg
Cc: Daniel Borkmann
Cc: David Ahern
Cc: He Kuang
Cc: Jiri Olsa
Cc: Kaixu Xia
Cc: Masami Hiramatsu
Cc: Namhyung Kim
Cc: Peter Zijlstra
Cc: Zefan Li
Cc: pi3or...@163.com
Link: http://lkml
fore the main config string,
we can use 'key=value' style options. Now the only option key "target"
is for uprobe probing.
Signed-off-by: Wang Nan
Cc: Alexei Starovoitov
Cc: Brendan Gregg
Cc: Daniel Borkmann
Cc: David Ahern
Cc: He Kuang
Cc: Jiri Olsa
Cc: Kaixu Xia
Cc
of a register to its offset in
'struct pt_regs'. Without this support, BPF_PROLOGUE should be turned off.
HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET is introduced as the corresponding
CFLAGS of PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET.
Signed-off-by: Wang Nan
Cc: Alexei Starovoitov
Cc: Bre
.c will not be built if libbpf is turned off, an empty
bpf__foreach_tev() is defined in bpf-loader.h to avoid compiling
error.
Signed-off-by: Wang Nan
Cc: Alexei Starovoitov
Cc: Brendan Gregg
Cc: Daniel Borkmann
Cc: David Ahern
Cc: He Kuang
Cc: Jiri Olsa
Cc: Kaixu Xia
Cc: Masami Hiramat
Although previous patch allows setting BPF compiler related options in
perfconfig, on some ad-hoc situation it still requires passing options
through cmdline. This patch introduces 2 options to 'perf record' for
this propose: --clang-path and --clang-opt.
Signed-off-by: Wang Nan
events are possible to
be extracted, to avoid perf report error because of empty evsel list,
this patch link a dummy evsel. The dummy event related code will be
removed when probing and extracting code is ready.
Signed-off-by: Wang Nan
Cc: Alexei Starovoitov
Cc: Arnaldo Carvalho de Melo
Cc: Brendan
times of it, so the resule should contains 56 samples.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc: Brendan Gregg
Cc: Daniel Borkmann
Cc: David Ahern
Cc: He Kuang
Cc: Jiri Olsa
Cc: Kaixu Xia
Cc: Masami Hiramatsu
Cc: Namhyung Kim
Cc: Peter Zijlstra
Cc:
t:
# perf record --clang-opt "-DLINUX_VERSION_CODE=0x40200" --event
./bpf-script-example.c sleep 1
Note that '--clang-opt' must put before '--event'.
Futher patches will merge it into a testcase so can be tested automatically.
Signed-off-by: Wang Nan
Signed-off-by: He Kuang
Acked-by
7; method to tests, and makes test__llvm()
create a MAP_SHARED memory array to hold the resulting object.
Signed-off-by: He Kuang
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc: Brendan Gregg
Cc: Daniel Borkmann
Cc: David Ahern
Cc: Jiri Olsa
Cc: Kaixu Xia
Cc
r one kprobe
events for different CPUs. In this case, when trying to call the
ioctl, EEXIST will be return. This patch doesn't treat it as an error.
Signed-off-by: Wang Nan
Cc: Alexei Starovoitov
Cc: Brendan Gregg
Cc: Daniel Borkmann
Cc: David Ahern
Cc: He Kuang
Cc: Jiri Olsa
Cc: Kaixu X
rgument, simply skip preprocessor
hooking. For those who prologue is required, calls bpf__gen_prologue()
and paste original instruction after prologue.
Signed-off-by: Wang Nan
Cc: Alexei Starovoitov
Cc: Brendan Gregg
Cc: Daniel Borkmann
Cc: David Ahern
Cc: He Kuang
Cc: Jiri Olsa
Cc: Kaixu Xia
This 4 patches will be appended into my next perf BPF pull request.
Without them, current perf BPF implementation has a small problem that,
if passing '--filter' after '--event test_bpf.o' event selection, the
filter won't be correctly applied.
Patch 1/4 append a new function to libbpf which allow
checking number of entries, check data.list instead, so we
can add dummy evsel here.
[1]:
http://lkml.kernel.org/n/1436445342-1402-19-git-send-email-wangn...@huawei.com
Signed-off-by: Wang Nan
Cc: Alexei Starovoitov
Cc: Masami Hiramatsu
Cc: Namhyung Kim
Cc: Zefan Li
Cc: pi3or...@163.com
Cc
ng is for each object.
API of bpf_object__open_buffer() is changed to allow passing a name.
Fortunately, at this time there's only one user of it (perf test LLVM),
so we change it together.
Signed-off-by: Wang Nan
Cc: Alexei Starovoitov
Cc: Brendan Gregg
Cc: Daniel Borkmann
Cc: David Ahern
Cc: He Kuan
purge_dummy() must be called right after parse_options().
This patch adds it to record, top, trace and stat builtin commands.
Further patch moves it down after real BPF events are processed with.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Alexei Starovoitov
Cc: Brendan Gregg
Cc: Daniel Bor
is appended to evlist.
This patch fixes this by utilizing the dummy event linked during
parse_events(). Filter settings goes to dummy event, and be synced with
real events in add_bpf_event().
Signed-off-by: Wang Nan
Cc: Alexei Starovoitov
Cc: Brendan Gregg
Cc: Daniel Borkmann
Cc: David Aher
:
- Call bpf__clear() in command 'record, top, stat and trace' to ensure
release BPF related resources.
- Correct --filter option when try to apply filter to BPF object.
Signed-off-by: Wang Nan
He Kuang (5):
pe
ng is for each object.
API of bpf_object__open_buffer() is changed to allow passing a name.
Fortunately, at this time there's only one user of it (perf test LLVM),
so we change it together.
Signed-off-by: Wang Nan
Cc: Alexei Starovoitov
Cc: Brendan Gregg
Cc: Daniel Borkmann
Cc: David Ahern
Cc: He Kuan
Commit 7b6ff0bdbf4f7f429c2116cca92a6d171217449e ("perf probe ppc64le:
Fixup function entry if using kallsyms lookup") adds 'struct map' into
probe-event.h but not include "util/map.h" in it. This patch fixes it.
Signed-off-by: Wang Nan
Cc: Alexei Starovoitov
foo.o'
Run 'perf list' for a list of valid events
usage: perf record [] []
or: perf record [] -- []
-e, --eventevent selector. use 'perf list' to list available
events
[root@felicio ~]#
Yes, it does this time around.
Signed-off-by: Wang Nan
register to its offset in 'struct pt_regs'.
Without this support, BPF_PROLOGUE should be turned off.
Signed-off-by: Wang Nan
Cc: Alexei Starovoitov
Cc: Brendan Gregg
Cc: Daniel Borkmann
Cc: David Ahern
Cc: He Kuang
Cc: Jiri Olsa
Cc: Kaixu Xia
Cc: Masami Hiramatsu
Cc: Namhyung Kim
xit value
for eBPF program
* r1 - r5 - arguments from eBPF program to in-kernel function
* r6 - r9 - callee saved registers that in-kernel function will
preserve
* r10 - read-only frame pointer to access stack
Signed-off-by: He Kuang
Signed-off
Ingo Molnar
Cc: Jiri Olsa
Cc: Masami Hiramatsu
Cc: Namhyung Kim
Cc: Peter Zijlstra
Cc: Steven Rostedt
Cc: pi3or...@163.com
Signed-off-by: Wang Nan
Link:
http://lkml.kernel.org/n/1437448130-134621-3-git-send-email-heku...@huawei.com
---
include/trace/events/bpf.h
1 - 100 of 2641 matches
Mail list logo