| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445 |
- include $(srctree)/tools/scripts/Makefile.include
- include $(srctree)/tools/scripts/utilities.mak
- perf-util-y += annotate-arch/
- perf-util-y += arm64-frame-pointer-unwind-support.o
- perf-util-y += addr2line.o
- perf-util-y += addr_location.o
- perf-util-y += annotate.o
- perf-util-y += blake2s.o
- perf-util-y += block-info.o
- perf-util-y += block-range.o
- perf-util-y += build-id.o
- perf-util-y += cacheline.o
- perf-util-$(CONFIG_LIBCAPSTONE) += capstone.o
- perf-util-y += config.o
- perf-util-y += copyfile.o
- perf-util-y += ctype.o
- perf-util-y += db-export.o
- perf-util-y += disasm.o
- perf-util-y += env.o
- perf-util-y += event.o
- perf-util-y += evlist.o
- perf-util-y += sideband_evlist.o
- perf-util-y += evsel.o
- perf-util-y += evsel_fprintf.o
- perf-util-y += perf_event_attr_fprintf.o
- perf-util-y += evswitch.o
- perf-util-y += find_bit.o
- perf-util-y += levenshtein.o
- perf-util-$(CONFIG_LIBBFD) += libbfd.o
- perf-util-y += llvm.o
- perf-util-y += mmap.o
- perf-util-y += memswap.o
- perf-util-y += parse-events.o
- perf-util-y += print-events.o
- perf-util-y += tracepoint.o
- perf-util-y += perf_regs.o
- perf-util-y += perf-regs-arch/
- perf-util-y += path.o
- perf-util-y += print_binary.o
- perf-util-y += print_insn.o
- perf-util-y += rlimit.o
- perf-util-y += argv_split.o
- perf-util-y += rbtree.o
- perf-util-y += libstring.o
- perf-util-y += bitmap.o
- perf-util-y += hweight.o
- perf-util-y += smt.o
- perf-util-y += strbuf.o
- perf-util-y += string.o
- perf-util-y += strlist.o
- perf-util-y += strfilter.o
- perf-util-y += top.o
- perf-util-y += usage.o
- perf-util-y += dso.o
- perf-util-y += dsos.o
- perf-util-y += symbol.o
- perf-util-y += symbol_fprintf.o
- perf-util-y += map_symbol.o
- perf-util-y += color.o
- perf-util-y += color_config.o
- perf-util-y += metricgroup.o
- perf-util-y += header.o
- perf-util-y += callchain.o
- perf-util-y += values.o
- perf-util-y += debug.o
- perf-util-y += fncache.o
- perf-util-y += machine.o
- perf-util-y += map.o
- perf-util-y += maps.o
- perf-util-y += pstack.o
- perf-util-y += session.o
- perf-util-y += tool.o
- perf-util-y += sample.o
- perf-util-y += sample-raw.o
- perf-util-y += s390-sample-raw.o
- perf-util-y += amd-sample-raw.o
- perf-util-$(CONFIG_TRACE) += syscalltbl.o
- perf-util-y += ordered-events.o
- perf-util-y += namespaces.o
- perf-util-y += comm.o
- perf-util-y += thread.o
- perf-util-y += threads.o
- perf-util-y += thread_map.o
- perf-util-y += parse-events-flex.o
- perf-util-y += parse-events-bison.o
- perf-util-y += pmu.o
- perf-util-y += pmus.o
- perf-util-y += pmu-flex.o
- perf-util-y += pmu-bison.o
- perf-util-y += drm_pmu.o
- perf-util-y += hwmon_pmu.o
- perf-util-y += tool_pmu.o
- perf-util-y += tp_pmu.o
- perf-util-y += svghelper.o
- perf-util-y += trace-event-info.o
- perf-util-y += trace-event-scripting.o
- perf-util-$(CONFIG_LIBTRACEEVENT) += trace-event.o
- perf-util-$(CONFIG_LIBTRACEEVENT) += trace-event-parse.o
- perf-util-$(CONFIG_LIBTRACEEVENT) += trace-event-read.o
- perf-util-y += sort.o
- perf-util-y += hist.o
- perf-util-y += util.o
- perf-util-y += cpumap.o
- perf-util-y += affinity.o
- perf-util-y += cputopo.o
- perf-util-y += cgroup.o
- perf-util-y += target.o
- perf-util-y += rblist.o
- perf-util-y += intlist.o
- perf-util-y += vdso.o
- perf-util-y += counts.o
- perf-util-y += stat.o
- perf-util-y += stat-shadow.o
- perf-util-y += stat-display.o
- perf-util-y += perf_api_probe.o
- perf-util-y += record.o
- perf-util-y += srcline.o
- perf-util-y += srccode.o
- perf-util-y += synthetic-events.o
- perf-util-y += data.o
- perf-util-y += tsc.o
- perf-util-y += cloexec.o
- perf-util-y += call-path.o
- perf-util-y += rwsem.o
- perf-util-y += thread-stack.o
- perf-util-y += spark.o
- perf-util-y += topdown.o
- perf-util-y += iostat.o
- perf-util-y += stream.o
- perf-util-$(CONFIG_LIBTRACEEVENT) += kvm-stat.o
- perf-util-y += kvm-stat-arch/
- perf-util-y += lock-contention.o
- perf-util-y += auxtrace.o
- perf-util-y += intel-pt-decoder/
- perf-util-y += intel-pt.o
- perf-util-y += intel-bts.o
- perf-util-y += arm-spe.o
- perf-util-y += arm-spe-decoder/
- perf-util-y += hisi-ptt.o
- perf-util-y += hisi-ptt-decoder/
- perf-util-y += s390-cpumsf.o
- perf-util-y += powerpc-vpadtl.o
- ifdef CONFIG_LIBOPENCSD
- perf-util-y += cs-etm.o
- perf-util-y += cs-etm-decoder/
- endif
- perf-util-y += cs-etm-base.o
- perf-util-y += parse-branch-options.o
- perf-util-y += dump-insn.o
- perf-util-y += parse-regs-options.o
- perf-util-y += parse-sublevel-options.o
- perf-util-y += term.o
- perf-util-y += help-unknown-cmd.o
- perf-util-y += dlfilter.o
- perf-util-y += mem-events.o
- perf-util-y += mem-info.o
- perf-util-y += vsprintf.o
- perf-util-y += units.o
- perf-util-y += time-utils.o
- perf-util-y += expr-flex.o
- perf-util-y += expr-bison.o
- perf-util-y += expr.o
- perf-util-y += branch.o
- perf-util-y += mem2node.o
- perf-util-y += clockid.o
- perf-util-y += list_sort.o
- perf-util-y += mutex.o
- perf-util-y += sharded_mutex.o
- perf-util-y += intel-tpebs.o
- perf-util-$(CONFIG_LIBBPF) += bpf_map.o
- perf-util-$(CONFIG_PERF_BPF_SKEL) += bpf_counter.o
- perf-util-$(CONFIG_PERF_BPF_SKEL) += bpf_counter_cgroup.o
- perf-util-$(CONFIG_PERF_BPF_SKEL) += bpf_ftrace.o
- perf-util-$(CONFIG_PERF_BPF_SKEL) += bpf_off_cpu.o
- perf-util-$(CONFIG_PERF_BPF_SKEL) += bpf-filter.o
- perf-util-$(CONFIG_PERF_BPF_SKEL) += bpf-filter-flex.o
- perf-util-$(CONFIG_PERF_BPF_SKEL) += bpf-filter-bison.o
- perf-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.o
- endif
- ifeq ($(CONFIG_LIBTRACEEVENT),y)
- perf-util-$(CONFIG_PERF_BPF_SKEL) += bpf_lock_contention.o
- endif
- ifeq ($(CONFIG_LIBTRACEEVENT),y)
- perf-util-$(CONFIG_PERF_BPF_SKEL) += bpf_kwork.o
- perf-util-$(CONFIG_PERF_BPF_SKEL) += bpf_kwork_top.o
- endif
- perf-util-$(CONFIG_LIBELF) += symbol-elf.o
- perf-util-$(CONFIG_LIBELF) += probe-file.o
- perf-util-$(CONFIG_LIBELF) += probe-event.o
- ifdef CONFIG_LIBBPF_DYNAMIC
- hashmap := 1
- endif
- ifndef CONFIG_LIBBPF
- hashmap := 1
- endif
- ifdef hashmap
- perf-util-y += hashmap.o
- endif
- ifndef CONFIG_LIBELF
- perf-util-y += symbol-minimal.o
- endif
- ifndef CONFIG_SETNS
- perf-util-y += setns.o
- endif
- perf-util-$(CONFIG_LIBDW) += probe-finder.o
- perf-util-$(CONFIG_LIBDW) += dwarf-aux.o
- perf-util-$(CONFIG_LIBDW) += dwarf-regs.o
- perf-util-$(CONFIG_LIBDW) += dwarf-regs-arch/
- perf-util-$(CONFIG_LIBDW) += debuginfo.o
- perf-util-$(CONFIG_LIBDW) += annotate-data.o
- perf-util-$(CONFIG_LIBDW) += libdw.o
- perf-util-$(CONFIG_LIBDW) += unwind-libdw.o
- perf-util-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind-local.o
- perf-util-$(CONFIG_LIBUNWIND) += unwind-libunwind.o
- perf-util-$(CONFIG_LIBUNWIND_X86) += libunwind/x86_32.o
- perf-util-$(CONFIG_LIBUNWIND_AARCH64) += libunwind/arm64.o
- ifeq ($(CONFIG_LIBTRACEEVENT),y)
- perf-util-$(CONFIG_LIBBABELTRACE) += data-convert-bt.o
- endif
- perf-util-y += data-convert-json.o
- perf-util-y += scripting-engines/
- perf-util-$(CONFIG_ZLIB) += zlib.o
- perf-util-$(CONFIG_LZMA) += lzma.o
- perf-util-$(CONFIG_ZSTD) += zstd.o
- perf-util-y += cap.o
- perf-util-$(CONFIG_CXX_DEMANGLE) += demangle-cxx.o
- perf-util-y += demangle-ocaml.o
- perf-util-y += demangle-java.o
- perf-util-y += demangle-rust-v0.o
- perf-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_JITDUMP
- perf-util-$(CONFIG_LIBELF) += jitdump.o
- perf-util-$(CONFIG_LIBELF) += genelf.o
- perf-util-$(CONFIG_LIBDW) += genelf_debug.o
- endif
- perf-util-y += perf-hooks.o
- perf-util-$(CONFIG_LIBBPF) += bpf-event.o
- perf-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 mode
- CFLAGS_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
- endif
- else
- flex_flags := -w
- endif
- # 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 it
- ifeq ($(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))
- endif
- endif
- 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-enum
- else
- bison_flags += -w
- endif
- 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=YYABORT
- endif
- CFLAGS_parse-events-flex.o += $(flex_flags) -Wno-unused-label
- CFLAGS_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-FILE
- CFLAGS_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.py
- ifdef 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)
|