perf llvm: Extract helpers in llvm-utils.c
authorWang Nan <wangnan0@huawei.com>
Sat, 26 Nov 2016 07:03:30 +0000 (07:03 +0000)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 5 Dec 2016 18:51:42 +0000 (15:51 -0300)
commit2bd42de0e196f89994cbae1990d2c7c5a9b6a529
tree38f5ca69a0cd1f64eb89715d6a1933eb5c63ee6c
parent8ad85e9e6fdaf996bf3ff60303ea00e696bcdd36
perf llvm: Extract helpers in llvm-utils.c

The following commits will use builtin clang to compile BPF scripts.

llvm__get_kbuild_opts() and llvm__get_nr_cpus() are extracted to help
building '-DKERNEL_VERSION_CODE' and '-D__NR_CPUS__' macros.

Doing object dumping in bpf loader, so further builtin clang compiling
needn't consider it.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Joe Stringer <joe@ovn.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/20161126070354.141764-7-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/bpf-loader.c
tools/perf/util/llvm-utils.c
tools/perf/util/llvm-utils.h