2016-12-05 03:42:53 +07:00
|
|
|
FILES= \
|
|
|
|
test-all.bin \
|
|
|
|
test-backtrace.bin \
|
|
|
|
test-bionic.bin \
|
|
|
|
test-dwarf.bin \
|
|
|
|
test-dwarf_getlocations.bin \
|
|
|
|
test-fortify-source.bin \
|
|
|
|
test-sync-compare-and-swap.bin \
|
|
|
|
test-glibc.bin \
|
|
|
|
test-gtk2.bin \
|
|
|
|
test-gtk2-infobar.bin \
|
|
|
|
test-hello.bin \
|
|
|
|
test-libaudit.bin \
|
|
|
|
test-libbfd.bin \
|
|
|
|
test-liberty.bin \
|
|
|
|
test-liberty-z.bin \
|
|
|
|
test-cplus-demangle.bin \
|
|
|
|
test-libelf.bin \
|
|
|
|
test-libelf-getphdrnum.bin \
|
|
|
|
test-libelf-gelf_getnote.bin \
|
|
|
|
test-libelf-getshdrstrndx.bin \
|
|
|
|
test-libelf-mmap.bin \
|
|
|
|
test-libnuma.bin \
|
|
|
|
test-numa_num_possible_cpus.bin \
|
|
|
|
test-libperl.bin \
|
|
|
|
test-libpython.bin \
|
|
|
|
test-libpython-version.bin \
|
|
|
|
test-libslang.bin \
|
|
|
|
test-libcrypto.bin \
|
|
|
|
test-libunwind.bin \
|
|
|
|
test-libunwind-debug-frame.bin \
|
|
|
|
test-libunwind-x86.bin \
|
|
|
|
test-libunwind-x86_64.bin \
|
|
|
|
test-libunwind-arm.bin \
|
|
|
|
test-libunwind-aarch64.bin \
|
|
|
|
test-libunwind-debug-frame-arm.bin \
|
|
|
|
test-libunwind-debug-frame-aarch64.bin \
|
|
|
|
test-pthread-attr-setaffinity-np.bin \
|
|
|
|
test-stackprotector-all.bin \
|
|
|
|
test-timerfd.bin \
|
|
|
|
test-libdw-dwarf-unwind.bin \
|
|
|
|
test-libbabeltrace.bin \
|
|
|
|
test-compile-32.bin \
|
|
|
|
test-compile-x32.bin \
|
|
|
|
test-zlib.bin \
|
|
|
|
test-lzma.bin \
|
|
|
|
test-bpf.bin \
|
|
|
|
test-get_cpuid.bin \
|
|
|
|
test-sdt.bin \
|
|
|
|
test-cxx.bin \
|
2017-03-02 22:55:49 +07:00
|
|
|
test-jvmti.bin \
|
|
|
|
test-sched_getcpu.bin
|
2013-09-30 15:08:24 +07:00
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
FILES := $(addprefix $(OUTPUT),$(FILES))
|
|
|
|
|
2017-03-03 02:00:26 +07:00
|
|
|
CC ?= $(CROSS_COMPILE)gcc -MD
|
|
|
|
CXX ?= $(CROSS_COMPILE)g++ -MD
|
2014-01-15 17:44:08 +07:00
|
|
|
PKG_CONFIG := $(CROSS_COMPILE)pkg-config
|
2016-11-26 14:03:31 +07:00
|
|
|
LLVM_CONFIG ?= llvm-config
|
2013-09-30 18:51:28 +07:00
|
|
|
|
2013-09-30 15:08:24 +07:00
|
|
|
all: $(FILES)
|
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
__BUILD = $(CC) $(CFLAGS) -Wall -Werror -o $@ $(patsubst %.bin,%.c,$(@F)) $(LDFLAGS)
|
|
|
|
BUILD = $(__BUILD) > $(@:.bin=.make.output) 2>&1
|
2013-09-30 15:08:24 +07:00
|
|
|
|
2016-09-26 14:26:56 +07:00
|
|
|
__BUILDXX = $(CXX) $(CXXFLAGS) -Wall -Werror -o $@ $(patsubst %.bin,%.cpp,$(@F)) $(LDFLAGS)
|
|
|
|
BUILDXX = $(__BUILDXX) > $(@:.bin=.make.output) 2>&1
|
|
|
|
|
2013-09-30 15:08:24 +07:00
|
|
|
###############################
|
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-all.bin:
|
2015-03-04 17:35:47 +07:00
|
|
|
$(BUILD) -fstack-protector-all -O2 -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -lelf -laudit -I/usr/include/slang -lslang $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null) $(FLAGS_PERL_EMBED) $(FLAGS_PYTHON_EMBED) -DPACKAGE='"perf"' -lbfd -ldl -lz -llzma
|
2013-10-01 19:14:31 +07:00
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-hello.bin:
|
2013-09-30 15:08:24 +07:00
|
|
|
$(BUILD)
|
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-pthread-attr-setaffinity-np.bin:
|
2015-02-28 16:16:27 +07:00
|
|
|
$(BUILD) -D_GNU_SOURCE -lpthread
|
2015-01-13 20:43:24 +07:00
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-stackprotector-all.bin:
|
2015-02-28 16:16:27 +07:00
|
|
|
$(BUILD) -fstack-protector-all
|
2013-09-30 18:48:44 +07:00
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-fortify-source.bin:
|
2015-02-28 16:16:27 +07:00
|
|
|
$(BUILD) -O2 -D_FORTIFY_SOURCE=2
|
2013-10-07 14:38:28 +07:00
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-bionic.bin:
|
2013-09-30 19:11:46 +07:00
|
|
|
$(BUILD)
|
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-libelf.bin:
|
2013-09-30 19:20:25 +07:00
|
|
|
$(BUILD) -lelf
|
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-glibc.bin:
|
2013-10-07 15:34:20 +07:00
|
|
|
$(BUILD)
|
|
|
|
|
2017-03-02 22:55:49 +07:00
|
|
|
$(OUTPUT)test-sched_getcpu.bin:
|
|
|
|
$(BUILD)
|
|
|
|
|
2015-08-13 05:48:37 +07:00
|
|
|
DWARFLIBS := -ldw
|
|
|
|
ifeq ($(findstring -static,${LDFLAGS}),-static)
|
|
|
|
DWARFLIBS += -lelf -lebl -lz -llzma -lbz2
|
|
|
|
endif
|
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-dwarf.bin:
|
2015-08-13 05:48:37 +07:00
|
|
|
$(BUILD) $(DWARFLIBS)
|
2013-10-07 15:35:39 +07:00
|
|
|
|
2016-04-05 21:33:41 +07:00
|
|
|
$(OUTPUT)test-dwarf_getlocations.bin:
|
|
|
|
$(BUILD) $(DWARFLIBS)
|
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-libelf-mmap.bin:
|
2013-09-30 20:02:28 +07:00
|
|
|
$(BUILD) -lelf
|
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-libelf-getphdrnum.bin:
|
2013-09-30 19:35:27 +07:00
|
|
|
$(BUILD) -lelf
|
|
|
|
|
2016-07-12 22:19:09 +07:00
|
|
|
$(OUTPUT)test-libelf-gelf_getnote.bin:
|
|
|
|
$(BUILD) -lelf
|
|
|
|
|
2016-07-05 05:35:47 +07:00
|
|
|
$(OUTPUT)test-libelf-getshdrstrndx.bin:
|
|
|
|
$(BUILD) -lelf
|
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-libnuma.bin:
|
2013-09-30 18:37:10 +07:00
|
|
|
$(BUILD) -lnuma
|
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-numa_num_possible_cpus.bin:
|
2015-09-17 22:20:28 +07:00
|
|
|
$(BUILD) -lnuma
|
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-libunwind.bin:
|
2013-12-10 19:24:04 +07:00
|
|
|
$(BUILD) -lelf
|
2013-09-30 19:45:44 +07:00
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-libunwind-debug-frame.bin:
|
2013-12-10 19:24:04 +07:00
|
|
|
$(BUILD) -lelf
|
2016-05-10 14:40:31 +07:00
|
|
|
$(OUTPUT)test-libunwind-x86.bin:
|
|
|
|
$(BUILD) -lelf -lunwind-x86
|
|
|
|
|
|
|
|
$(OUTPUT)test-libunwind-x86_64.bin:
|
|
|
|
$(BUILD) -lelf -lunwind-x86_64
|
|
|
|
|
|
|
|
$(OUTPUT)test-libunwind-arm.bin:
|
|
|
|
$(BUILD) -lelf -lunwind-arm
|
|
|
|
|
|
|
|
$(OUTPUT)test-libunwind-aarch64.bin:
|
|
|
|
$(BUILD) -lelf -lunwind-aarch64
|
|
|
|
|
2016-05-10 14:40:32 +07:00
|
|
|
$(OUTPUT)test-libunwind-debug-frame-arm.bin:
|
|
|
|
$(BUILD) -lelf -lunwind-arm
|
|
|
|
|
|
|
|
$(OUTPUT)test-libunwind-debug-frame-aarch64.bin:
|
|
|
|
$(BUILD) -lelf -lunwind-aarch64
|
2013-11-14 14:25:24 +07:00
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-libaudit.bin:
|
2013-09-30 19:55:31 +07:00
|
|
|
$(BUILD) -laudit
|
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-libslang.bin:
|
2013-09-30 19:57:54 +07:00
|
|
|
$(BUILD) -I/usr/include/slang -lslang
|
|
|
|
|
2015-11-30 16:02:21 +07:00
|
|
|
$(OUTPUT)test-libcrypto.bin:
|
|
|
|
$(BUILD) -lcrypto
|
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-gtk2.bin:
|
2014-01-15 17:44:08 +07:00
|
|
|
$(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
|
2013-09-30 20:01:56 +07:00
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-gtk2-infobar.bin:
|
2014-01-15 17:44:08 +07:00
|
|
|
$(BUILD) $(shell $(PKG_CONFIG) --libs --cflags gtk+-2.0 2>/dev/null)
|
2013-09-30 20:08:30 +07:00
|
|
|
|
2013-09-30 20:15:36 +07:00
|
|
|
grep-libs = $(filter -l%,$(1))
|
|
|
|
strip-libs = $(filter-out -l%,$(1))
|
|
|
|
|
|
|
|
PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
|
|
|
|
PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
|
|
|
|
PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
|
|
|
|
PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
|
|
|
|
FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
|
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-libperl.bin:
|
2013-09-30 20:15:36 +07:00
|
|
|
$(BUILD) $(FLAGS_PERL_EMBED)
|
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-libpython.bin:
|
2017-04-12 13:49:13 +07:00
|
|
|
$(BUILD) $(FLAGS_PYTHON_EMBED)
|
2013-09-30 20:18:37 +07:00
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-libpython-version.bin:
|
2014-07-29 13:57:19 +07:00
|
|
|
$(BUILD)
|
2013-09-30 20:40:04 +07:00
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-libbfd.bin:
|
2014-01-12 02:42:51 +07:00
|
|
|
$(BUILD) -DPACKAGE='"perf"' -lbfd -lz -liberty -ldl
|
2013-09-30 20:53:31 +07:00
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-liberty.bin:
|
|
|
|
$(CC) $(CFLAGS) -Wall -Werror -o $@ test-libbfd.c -DPACKAGE='"perf"' $(LDFLAGS) -lbfd -ldl -liberty
|
2013-10-02 20:15:09 +07:00
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-liberty-z.bin:
|
|
|
|
$(CC) $(CFLAGS) -Wall -Werror -o $@ test-libbfd.c -DPACKAGE='"perf"' $(LDFLAGS) -lbfd -ldl -liberty -lz
|
2013-10-02 20:15:09 +07:00
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-cplus-demangle.bin:
|
2013-10-02 20:15:09 +07:00
|
|
|
$(BUILD) -liberty
|
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-backtrace.bin:
|
2013-09-30 21:49:38 +07:00
|
|
|
$(BUILD)
|
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-timerfd.bin:
|
2013-10-29 23:43:16 +07:00
|
|
|
$(BUILD)
|
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-libdw-dwarf-unwind.bin:
|
2015-02-21 05:16:58 +07:00
|
|
|
$(BUILD) # -ldw provided by $(FEATURE_CHECK_LDFLAGS-libdw-dwarf-unwind)
|
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-libbabeltrace.bin:
|
2015-02-21 05:16:58 +07:00
|
|
|
$(BUILD) # -lbabeltrace provided by $(FEATURE_CHECK_LDFLAGS-libbabeltrace)
|
2014-02-19 22:52:56 +07:00
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-sync-compare-and-swap.bin:
|
2015-02-28 16:16:27 +07:00
|
|
|
$(BUILD)
|
2014-07-14 17:02:53 +07:00
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-compile-32.bin:
|
|
|
|
$(CC) -m32 -o $@ test-compile.c
|
2014-10-24 04:16:03 +07:00
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-compile-x32.bin:
|
|
|
|
$(CC) -mx32 -o $@ test-compile.c
|
2014-10-24 04:16:03 +07:00
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-zlib.bin:
|
perf tools: Add gzip decompression support for kernel module
Now my Archlinux box shows module symbols correctly.
Before:
$ perf report --stdio
Failed to open /tmp/perf-3477.map, continuing without symbols
no symbols found in /usr/bin/date, maybe install a debug package?
No kallsyms or vmlinux with build-id 7b4ea0a49ae2111925857099aaf05c3246ff33e0 was found
[drm] with build id 7b4ea0a49ae2111925857099aaf05c3246ff33e0 not found, continuing without symbols
No kallsyms or vmlinux with build-id edd931629094b660ca9dec09a1b635c8d87aa2ee was found
[jbd2] with build id edd931629094b660ca9dec09a1b635c8d87aa2ee not found, continuing without symbols
No kallsyms or vmlinux with build-id a7b1eada671c34933e5610bb920b2ca4945a82c3 was found
[ext4] with build id a7b1eada671c34933e5610bb920b2ca4945a82c3 not found, continuing without symbols
No kallsyms or vmlinux with build-id d69511fa3e5840e770336ef45b06c83fef8d74e3 was found
[scsi_mod] with build id d69511fa3e5840e770336ef45b06c83fef8d74e3 not found, continuing without symbols
No kallsyms or vmlinux with build-id af0430af13461af058770ee9b87afc07922c2e77 was found
[libata] with build id af0430af13461af058770ee9b87afc07922c2e77 not found, continuing without symbols
No kallsyms or vmlinux with build-id aaeedff8160ce631a5f0333591c6ff291201d29f was found
[libahci] with build id aaeedff8160ce631a5f0333591c6ff291201d29f not found, continuing without symbols
No kallsyms or vmlinux with build-id c57907712becaf662dc4981824bb372c0441d605 was found
[mac80211] with build id c57907712becaf662dc4981824bb372c0441d605 not found, continuing without symbols
No kallsyms or vmlinux with build-id e0589077cc0ec8c3e4c40eb9f2d9e69d236bee8f was found
[iwldvm] with build id e0589077cc0ec8c3e4c40eb9f2d9e69d236bee8f not found, continuing without symbols
No kallsyms or vmlinux with build-id 2d86086bf136bf374a2f029cf85a48194f9b950b was found
[cfg80211] with build id 2d86086bf136bf374a2f029cf85a48194f9b950b not found, continuing without symbols
No kallsyms or vmlinux with build-id 4493c48599bdb3d91d0f8db5150e0be33fdd9221 was found
[iwlwifi] with build id 4493c48599bdb3d91d0f8db5150e0be33fdd9221 not found, continuing without symbols
...
#
# Overhead Command Shared Object Symbol
# ........ ............... ....................... ........................................................
#
0.03% swapper [ext4] [k] 0x000000000000fe2e
0.03% swapper [kernel.kallsyms] [k] account_entity_enqueue
0.03% swapper [ext4] [k] 0x000000000000fc2b
0.03% irq/50-iwlwifi [iwlwifi] [k] 0x000000000000200b
0.03% swapper [kernel.kallsyms] [k] ktime_add_safe
0.03% swapper [kernel.kallsyms] [k] elv_completed_request
0.03% swapper [libata] [k] 0x0000000000003997
0.03% swapper [libahci] [k] 0x0000000000001f25
0.03% swapper [kernel.kallsyms] [k] rb_next
0.03% swapper [kernel.kallsyms] [k] blk_finish_request
0.03% swapper [ext4] [k] 0x0000000000010248
0.00% perf [kernel.kallsyms] [k] native_write_msr_safe
After:
$ perf report --stdio
Failed to open /tmp/perf-3477.map, continuing without symbols
no symbols found in /usr/bin/tr, maybe install a debug package?
...
#
# Overhead Command Shared Object Symbol
# ........ ............... ........................... ......................................................
#
0.04% kworker/u16:3 [ext4] [k] ext4_read_block_bitmap
0.03% kworker/u16:0 [mac80211] [k] ieee80211_sta_reset_beacon_monitor
0.02% irq/50-iwlwifi [mac80211] [k] ieee80211_get_bssid
0.02% firefox [e1000e] [k] __ew32_prepare
0.02% swapper [libahci] [k] ahci_handle_port_interrupt
0.02% emacs libglib-2.0.so.0.4000.0 [.] g_mutex_unlock
0.02% swapper [e1000e] [k] e1000_clean_tx_irq
0.02% dwm [kernel.kallsyms] [k] __schedule
0.02% gnome-terminal- [vdso] [.] __vdso_clock_gettime
0.02% swapper [e1000e] [k] e1000_alloc_rx_buffers
0.02% irq/50-iwlwifi [mac80211] [k] ieee80211_rx
0.01% firefox [vdso] [.] __vdso_gettimeofday
0.01% irq/50-iwlwifi [iwlwifi] [k] iwl_pcie_rxq_restock.part.13
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/87h9yexshi.fsf@sejong.aot.lge.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2014-10-31 14:51:38 +07:00
|
|
|
$(BUILD) -lz
|
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-lzma.bin:
|
2015-03-04 17:35:47 +07:00
|
|
|
$(BUILD) -llzma
|
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-get_cpuid.bin:
|
2015-09-17 22:54:30 +07:00
|
|
|
$(BUILD)
|
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
$(OUTPUT)test-bpf.bin:
|
bpf tools: Introduce 'bpf' library and add bpf feature check
This is the first patch of libbpf. The goal of libbpf is to create a
standard way for accessing eBPF object files. This patch creates
'Makefile' and 'Build' for it, allows 'make' to build libbpf.a and
libbpf.so, 'make install' to put them into proper directories.
Most part of Makefile is borrowed from traceevent.
Before building, it checks the existence of libelf in Makefile, and deny
to build if not found. Instead of throwing an error if libelf not found,
the error raises in a phony target "elfdep". This design is to ensure
'make clean' still workable even if libelf is not found.
Because libbpf requires 'kern_version' field set for 'union bpf_attr'
(bpfdep" is used for that dependency), Kernel BPF API is also checked
by intruducing a new feature check 'bpf' into tools/build/feature,
which checks the existence and version of linux/bpf.h. When building
libbpf, it searches that file from include/uapi/linux in kernel source
tree (controlled by FEATURE_CHECK_CFLAGS-bpf). Since it searches kernel
source tree it reside, installing of newest kernel headers is not
required, except we are trying to port these files to an old kernel.
To avoid checking that file when perf building, the newly introduced
'bpf' feature check doesn't added into FEATURE_TESTS and
FEATURE_DISPLAY by default in tools/build/Makefile.feature, but added
into libbpf's specific.
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: David Ahern <dsahern@gmail.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kaixu Xia <xiakaixu@huawei.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Zefan Li <lizefan@huawei.com>
Bcc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1435716878-189507-4-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-07-01 09:13:51 +07:00
|
|
|
$(BUILD)
|
|
|
|
|
2016-07-12 17:05:56 +07:00
|
|
|
$(OUTPUT)test-sdt.bin:
|
|
|
|
$(BUILD)
|
|
|
|
|
2016-09-26 14:26:56 +07:00
|
|
|
$(OUTPUT)test-cxx.bin:
|
|
|
|
$(BUILDXX) -std=gnu++11
|
|
|
|
|
2016-11-02 20:35:48 +07:00
|
|
|
$(OUTPUT)test-jvmti.bin:
|
|
|
|
$(BUILD)
|
|
|
|
|
2016-11-26 14:03:31 +07:00
|
|
|
$(OUTPUT)test-llvm.bin:
|
perf build: Check LLVM version in feature check
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 environment is not tested yet.
Committer Notes:
Testing it:
Environment:
$ cat /etc/fedora-release
Fedora release 25 (Twenty Five)
$ rpm -q llvm-devel clang-devel
llvm-devel-3.8.0-1.fc25.x86_64
clang-devel-3.8.0-2.fc25.x86_64
$
Before:
$ make -k LIBCLANGLLVM=1 O=/tmp/build/perf -C tools/perf install-bin
make: Entering directory '/home/acme/git/linux/tools/perf'
BUILD: Doing 'make -j4' parallel build
Warning: tools/include/uapi/linux/bpf.h differs from kernel
Warning: tools/arch/arm/include/uapi/asm/kvm.h differs from kernel
INSTALL GTK UI
LINK /tmp/build/perf/perf
/tmp/build/perf/libperf.a(libperf-in.o): In function `perf::createCompilerInvocation(llvm::SmallVector<char const*, 16u>, llvm::StringRef&, clang::DiagnosticsEngine&)':
/home/acme/git/linux/tools/perf/util/c++/clang.cpp:56: undefined reference to `clang::tooling::newInvocation(clang::DiagnosticsEngine*, llvm::SmallVector<char const*, 16u> const&)'
/tmp/build/perf/libperf.a(libperf-in.o): In function `perf::getModuleFromSource(llvm::SmallVector<char const*, 16u>, llvm::StringRef, llvm::IntrusiveRefCntPtr<clang::vfs::FileSystem>)':
/home/acme/git/linux/tools/perf/util/c++/clang.cpp:68: undefined reference to `clang::CompilerInstance::CompilerInstance(std::shared_ptr<clang::PCHContainerOperations>, bool)'
/home/acme/git/linux/tools/perf/util/c++/clang.cpp:69: undefined reference to `clang::CompilerInstance::createDiagnostics(clang::DiagnosticConsumer*, bool)'
<SNIP>
After:
Makefile.config:807: No suitable libLLVM found, disabling builtin clang and llvm support. Please install llvm-dev(el) (>= 3.9.0)
Updating the environment to a locally built LLVM 4.0 + clang 3.9 (forgot
to git pull, duh) combo, all works as expected, it is properly detected
and built into the resulting perf binary.
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Reported-and-Tested-by: Arnaldo Carvalho de Melo <acme@redhat.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/20161206072230.7651-1-wangnan0@huawei.com
[ Change the warning message a bit (add 'suitable' and 'builtin'), clarifying it, see committer notes above ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-12-06 14:22:30 +07:00
|
|
|
$(BUILDXX) -std=gnu++11 \
|
2016-11-26 14:03:31 +07:00
|
|
|
-I$(shell $(LLVM_CONFIG) --includedir) \
|
|
|
|
-L$(shell $(LLVM_CONFIG) --libdir) \
|
|
|
|
$(shell $(LLVM_CONFIG) --libs Core BPF) \
|
|
|
|
$(shell $(LLVM_CONFIG) --system-libs)
|
|
|
|
|
perf build: Check LLVM version in feature check
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 environment is not tested yet.
Committer Notes:
Testing it:
Environment:
$ cat /etc/fedora-release
Fedora release 25 (Twenty Five)
$ rpm -q llvm-devel clang-devel
llvm-devel-3.8.0-1.fc25.x86_64
clang-devel-3.8.0-2.fc25.x86_64
$
Before:
$ make -k LIBCLANGLLVM=1 O=/tmp/build/perf -C tools/perf install-bin
make: Entering directory '/home/acme/git/linux/tools/perf'
BUILD: Doing 'make -j4' parallel build
Warning: tools/include/uapi/linux/bpf.h differs from kernel
Warning: tools/arch/arm/include/uapi/asm/kvm.h differs from kernel
INSTALL GTK UI
LINK /tmp/build/perf/perf
/tmp/build/perf/libperf.a(libperf-in.o): In function `perf::createCompilerInvocation(llvm::SmallVector<char const*, 16u>, llvm::StringRef&, clang::DiagnosticsEngine&)':
/home/acme/git/linux/tools/perf/util/c++/clang.cpp:56: undefined reference to `clang::tooling::newInvocation(clang::DiagnosticsEngine*, llvm::SmallVector<char const*, 16u> const&)'
/tmp/build/perf/libperf.a(libperf-in.o): In function `perf::getModuleFromSource(llvm::SmallVector<char const*, 16u>, llvm::StringRef, llvm::IntrusiveRefCntPtr<clang::vfs::FileSystem>)':
/home/acme/git/linux/tools/perf/util/c++/clang.cpp:68: undefined reference to `clang::CompilerInstance::CompilerInstance(std::shared_ptr<clang::PCHContainerOperations>, bool)'
/home/acme/git/linux/tools/perf/util/c++/clang.cpp:69: undefined reference to `clang::CompilerInstance::createDiagnostics(clang::DiagnosticConsumer*, bool)'
<SNIP>
After:
Makefile.config:807: No suitable libLLVM found, disabling builtin clang and llvm support. Please install llvm-dev(el) (>= 3.9.0)
Updating the environment to a locally built LLVM 4.0 + clang 3.9 (forgot
to git pull, duh) combo, all works as expected, it is properly detected
and built into the resulting perf binary.
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Reported-and-Tested-by: Arnaldo Carvalho de Melo <acme@redhat.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/20161206072230.7651-1-wangnan0@huawei.com
[ Change the warning message a bit (add 'suitable' and 'builtin'), clarifying it, see committer notes above ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-12-06 14:22:30 +07:00
|
|
|
$(OUTPUT)test-llvm-version.bin:
|
|
|
|
$(BUILDXX) -std=gnu++11 \
|
|
|
|
-I$(shell $(LLVM_CONFIG) --includedir)
|
|
|
|
|
2016-11-26 14:03:32 +07:00
|
|
|
$(OUTPUT)test-clang.bin:
|
perf build: Check LLVM version in feature check
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 environment is not tested yet.
Committer Notes:
Testing it:
Environment:
$ cat /etc/fedora-release
Fedora release 25 (Twenty Five)
$ rpm -q llvm-devel clang-devel
llvm-devel-3.8.0-1.fc25.x86_64
clang-devel-3.8.0-2.fc25.x86_64
$
Before:
$ make -k LIBCLANGLLVM=1 O=/tmp/build/perf -C tools/perf install-bin
make: Entering directory '/home/acme/git/linux/tools/perf'
BUILD: Doing 'make -j4' parallel build
Warning: tools/include/uapi/linux/bpf.h differs from kernel
Warning: tools/arch/arm/include/uapi/asm/kvm.h differs from kernel
INSTALL GTK UI
LINK /tmp/build/perf/perf
/tmp/build/perf/libperf.a(libperf-in.o): In function `perf::createCompilerInvocation(llvm::SmallVector<char const*, 16u>, llvm::StringRef&, clang::DiagnosticsEngine&)':
/home/acme/git/linux/tools/perf/util/c++/clang.cpp:56: undefined reference to `clang::tooling::newInvocation(clang::DiagnosticsEngine*, llvm::SmallVector<char const*, 16u> const&)'
/tmp/build/perf/libperf.a(libperf-in.o): In function `perf::getModuleFromSource(llvm::SmallVector<char const*, 16u>, llvm::StringRef, llvm::IntrusiveRefCntPtr<clang::vfs::FileSystem>)':
/home/acme/git/linux/tools/perf/util/c++/clang.cpp:68: undefined reference to `clang::CompilerInstance::CompilerInstance(std::shared_ptr<clang::PCHContainerOperations>, bool)'
/home/acme/git/linux/tools/perf/util/c++/clang.cpp:69: undefined reference to `clang::CompilerInstance::createDiagnostics(clang::DiagnosticConsumer*, bool)'
<SNIP>
After:
Makefile.config:807: No suitable libLLVM found, disabling builtin clang and llvm support. Please install llvm-dev(el) (>= 3.9.0)
Updating the environment to a locally built LLVM 4.0 + clang 3.9 (forgot
to git pull, duh) combo, all works as expected, it is properly detected
and built into the resulting perf binary.
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Reported-and-Tested-by: Arnaldo Carvalho de Melo <acme@redhat.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/20161206072230.7651-1-wangnan0@huawei.com
[ Change the warning message a bit (add 'suitable' and 'builtin'), clarifying it, see committer notes above ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2016-12-06 14:22:30 +07:00
|
|
|
$(BUILDXX) -std=gnu++11 \
|
2016-11-26 14:03:32 +07:00
|
|
|
-I$(shell $(LLVM_CONFIG) --includedir) \
|
|
|
|
-L$(shell $(LLVM_CONFIG) --libdir) \
|
|
|
|
-Wl,--start-group -lclangBasic -lclangDriver \
|
|
|
|
-lclangFrontend -lclangEdit -lclangLex \
|
|
|
|
-lclangAST -Wl,--end-group \
|
|
|
|
$(shell $(LLVM_CONFIG) --libs Core option) \
|
|
|
|
$(shell $(LLVM_CONFIG) --system-libs)
|
|
|
|
|
2015-12-15 22:39:32 +07:00
|
|
|
-include $(OUTPUT)*.d
|
2013-09-30 18:51:28 +07:00
|
|
|
|
2013-09-30 15:08:24 +07:00
|
|
|
###############################
|
|
|
|
|
|
|
|
clean:
|
2015-12-15 22:39:32 +07:00
|
|
|
rm -f $(FILES) $(OUTPUT)*.d $(FILES:.bin=.make.output)
|