Something went wrong. Try again.
Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459include $(srctree)/tools/scripts/Makefile.includeinclude $(srctree)/tools/scripts/utilities.mak
perf-util-y += annotate-arch/perf-util-y += arm64-frame-pointer-unwind-support.operf-util-y += addr2line.operf-util-y += addr_location.operf-util-y += annotate.operf-util-y += aslr.operf-util-y += blake2s.operf-util-y += block-info.operf-util-y += block-range.operf-util-y += build-id.operf-util-y += cacheline.operf-util-$(CONFIG_LIBCAPSTONE) += capstone.operf-util-y += config.operf-util-y += copyfile.operf-util-y += ctype.operf-util-y += db-export.operf-util-y += disasm.operf-util-y += env.operf-util-y += event.operf-util-y += evlist.operf-util-y += sideband_evlist.operf-util-y += evsel.operf-util-y += evsel_fprintf.operf-util-y += perf_event_attr_fprintf.operf-util-y += evswitch.operf-util-y += find_bit.operf-util-y += levenshtein.operf-util-$(CONFIG_LIBBFD) += libbfd.operf-util-y += llvm.operf-util-y += mmap.operf-util-y += memswap.operf-util-y += parse-events.operf-util-y += print-events.operf-util-y += tracepoint.operf-util-y += perf_regs.operf-util-y += perf-regs-arch/perf-util-y += path.operf-util-y += print_binary.operf-util-y += print_insn.operf-util-y += rlimit.operf-util-y += argv_split.operf-util-y += rbtree.operf-util-y += libstring.operf-util-y += bitmap.operf-util-y += hweight.operf-util-y += smt.operf-util-y += strbuf.operf-util-y += string.operf-util-y += strlist.operf-util-y += strfilter.operf-util-y += top.operf-util-y += usage.operf-util-y += dso.operf-util-y += dsos.operf-util-y += symbol.operf-util-y += symbol_fprintf.operf-util-y += map_symbol.operf-util-y += color.operf-util-y += color_config.operf-util-y += metricgroup.operf-util-y += header.operf-util-y += callchain.operf-util-y += values.operf-util-y += debug.operf-util-y += fncache.operf-util-y += machine.operf-util-y += map.operf-util-y += maps.operf-util-y += pstack.operf-util-y += session.operf-util-y += tool.operf-util-y += sample.operf-util-y += sample-raw.operf-util-y += s390-sample-raw.operf-util-y += amd-sample-raw.o
perf-util-y += ordered-events.operf-util-y += namespaces.operf-util-y += comm.operf-util-y += thread.operf-util-y += threads.operf-util-y += thread_map.operf-util-y += parse-events-flex.operf-util-y += parse-events-bison.operf-util-y += pmu.operf-util-y += pmus.operf-util-y += pmu-flex.operf-util-y += pmu-bison.operf-util-y += drm_pmu.operf-util-y += hwmon_pmu.operf-util-y += tool_pmu.operf-util-y += tp_pmu.operf-util-y += svghelper.operf-util-y += trace-event-info.operf-util-y += trace-event-scripting.operf-util-$(CONFIG_LIBTRACEEVENT) += trace-event.operf-util-$(CONFIG_LIBTRACEEVENT) += trace-event-parse.operf-util-$(CONFIG_LIBTRACEEVENT) += trace-event-read.operf-util-y += sort.operf-util-y += hist.operf-util-y += util.operf-util-y += cpumap.operf-util-y += affinity.operf-util-y += cputopo.operf-util-y += cgroup.operf-util-y += target.operf-util-y += rblist.operf-util-y += intlist.operf-util-y += vdso.operf-util-y += counts.operf-util-y += stat.operf-util-y += stat-shadow.operf-util-y += stat-display.operf-util-y += perf_api_probe.operf-util-y += record.operf-util-y += srcline.operf-util-y += srccode.operf-util-y += synthetic-events.operf-util-y += data.operf-util-y += tsc.operf-util-y += cloexec.operf-util-y += call-path.operf-util-y += rwsem.operf-util-y += thread-stack.operf-util-y += spark.operf-util-y += topdown.operf-util-y += iostat.operf-util-y += stream.operf-util-$(CONFIG_LIBTRACEEVENT) += kvm-stat.operf-util-y += kvm-stat-arch/perf-util-y += lock-contention.operf-util-y += auxtrace.operf-util-y += intel-pt-decoder/perf-util-y += intel-pt.operf-util-y += intel-bts.operf-util-y += arm-spe.operf-util-y += arm-spe-decoder/perf-util-y += hisi-ptt.operf-util-y += hisi-ptt-decoder/perf-util-y += s390-cpumsf.operf-util-y += powerpc-vpadtl.o
ifdef CONFIG_LIBOPENCSDperf-util-y += cs-etm.operf-util-y += cs-etm-decoder/endifperf-util-y += cs-etm-base.o
perf-util-y += parse-branch-options.operf-util-y += parse-regs-options.operf-util-y += parse-sublevel-options.operf-util-y += term.operf-util-y += help-unknown-cmd.operf-util-y += dlfilter.operf-util-y += mem-events.operf-util-y += mem-info.operf-util-y += vsprintf.operf-util-y += units.operf-util-y += time-utils.operf-util-y += expr-flex.operf-util-y += expr-bison.operf-util-y += expr.operf-util-y += branch.operf-util-y += mem2node.operf-util-y += clockid.operf-util-y += list_sort.operf-util-y += mutex.operf-util-y += sharded_mutex.operf-util-y += intel-tpebs.o
perf-util-$(CONFIG_PERF_BPF_SKEL) += bpf_counter.operf-util-$(CONFIG_PERF_BPF_SKEL) += bpf_counter_cgroup.operf-util-$(CONFIG_PERF_BPF_SKEL) += bpf_ftrace.operf-util-$(CONFIG_PERF_BPF_SKEL) += bpf_off_cpu.operf-util-$(CONFIG_PERF_BPF_SKEL) += bpf-filter.operf-util-$(CONFIG_PERF_BPF_SKEL) += bpf-filter-flex.operf-util-$(CONFIG_PERF_BPF_SKEL) += bpf-filter-bison.operf-util-$(CONFIG_PERF_BPF_SKEL) += btf.o
ifeq ($(CONFIG_TRACE),y) perf-util-$(CONFIG_PERF_BPF_SKEL) += bpf-trace-summary.o perf-util-$(CONFIG_PERF_BPF_SKEL) += bpf_trace_augment.oendif
ifeq ($(CONFIG_LIBTRACEEVENT),y) perf-util-$(CONFIG_PERF_BPF_SKEL) += bpf_lock_contention.oendif
ifeq ($(CONFIG_LIBTRACEEVENT),y) perf-util-$(CONFIG_PERF_BPF_SKEL) += bpf_kwork.o perf-util-$(CONFIG_PERF_BPF_SKEL) += bpf_kwork_top.oendif
perf-util-$(CONFIG_LIBELF) += symbol-elf.operf-util-$(CONFIG_LIBELF) += probe-file.operf-util-$(CONFIG_LIBELF) += probe-event.o
ifdef CONFIG_LIBBPF_DYNAMIC hashmap := 1endififndef CONFIG_LIBBPF hashmap := 1endif
ifdef hashmapperf-util-y += hashmap.oendif
ifndef CONFIG_LIBELFperf-util-y += symbol-minimal.oendif
ifndef CONFIG_SETNSperf-util-y += setns.oendif
perf-util-y += unwind.operf-util-$(CONFIG_LIBDW) += probe-finder.operf-util-$(CONFIG_LIBDW) += dwarf-aux.operf-util-$(CONFIG_LIBDW) += dwarf-regs.operf-util-$(CONFIG_LIBDW) += dwarf-regs-arch/perf-util-$(CONFIG_LIBDW) += debuginfo.operf-util-$(CONFIG_LIBDW) += annotate-data.operf-util-$(CONFIG_LIBDW) += libdw.operf-util-$(CONFIG_LIBDW) += unwind-libdw.o
perf-util-$(CONFIG_LIBUNWIND) += unwind-libunwind.operf-util-$(CONFIG_LIBUNWIND) += libunwind-arch/
ifeq ($(CONFIG_LIBTRACEEVENT),y) perf-util-$(CONFIG_BABELTRACE2_CTF_WRITER) += data-convert-bt.oendif
perf-util-y += data-convert-json.o
perf-util-y += scripting-engines/
perf-util-$(CONFIG_ZLIB) += zlib.operf-util-$(CONFIG_LZMA) += lzma.operf-util-$(CONFIG_ZSTD) += zstd.o
perf-util-y += cap.o
perf-util-$(CONFIG_CXX_DEMANGLE) += demangle-cxx.operf-util-y += demangle-ocaml.operf-util-y += demangle-java.operf-util-y += demangle-rust-v0.operf-util-$(CONFIG_LIBLLVM) += llvm-c-helpers.o
CFLAGS_demangle-rust-v0.o += -Wno-shadow -Wno-declaration-after-statement \ -Wno-switch-default -Wno-switch-enum -Wno-missing-field-initializers
ifdef CONFIG_JITDUMPperf-util-$(CONFIG_LIBELF) += jitdump.operf-util-$(CONFIG_LIBELF) += genelf.operf-util-$(CONFIG_LIBDW) += genelf_debug.oendif
perf-util-y += perf-hooks.o
perf-util-$(CONFIG_LIBBPF) += bpf-event.operf-util-$(CONFIG_LIBBPF) += bpf-utils.o
perf-util-$(CONFIG_LIBPFM4) += pfm.o
CFLAGS_config.o += -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"
# avoid compiler warnings in 32-bit modeCFLAGS_genelf_debug.o += -Wno-packed
$(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-flex.h: util/parse-events.l $(OUTPUT)util/parse-events-bison.c $(call rule_mkdir) $(Q)$(call echo-cmd,flex)$(FLEX) -o $(OUTPUT)util/parse-events-flex.c \ --header-file=$(OUTPUT)util/parse-events-flex.h $(PARSER_DEBUG_FLEX) $<
$(OUTPUT)util/parse-events-bison.c $(OUTPUT)util/parse-events-bison.h: util/parse-events.y $(call rule_mkdir) $(Q)$(call echo-cmd,bison)$(BISON) -v $< -d $(PARSER_DEBUG_BISON) $(BISON_FILE_PREFIX_MAP) $(BISON_FALLBACK_FLAGS) \ -o $(OUTPUT)util/parse-events-bison.c -p parse_events_
$(OUTPUT)util/expr-flex.c $(OUTPUT)util/expr-flex.h: util/expr.l $(OUTPUT)util/expr-bison.c $(call rule_mkdir) $(Q)$(call echo-cmd,flex)$(FLEX) -o $(OUTPUT)util/expr-flex.c \ --header-file=$(OUTPUT)util/expr-flex.h $(PARSER_DEBUG_FLEX) $<
$(OUTPUT)util/expr-bison.c $(OUTPUT)util/expr-bison.h: util/expr.y $(call rule_mkdir) $(Q)$(call echo-cmd,bison)$(BISON) -v $< -d $(PARSER_DEBUG_BISON) $(BISON_FILE_PREFIX_MAP) \ -o $(OUTPUT)util/expr-bison.c -p expr_
$(OUTPUT)util/pmu-flex.c $(OUTPUT)util/pmu-flex.h: util/pmu.l $(OUTPUT)util/pmu-bison.c $(call rule_mkdir) $(Q)$(call echo-cmd,flex)$(FLEX) -o $(OUTPUT)util/pmu-flex.c \ --header-file=$(OUTPUT)util/pmu-flex.h $(PARSER_DEBUG_FLEX) $<
$(OUTPUT)util/pmu-bison.c $(OUTPUT)util/pmu-bison.h: util/pmu.y $(call rule_mkdir) $(Q)$(call echo-cmd,bison)$(BISON) -v $< -d $(PARSER_DEBUG_BISON) $(BISON_FILE_PREFIX_MAP) \ -o $(OUTPUT)util/pmu-bison.c -p perf_pmu_
$(OUTPUT)util/bpf-filter-flex.c $(OUTPUT)util/bpf-filter-flex.h: util/bpf-filter.l $(OUTPUT)util/bpf-filter-bison.c util/bpf-filter.h util/bpf_skel/sample-filter.h $(call rule_mkdir) $(Q)$(call echo-cmd,flex)$(FLEX) -o $(OUTPUT)util/bpf-filter-flex.c \ --header-file=$(OUTPUT)util/bpf-filter-flex.h $(PARSER_DEBUG_FLEX) $<
$(OUTPUT)util/bpf-filter-bison.c $(OUTPUT)util/bpf-filter-bison.h: util/bpf-filter.y util/bpf-filter.h util/bpf_skel/sample-filter.h $(call rule_mkdir) $(Q)$(call echo-cmd,bison)$(BISON) -v $< -d $(PARSER_DEBUG_BISON) $(BISON_FILE_PREFIX_MAP) \ -o $(OUTPUT)util/bpf-filter-bison.c -p perf_bpf_filter_
FLEX_VERSION := $(shell $(FLEX) --version | cut -d' ' -f2)
FLEX_GE_260 := $(call version-ge3,$(FLEX_VERSION),2.6.0)ifeq ($(FLEX_GE_260),1) flex_flags := -Wno-redundant-decls -Wno-switch-default -Wno-unused-function -Wno-misleading-indentation
# Some newer clang and gcc version complain about this # util/parse-events-bison.c:1317:9: error: variable 'parse_events_nerrs' set but not used [-Werror,-Wunused-but-set-variable] # int yynerrs = 0;
flex_flags += -Wno-unused-but-set-variable
FLEX_LT_262 := $(call version-lt3,$(FLEX_VERSION),2.6.2) ifeq ($(FLEX_LT_262),1) flex_flags += -Wno-sign-compare endifelse flex_flags := -wendif
# Some newer clang and gcc version complain about this# util/parse-events-bison.c:1317:9: error: variable 'parse_events_nerrs' set but not used [-Werror,-Wunused-but-set-variable]# int yynerrs = 0;
bison_flags := -DYYENABLE_NLS=0 -Wno-unused-but-set-variable
# Old clangs don't grok -Wno-unused-but-set-variable, remove itifeq ($(CC_NO_CLANG), 0) CLANG_VERSION := $(shell $(CLANG) --version | head -1 | sed 's/.*clang version \([[:digit:]]\+.[[:digit:]]\+.[[:digit:]]\+\).*/\1/g') ifeq ($(call version-lt3,$(CLANG_VERSION),13.0.0),1) bison_flags := $(subst -Wno-unused-but-set-variable,,$(bison_flags)) flex_flags := $(subst -Wno-unused-but-set-variable,,$(flex_flags)) endifendif
BISON_GE_382 := $(shell expr $(shell $(BISON) --version | grep bison | sed -e 's/.\+ \([0-9]\+\).\([0-9]\+\).\([0-9]\+\)/\1\2\3/g') \>\= 382)ifeq ($(BISON_GE_382),1) bison_flags += -Wno-switch-enumelse bison_flags += -wendif
BISON_LT_381 := $(shell expr $(shell $(BISON) --version | grep bison | sed -e 's/.\+ \([0-9]\+\).\([0-9]\+\).\([0-9]\+\)/\1\2\3/g') \< 381)ifeq ($(BISON_LT_381),1) bison_flags += -DYYNOMEM=YYABORTendif
CFLAGS_parse-events-flex.o += $(flex_flags) -Wno-unused-labelCFLAGS_pmu-flex.o += $(flex_flags)CFLAGS_expr-flex.o += $(flex_flags)CFLAGS_bpf-filter-flex.o += $(flex_flags)
CFLAGS_parse-events-bison.o += $(bison_flags)CFLAGS_pmu-bison.o += -DYYLTYPE_IS_TRIVIAL=0 $(bison_flags)CFLAGS_expr-bison.o += -DYYLTYPE_IS_TRIVIAL=0 $(bison_flags)CFLAGS_bpf-filter-bison.o += -DYYLTYPE_IS_TRIVIAL=0 $(bison_flags)
$(OUTPUT)util/parse-events.o: $(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-bison.c$(OUTPUT)util/pmu.o: $(OUTPUT)util/pmu-flex.c $(OUTPUT)util/pmu-bison.c$(OUTPUT)util/expr.o: $(OUTPUT)util/expr-flex.c $(OUTPUT)util/expr-bison.c$(OUTPUT)util/bpf-filter.o: $(OUTPUT)util/bpf-filter-flex.c $(OUTPUT)util/bpf-filter-bison.c
CFLAGS_bitmap.o += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"CFLAGS_find_bit.o += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"CFLAGS_rbtree.o += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"CFLAGS_libstring.o += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"CFLAGS_hweight.o += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"CFLAGS_header.o += -include $(OUTPUT)PERF-VERSION-FILECFLAGS_arm-spe.o += -I$(srctree)/tools/arch/arm64/include/ -I$(OUTPUT)arch/arm64/include/generated/
$(OUTPUT)util/argv_split.o: ../lib/argv_split.c FORCE $(call rule_mkdir) $(call if_changed_dep,cc_o_c)
$(OUTPUT)util/bitmap.o: ../lib/bitmap.c FORCE $(call rule_mkdir) $(call if_changed_dep,cc_o_c)
$(OUTPUT)util/ctype.o: ../lib/ctype.c FORCE $(call rule_mkdir) $(call if_changed_dep,cc_o_c)
$(OUTPUT)util/find_bit.o: ../lib/find_bit.c FORCE $(call rule_mkdir) $(call if_changed_dep,cc_o_c)
$(OUTPUT)util/rbtree.o: ../lib/rbtree.c FORCE $(call rule_mkdir) $(call if_changed_dep,cc_o_c)
$(OUTPUT)util/libstring.o: ../lib/string.c FORCE $(call rule_mkdir) $(call if_changed_dep,cc_o_c)
$(OUTPUT)util/hweight.o: ../lib/hweight.c FORCE $(call rule_mkdir) $(call if_changed_dep,cc_o_c)
$(OUTPUT)util/vsprintf.o: ../lib/vsprintf.c FORCE $(call rule_mkdir) $(call if_changed_dep,cc_o_c)
$(OUTPUT)util/list_sort.o: ../lib/list_sort.c FORCE $(call rule_mkdir) $(call if_changed_dep,cc_o_c)
PY_TESTS := setup.pyifdef MYPY MYPY_TEST_LOGS := $(PY_TESTS:%=%.mypy_log)else MYPY_TEST_LOGS :=endif
$(OUTPUT)%.mypy_log: % $(call rule_mkdir) $(Q)$(call echo-cmd,test)mypy "$<" > $@ || (cat $@ && rm $@ && false)
perf-util-y += $(MYPY_TEST_LOGS)
ifdef PYLINT PYLINT_TEST_LOGS := $(PY_TESTS:%=%.pylint_log)else PYLINT_TEST_LOGS :=endif
$(OUTPUT)%.pylint_log: % $(call rule_mkdir) $(Q)$(call echo-cmd,test)pylint "$<" > $@ || (cat $@ && rm $@ && false)
perf-util-y += $(PYLINT_TEST_LOGS)
ifeq ($(CONFIG_PERF_BPF_SKEL),y)include $(srctree)/tools/perf/bpf_skel.mak
$(OUTPUT)util/bpf_ftrace.o: $(SKEL_OUT)/func_latency.skel.h$(OUTPUT)util/bpf-filter.o: $(SKEL_OUT)/sample_filter.skel.h$(OUTPUT)util/bpf_kwork_top.o: $(SKEL_OUT)/kwork_top.skel.h$(OUTPUT)util/bpf_off_cpu.o: $(SKEL_OUT)/off_cpu.skel.h$(OUTPUT)util/bpf-trace-summary.o: $(SKEL_OUT)/syscall_summary.skel.h$(OUTPUT)util/bpf_counter_cgroup.o: $(SKEL_OUT)/bperf_cgroup.skel.h$(OUTPUT)util/bpf_trace_augment.o: $(SKEL_OUT)/augmented_raw_syscalls.skel.h$(OUTPUT)util/bpf_counter.o: $(SKEL_OUT)/bpf_prog_profiler.skel.h $(SKEL_OUT)/bperf_leader.skel.h $(SKEL_OUT)/bperf_follower.skel.h$(OUTPUT)util/bpf_lock_contention.o: $(SKEL_OUT)/lock_contention.skel.h$(OUTPUT)util/bpf_kwork.o: $(SKEL_OUT)/kwork_trace.skel.hendif