Makefile.perf (fa853c4b839ece9cd589e8858819240933cc4d78) Makefile.perf (211a741cd3e124bffdc13ee82e7e65f204e53f60)
1# SPDX-License-Identifier: GPL-2.0-only
2include ../scripts/Makefile.include
3include ../scripts/Makefile.arch
4
5# The default target of this Makefile is...
6all:
7
8include ../scripts/utilities.mak

--- 112 unchanged lines hidden (view full) ---

121# Define NO_SYSCALL_TABLE=1 to disable the use of syscall id to/from name tables
122# generated from the kernel .tbl or unistd.h files and use, if available, libaudit
123# for doing the conversions to/from strings/id.
124#
125# Define LIBPFM4 to enable libpfm4 events extension.
126#
127# Define NO_LIBDEBUGINFOD if you do not want support debuginfod
128#
1# SPDX-License-Identifier: GPL-2.0-only
2include ../scripts/Makefile.include
3include ../scripts/Makefile.arch
4
5# The default target of this Makefile is...
6all:
7
8include ../scripts/utilities.mak

--- 112 unchanged lines hidden (view full) ---

121# Define NO_SYSCALL_TABLE=1 to disable the use of syscall id to/from name tables
122# generated from the kernel .tbl or unistd.h files and use, if available, libaudit
123# for doing the conversions to/from strings/id.
124#
125# Define LIBPFM4 to enable libpfm4 events extension.
126#
127# Define NO_LIBDEBUGINFOD if you do not want support debuginfod
128#
129# Define BUILD_BPF_SKEL to enable BPF skeletons
130#
131
132# As per kernel Makefile, avoid funny character set dependencies
133unexport LC_ALL
134LC_COLLATE=C
135LC_NUMERIC=C
136export LC_COLLATE LC_NUMERIC
137
138ifeq ($(srctree),)

--- 33 unchanged lines hidden (view full) ---

172define allow-override
173 $(if $(or $(findstring environment,$(origin $(1))),\
174 $(findstring command line,$(origin $(1)))),,\
175 $(eval $(1) = $(2)))
176endef
177
178LD += $(EXTRA_LDFLAGS)
179
129
130# As per kernel Makefile, avoid funny character set dependencies
131unexport LC_ALL
132LC_COLLATE=C
133LC_NUMERIC=C
134export LC_COLLATE LC_NUMERIC
135
136ifeq ($(srctree),)

--- 33 unchanged lines hidden (view full) ---

170define allow-override
171 $(if $(or $(findstring environment,$(origin $(1))),\
172 $(findstring command line,$(origin $(1)))),,\
173 $(eval $(1) = $(2)))
174endef
175
176LD += $(EXTRA_LDFLAGS)
177
180HOSTCC ?= gcc
181HOSTLD ?= ld
182HOSTAR ?= ar
183CLANG ?= clang
184LLVM_STRIP ?= llvm-strip
185
186PKG_CONFIG = $(CROSS_COMPILE)pkg-config
178PKG_CONFIG = $(CROSS_COMPILE)pkg-config
187LLVM_CONFIG ?= llvm-config
188
189RM = rm -f
190LN = ln -f
191MKDIR = mkdir
192FIND = find
193INSTALL = install
194FLEX ?= flex
195BISON ?= bison

--- 538 unchanged lines hidden (view full) ---

734 $(perf_ioctl_array) \
735 $(prctl_option_array) \
736 $(usbdevfs_ioctl_array) \
737 $(x86_arch_irq_vectors_array) \
738 $(x86_arch_MSRs_array) \
739 $(x86_arch_prctl_code_array) \
740 $(rename_flags_array) \
741 $(arch_errno_name_array) \
179
180RM = rm -f
181LN = ln -f
182MKDIR = mkdir
183FIND = find
184INSTALL = install
185FLEX ?= flex
186BISON ?= bison

--- 538 unchanged lines hidden (view full) ---

725 $(perf_ioctl_array) \
726 $(prctl_option_array) \
727 $(usbdevfs_ioctl_array) \
728 $(x86_arch_irq_vectors_array) \
729 $(x86_arch_MSRs_array) \
730 $(x86_arch_prctl_code_array) \
731 $(rename_flags_array) \
732 $(arch_errno_name_array) \
742 $(sync_file_range_arrays) \
743 bpf-skel
733 $(sync_file_range_arrays)
744
745$(OUTPUT)%.o: %.c prepare FORCE
746 $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
747
748$(OUTPUT)%.i: %.c prepare FORCE
749 $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
750
751$(OUTPUT)%.s: %.c prepare FORCE

--- 256 unchanged lines hidden (view full) ---

