include $(srctree)/tools/scripts/Makefile.includeinclude $(srctree)/tools/scripts/utilities.mak perf-util-y += arm64-frame-pointer-unwind-support.operf-util-y += addr_location.operf-util-y += annotate.operf-util-y += block-info.operf-util-y += block-range.operf-util-y += build-id.operf-util-y += cacheline.operf-util-y += config.operf-util-y += copyfile.operf-util-y += ctype.operf-util-y += db-export.operf-util-y += disasm.operf-util-y += disasm_bpf.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 += get_current_dir_name.operf-util-y += levenshtein.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-raw.operf-util-y += s390-sample-raw.operf-util-y += amd-sample-raw.operf-util-$(CONFIG_TRACE) += syscalltbl.operf-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 += hwmon_pmu.operf-util-y += tool_pmu.operf-util-y += svghelper.operf-util-$(CONFIG_LIBTRACEEVENT) += 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_AUXTRACE) += auxtrace.operf-util-$(CONFIG_AUXTRACE) += intel-pt-decoder/perf-util-$(CONFIG_AUXTRACE) += intel-pt.operf-util-$(CONFIG_AUXTRACE) += intel-bts.operf-util-$(CONFIG_AUXTRACE) += arm-spe.operf-util-$(CONFIG_AUXTRACE) += arm-spe-decoder/perf-util-$(CONFIG_AUXTRACE) += hisi-ptt.operf-util-$(CONFIG_AUXTRACE) += hisi-ptt-decoder/perf-util-$(CONFIG_AUXTRACE) += s390-cpumsf.o ifdef CONFIG_LIBOPENCSDperf-util-$(CONFIG_AUXTRACE) += cs-etm.operf-util-$(CONFIG_AUXTRACE) += cs-etm-decoder/endifperf-util-$(CONFIG_AUXTRACE) += cs-etm-base.o perf-util-y += parse-branch-options.operf-util-y += dump-insn.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-$(CONFIG_X86_64) += intel-tpebs.o perf-util-$(CONFIG_LIBBPF) += bpf_map.operf-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.o 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-$(CONFIG_LIBDW) += probe-finder.operf-util-$(CONFIG_LIBDW) += dwarf-aux.operf-util-$(CONFIG_LIBDW) += dwarf-regs.operf-util-$(CONFIG_LIBDW) += dwarf-regs-csky.operf-util-$(CONFIG_LIBDW) += dwarf-regs-powerpc.operf-util-$(CONFIG_LIBDW) += dwarf-regs-x86.operf-util-$(CONFIG_LIBDW) += debuginfo.operf-util-$(CONFIG_LIBDW) += annotate-data.o perf-util-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.operf-util-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind-local.operf-util-$(CONFIG_LIBUNWIND) += unwind-libunwind.operf-util-$(CONFIG_LIBUNWIND_X86) += libunwind/x86_32.operf-util-$(CONFIG_LIBUNWIND_AARCH64) += libunwind/arm64.o ifeq ($(CONFIG_LIBTRACEEVENT),y) perf-util-$(CONFIG_LIBBABELTRACE) += 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.operf-util-$(CONFIG_LIBLLVM) += llvm-c-helpers.o 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) ifdef SHELLCHECK SHELL_TESTS := generate-cmdlist.sh TEST_LOGS := $(SHELL_TESTS:%=%.shellcheck_log)else SHELL_TESTS := TEST_LOGS :=endif $(OUTPUT)%.shellcheck_log: % $(call rule_mkdir) $(Q)$(call echo-cmd,test)shellcheck -a -S warning "$<" > $@ || (cat $@ && rm $@ && false) perf-util-y += $(TEST_LOGS)
include $(srctree)/tools/scripts/Makefile.include
include $(srctree)/tools/scripts/utilities.mak
perf-util-y += arm64-frame-pointer-unwind-support.o
perf-util-y += addr_location.o
perf-util-y += annotate.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-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 += disasm_bpf.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 += get_current_dir_name.o
perf-util-y += levenshtein.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-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 += hwmon_pmu.o
perf-util-y += tool_pmu.o
perf-util-y += svghelper.o
perf-util-$(CONFIG_LIBTRACEEVENT) += 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_AUXTRACE) += auxtrace.o
perf-util-$(CONFIG_AUXTRACE) += intel-pt-decoder/
perf-util-$(CONFIG_AUXTRACE) += intel-pt.o
perf-util-$(CONFIG_AUXTRACE) += intel-bts.o
perf-util-$(CONFIG_AUXTRACE) += arm-spe.o
perf-util-$(CONFIG_AUXTRACE) += arm-spe-decoder/
perf-util-$(CONFIG_AUXTRACE) += hisi-ptt.o
perf-util-$(CONFIG_AUXTRACE) += hisi-ptt-decoder/
perf-util-$(CONFIG_AUXTRACE) += s390-cpumsf.o
ifdef CONFIG_LIBOPENCSD
perf-util-$(CONFIG_AUXTRACE) += cs-etm.o
perf-util-$(CONFIG_AUXTRACE) += cs-etm-decoder/
endif
perf-util-$(CONFIG_AUXTRACE) += 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-$(CONFIG_X86_64) += 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
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-csky.o
perf-util-$(CONFIG_LIBDW) += dwarf-regs-powerpc.o
perf-util-$(CONFIG_LIBDW) += dwarf-regs-x86.o
perf-util-$(CONFIG_LIBDW) += debuginfo.o
perf-util-$(CONFIG_LIBDW) += annotate-data.o
perf-util-$(CONFIG_LIBDW_DWARF_UNWIND) += 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.o
perf-util-$(CONFIG_LIBLLVM) += llvm-c-helpers.o
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)
ifdef SHELLCHECK
SHELL_TESTS := generate-cmdlist.sh
TEST_LOGS := $(SHELL_TESTS:%=%.shellcheck_log)
else
SHELL_TESTS :=
TEST_LOGS :=
endif
$(OUTPUT)%.shellcheck_log: %
$(call rule_mkdir)
$(Q)$(call echo-cmd,test)shellcheck -a -S warning "$<" > $@ || (cat $@ && rm $@ && false)
perf-util-y += $(TEST_LOGS)