nkage like this so they won't be compiled
into BPF objects.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Alexei Starovoitov <a...@fb.com>
Cc: He Kuang <heku...@huawei.com>
Cc: Jiri Olsa <jo...@kernel.org>
Cc: Zefan Li &
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 <wangn...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Alexei Starovoitov <a...@fb.com>
Cc: He Kuang <heku...
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
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
nkage like this so they won't be compiled
into BPF objects.
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 | 32
tools/perf/util/c++/clan
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
iled: -95, try external compiler
I.e. it falls back to using the external compiler.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Alexei Starovoitov <a...@fb.com>
Cc: He Kuang <heku...@huawei.com>
Cc: Jiri Olsa <jo...@kernel.
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 +++
rectly.
Wang Nan added:
This patch requires a name for each BPF map, so array of BPF maps is
not allowed. This restriction is reasonable, because kernel verifier
forbid indexing BPF map from such array unless the index is a fixed
value, but if the index is fixed why not merging it int
---
tools/perf/util/bpf-loader.c | 37 +
tools/perf/util/bpf-loader.h | 19 +++
2 files changed, 56 insertions(+)
diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c
index 81c6fed..86aa99b 100644
---
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 <wangn...@huawei.com>
Cc: Alexei Starovoitov <a...@fb.com>
Cc: He Kuang <heku...@huawei.com>
Cc: Jiri Olsa <jo...@kernel.or
From: Eric Leblond
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
correctly.
Wang Nan
---
tools/perf/util/bpf-loader.c | 37 +
tools/perf/util/bpf-loader.h | 19 +++
2 files changed, 56 insertions(+)
diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c
index 81c6fed..86aa99b 100644
---
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
uid.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
---
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 aecff69..420ada9 100644
--- a/tools/per
count: 18
syscall 3 count: 11
[ perf record: Captured and wrote 0.011 MB perf.data ]
Eric Leblond (1):
tools lib bpf: fix maps resolution
Wang Nan (33):
perf tools: Fix kernel version error in ubuntu
perf record: Fix segfault when running with suid and kptr_restrict is
1
tool
uid.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
---
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 aecff69..420ada9 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbo
count: 18
syscall 3 count: 11
[ perf record: Captured and wrote 0.011 MB perf.data ]
Eric Leblond (1):
tools lib bpf: fix maps resolution
Wang Nan (33):
perf tools: Fix kernel version error in ubuntu
perf record: Fix segfault when running with suid and kptr_restrict is
1
tool
rectly.
Wang Nan added:
This patch requires a name for each BPF map, so array of BPF maps is
not allowed. This restriction is reasonable, because kernel verifier
forbid indexing BPF map from such array unless the index is a fixed
value, but if the index is fixed why not merging it int
From: Eric Leblond
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
correctly.
Wang Nan
Linux 4.7 (9ecda41acb971ebd07c8fb35faf24005c0baea12) introduces write_backward
attribute to perf_event_attr. Document this feature.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Reviewed-by: Vince Weaver <vincent.wea...@maine.edu>
Cc: Michael Kerrisk <mtk.manpa...@gmail
Linux 4.7 (9ecda41acb971ebd07c8fb35faf24005c0baea12) introduces write_backward
attribute to perf_event_attr. Document this feature.
Signed-off-by: Wang Nan
Reviewed-by: Vince Weaver
Cc: Michael Kerrisk
---
man2/perf_event_open.2 | 57 --
1 file
Linux 4.7 (86e7972f690c1017fd086cdfe53d8524e68c661c) introduces
PERF_EVENT_IOC_PAUSE_OUTPUT feature. Document it.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Reviewed-by: Vince Weaver <vincent.wea...@maine.edu>
Cc: Michael Kerrisk <mtk.manpa...@gmail.com>
---
man2/perf
Decribe PERF_EVENT_IOC_PAUSE_OUTPUT and write_backward in man pages.
v2 -> v3:
Correct words.
Explain the relationship between readonly ring buffer and
over-writable ring buffer in patch 1/2.
Wang Nan (2):
perf_event_open.2: Document PERF_EVENT_IOC_PAUSE_OUTPUT
perf_event_ope
Decribe PERF_EVENT_IOC_PAUSE_OUTPUT and write_backward in man pages.
v2 -> v3:
Correct words.
Explain the relationship between readonly ring buffer and
over-writable ring buffer in patch 1/2.
Wang Nan (2):
perf_event_open.2: Document PERF_EVENT_IOC_PAUSE_OUTPUT
perf_event_ope
Linux 4.7 (86e7972f690c1017fd086cdfe53d8524e68c661c) introduces
PERF_EVENT_IOC_PAUSE_OUTPUT feature. Document it.
Signed-off-by: Wang Nan
Reviewed-by: Vince Weaver
Cc: Michael Kerrisk
---
man2/perf_event_open.2 | 24
1 file changed, 24 insertions(+)
diff --git a/man2
Linux 4.7 (86e7972f690c1017fd086cdfe53d8524e68c661c) introduces
PERF_EVENT_IOC_PAUSE_OUTPUT feature. Document it.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Cc: Michael Kerrisk <mtk.manpa...@gmail.com>
---
man2/perf_event_open.2 | 13 -
1 file changed, 12 insertions(+)
Linux 4.7 (9ecda41acb971ebd07c8fb35faf24005c0baea12) introduces write_backward
attribute to perf_event_attr. Document this feature.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Cc: Michael Kerrisk <mtk.manpa...@gmail.com>
---
man2/perf_event
Linux 4.7 (86e7972f690c1017fd086cdfe53d8524e68c661c) introduces
PERF_EVENT_IOC_PAUSE_OUTPUT feature. Document it.
Signed-off-by: Wang Nan
Cc: Michael Kerrisk
---
man2/perf_event_open.2 | 13 -
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/man2/perf_event_open.2 b
Linux 4.7 (9ecda41acb971ebd07c8fb35faf24005c0baea12) introduces write_backward
attribute to perf_event_attr. Document this feature.
Signed-off-by: Wang Nan
Cc: Michael Kerrisk
---
man2/perf_event_open.2 | 56 +++---
1 file changed, 53 insertions
Commit-ID: 2d470b62fa24f8d0024e8d392d28814c287ee1f1
Gitweb: http://git.kernel.org/tip/2d470b62fa24f8d0024e8d392d28814c287ee1f1
Author: Wang Nan <wangn...@huawei.com>
AuthorDate: Sat, 8 Oct 2016 04:16:25 +
Committer: Arnaldo Carvalho de Melo <a...@redhat.com>
CommitDate:
Commit-ID: 2d470b62fa24f8d0024e8d392d28814c287ee1f1
Gitweb: http://git.kernel.org/tip/2d470b62fa24f8d0024e8d392d28814c287ee1f1
Author: Wang Nan
AuthorDate: Sat, 8 Oct 2016 04:16:25 +
Committer: Arnaldo Carvalho de Melo
CommitDate: Mon, 17 Oct 2016 11:24:18 -0300
perf jevents
-I 1000
ERROR: problems with path aaa.c: No such file or directory
event syntax error: '{cycles,aaa.c}'
(as expected, interperted as BPF source)
Signed-off-by: Wang Nan <wangn...@huawei.com>
Cc: Sukadev Bhattiprolu <suka...@linux.vnet.ibm.com>
Cc: Andi Kleen <a...@linux.inte
-I 1000
ERROR: problems with path aaa.c: No such file or directory
event syntax error: '{cycles,aaa.c}'
(as expected, interperted as BPF source)
Signed-off-by: Wang Nan
Cc: Sukadev Bhattiprolu
Cc: Andi Kleen
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
---
tools/perf/util/parse-events.l
Commit-ID: f61bdc3304281e9ff9eec4f1ed9fb15bcf4d8a5e
Gitweb: http://git.kernel.org/tip/f61bdc3304281e9ff9eec4f1ed9fb15bcf4d8a5e
Author: Wang Nan <wangn...@huawei.com>
AuthorDate: Mon, 26 Sep 2016 07:26:55 +
Committer: Arnaldo Carvalho de Melo <a...@redhat.com>
CommitDate
Commit-ID: f61bdc3304281e9ff9eec4f1ed9fb15bcf4d8a5e
Gitweb: http://git.kernel.org/tip/f61bdc3304281e9ff9eec4f1ed9fb15bcf4d8a5e
Author: Wang Nan
AuthorDate: Mon, 26 Sep 2016 07:26:55 +
Committer: Arnaldo Carvalho de Melo
CommitDate: Wed, 5 Oct 2016 19:58:51 -0300
tools build
Commit-ID: 87095f7ddeff3038a0cf8e6574922f9c11688619
Gitweb: http://git.kernel.org/tip/87095f7ddeff3038a0cf8e6574922f9c11688619
Author: Wang Nan <wangn...@huawei.com>
AuthorDate: Mon, 26 Sep 2016 07:26:56 +
Committer: Arnaldo Carvalho de Melo <a...@redhat.com>
CommitDate
Commit-ID: 87095f7ddeff3038a0cf8e6574922f9c11688619
Gitweb: http://git.kernel.org/tip/87095f7ddeff3038a0cf8e6574922f9c11688619
Author: Wang Nan
AuthorDate: Mon, 26 Sep 2016 07:26:56 +
Committer: Arnaldo Carvalho de Melo
CommitDate: Wed, 5 Oct 2016 19:59:35 -0300
tools build: Add
Commit-ID: f2c8852e6e990fcab0d9e68de9d86e5fbea0b5dc
Gitweb: http://git.kernel.org/tip/f2c8852e6e990fcab0d9e68de9d86e5fbea0b5dc
Author: Wang Nan <wangn...@huawei.com>
AuthorDate: Wed, 28 Sep 2016 03:58:46 +
Committer: Arnaldo Carvalho de Melo <a...@redhat.com>
CommitDate:
Commit-ID: f2c8852e6e990fcab0d9e68de9d86e5fbea0b5dc
Gitweb: http://git.kernel.org/tip/f2c8852e6e990fcab0d9e68de9d86e5fbea0b5dc
Author: Wang Nan
AuthorDate: Wed, 28 Sep 2016 03:58:46 +
Committer: Arnaldo Carvalho de Melo
CommitDate: Wed, 28 Sep 2016 10:38:20 -0300
perf data: Fix
as errors
Fix it by changing %lu to %zu.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Jiri Olsa <jo...@kernel.org>
---
tools/perf/util/data-convert-bt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf
as errors
Fix it by changing %lu to %zu.
Signed-off-by: Wang Nan
Cc: Arnaldo Carvalho de Melo
Cc: Jiri Olsa
---
tools/perf/util/data-convert-bt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/data-convert-bt.c
b/tools/perf/util/data-convert-bt.c
index 4f979bb
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 <wangn...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Alexei Starovoitov <a...@fb.com>
Cc: He Kuang <heku...@huawei.com>
Cc: Jir
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
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
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 <wangn...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Alexei
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 <wangn...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@r
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 Starovoitov
Cc: He Kuang
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
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 <wangn...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Alexei Starovoitov <a...@fb.com>
Cc: He Kuang <heku...
e.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 <wangn...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a.
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 <wangn...@huawei.com>
Cc: Arnaldo Carvalho d
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 <wangn...@huawei.com>
Cc: A
ls 2>&1 |
grep built
bpf: builtin compiling successful
Signed-off-by: Wang Nan <wangn...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Alexei Starovoitov <a...@fb.com>
Cc: He Kuang <heku...@huawei.com>
Cc: Jiri Olsa <jo...@kernel.org>
---
t
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
e.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 Starovoitov
Cc: He
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 Carvalho de Melo
Cc
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.
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 <wangn...@huawei.com>
Cc: Arnaldo Carvalho d
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 <wangn...@huawei.com&
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 <wangn...@huawei.com>
Cc: A
ww.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 detection for g++
perf
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 <wangn...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Alexei Starovoitov <a...@plumg
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 <wangn...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redha
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 Carvalho de
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 Melo
Cc
ww.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 detection for g++
perf
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
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: He Kuang
Cc: Jiri
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 <wangn...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
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 Kuang
Cc: Jiri Olsa
enough.
Old LLVM doesn't support BPF backend.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Alexei Starovoitov <a...@fb.com>
Cc: He Kuang <heku...@huawei.com>
Cc: Jiri Olsa <jo...@kernel.org>
---
tools/build/feature/Mak
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 Nan <wangn...@huawei.
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 changed, 16 insertions(+)
create mode
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 Nan
Cc: Arnaldo Carvalho
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 <wangn...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Alexei Starovoitov <a...@fb.com>
Cc: He Kuang <h
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
enough.
Old LLVM doesn't support BPF backend.
Signed-off-by: Wang Nan <wangn...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Alexei Starovoitov <a...@fb.com>
Cc: He Kuang <heku...@huawei.com>
Cc: Jiri Olsa <jo...@kernel.org>
---
tools/build/feature/Mak
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 changed, 16 insertions(+)
create mode
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 <wangn...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Alexei Starovoitov <a...@fb.com>
Cc: He Kuang <h
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 <wangn...@huawei.com>
Cc: A
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
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 Melo
Cc
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
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 Nan <wangn...@huawei.
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 <wangn...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Alexei Starovoitov <a...@fb.com>
Cc: He Kuang <heku...
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 <wangn...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Alexei Starovoitov <a...@plumg
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 <wangn...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@r
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 <wangn...@huawei.com>
Cc: Arnaldo Carvalho de Melo <a...@redhat.com>
Cc: Alexei Starovoitov <a...@fb.com>
Cc: He Kuang <heku...@huawei.com>
Cc: Jir
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 <wangn...@huawei.com>
Cc: Arnaldo Carvalho d
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 Starovoitov
Cc: He Kuang
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
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:
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 Nan
Cc: Arnaldo Carvalho
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
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
301 - 400 of 5282 matches
Mail list logo