1008#
1009config-clean:
1010 $(call QUIET_CLEAN, config)
1011 $(Q)$(MAKE) -C $(srctree)/tools/build/feature/ $(if $(OUTPUT),OUTPUT=$(OUTPUT)feature/,) clean >/dev/null
1012
1013python-clean:
1014 $(python-clean)
1015
734
735$(OUTPUT)%.o: %.c prepare FORCE
736 $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
737
738$(OUTPUT)%.i: %.c prepare FORCE
739 $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(build-dir) $@
740
741$(OUTPUT)%.s: %.c prepare FORCE

--- 256 unchanged lines hidden (view full) ---

998#
999config-clean:
1000 $(call QUIET_CLEAN, config)
1001 $(Q)$(MAKE) -C $(srctree)/tools/build/feature/ $(if $(OUTPUT),OUTPUT=$(OUTPUT)feature/,) clean >/dev/null
1002
1003python-clean:
1004 $(python-clean)
1005
1016SKEL_OUT := $(abspath $(OUTPUT)util/bpf_skel)
1017SKEL_TMP_OUT := $(abspath $(SKEL_OUT)/.tmp)
1018SKELETONS := $(SKEL_OUT)/bpf_prog_profiler.skel.h
1019
1020ifdef BUILD_BPF_SKEL
1021BPFTOOL := $(SKEL_TMP_OUT)/bootstrap/bpftool
1022LIBBPF_SRC := $(abspath ../lib/bpf)
1023BPF_INCLUDE := -I$(SKEL_TMP_OUT)/.. -I$(BPF_PATH) -I$(LIBBPF_SRC)/..
1024
1025$(SKEL_TMP_OUT):
1026 $(Q)$(MKDIR) -p $@
1027
1028$(BPFTOOL): | $(SKEL_TMP_OUT)
1029 CFLAGS= $(MAKE) -C ../bpf/bpftool \
1030 OUTPUT=$(SKEL_TMP_OUT)/ bootstrap
1031
1032$(SKEL_TMP_OUT)/%.bpf.o: util/bpf_skel/%.bpf.c $(LIBBPF) | $(SKEL_TMP_OUT)
1033 $(QUIET_CLANG)$(CLANG) -g -O2 -target bpf $(BPF_INCLUDE) \
1034 -c $(filter util/bpf_skel/%.bpf.c,$^) -o $@ && $(LLVM_STRIP) -g $@
1035
1036$(SKEL_OUT)/%.skel.h: $(SKEL_TMP_OUT)/%.bpf.o | $(BPFTOOL)
1037 $(QUIET_GENSKEL)$(BPFTOOL) gen skeleton $< > $@
1038
1039bpf-skel: $(SKELETONS)
1040
1041.PRECIOUS: $(SKEL_TMP_OUT)/%.bpf.o
1042
1043else # BUILD_BPF_SKEL
1044
1045bpf-skel:
1046
1047endif # BUILD_BPF_SKEL
1048
1049bpf-skel-clean:
1050 $(call QUIET_CLEAN, bpf-skel) $(RM) -r $(SKEL_TMP_OUT) $(SKELETONS)
1051
1052clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean $(LIBPERF)-clean config-clean fixdep-clean python-clean bpf-skel-clean
1006clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean $(LIBPERF)-clean config-clean fixdep-clean python-clean
1053 $(call QUIET_CLEAN, core-objs) $(RM) $(LIBPERF_A) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(LANG_BINDINGS)
1054 $(Q)find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
1055 $(Q)$(RM) $(OUTPUT).config-detected
1056 $(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf perf-read-vdso32 perf-read-vdsox32 $(OUTPUT)pmu-events/jevents $(OUTPUT)$(LIBJVMTI).so
1057 $(call QUIET_CLEAN, core-gen) $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)FEATURE-DUMP $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex* \
1058 $(OUTPUT)util/intel-pt-decoder/inat-tables.c \
1059 $(OUTPUT)tests/llvm-src-{base,kbuild,prologue,relocation}.c \
1060 $(OUTPUT)pmu-events/pmu-events.c \

--- 60 unchanged lines hidden ---
1007 $(call QUIET_CLEAN, core-objs) $(RM) $(LIBPERF_A) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(LANG_BINDINGS)
1008 $(Q)find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
1009 $(Q)$(RM) $(OUTPUT).config-detected
1010 $(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf perf-read-vdso32 perf-read-vdsox32 $(OUTPUT)pmu-events/jevents $(OUTPUT)$(LIBJVMTI).so
1011 $(call QUIET_CLEAN, core-gen) $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)FEATURE-DUMP $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex* \
1012 $(OUTPUT)util/intel-pt-decoder/inat-tables.c \
1013 $(OUTPUT)tests/llvm-src-{base,kbuild,prologue,relocation}.c \
1014 $(OUTPUT)pmu-events/pmu-events.c \

--- 60 unchanged lines hidden ---