blob: e3e12f9d4733eca15481421b35e0b3803ed43874 [file] [log] [blame]
Jiri Olsa5ff32882019-02-13 13:32:39 +01001perf-y += annotate.o
Jin Yao60414412019-11-07 15:47:14 +08002perf-y += block-info.o
Jiri Olsa5ff32882019-02-13 13:32:39 +01003perf-y += block-range.o
4perf-y += build-id.o
Arnaldo Carvalho de Melo12500902019-08-22 16:58:29 -03005perf-y += cacheline.o
Jiri Olsa5ff32882019-02-13 13:32:39 +01006perf-y += config.o
Arnaldo Carvalho de Melo32ff3fe2019-09-24 15:14:12 -03007perf-y += copyfile.o
Jiri Olsa5ff32882019-02-13 13:32:39 +01008perf-y += ctype.o
9perf-y += db-export.o
10perf-y += env.o
11perf-y += event.o
12perf-y += evlist.o
Arnaldo Carvalho de Melo9a399942020-05-05 12:18:21 -030013perf-y += sideband_evlist.o
Jiri Olsa5ff32882019-02-13 13:32:39 +010014perf-y += evsel.o
15perf-y += evsel_fprintf.o
Arnaldo Carvalho de Meloca125272019-09-24 15:41:51 -030016perf-y += perf_event_attr_fprintf.o
Arnaldo Carvalho de Melo8829e562019-08-15 11:00:11 -030017perf-y += evswitch.o
Jiri Olsa5ff32882019-02-13 13:32:39 +010018perf-y += find_bit.o
19perf-y += get_current_dir_name.o
20perf-y += kallsyms.o
21perf-y += levenshtein.o
22perf-y += llvm-utils.o
23perf-y += mmap.o
24perf-y += memswap.o
25perf-y += parse-events.o
26perf-y += perf_regs.o
27perf-y += path.o
28perf-y += print_binary.o
Arnaldo Carvalho de Melo49752232019-07-09 14:49:26 -030029perf-y += rlimit.o
Arnaldo Carvalho de Melo9c105482019-06-26 15:27:58 -030030perf-y += argv_split.o
Jiri Olsa5ff32882019-02-13 13:32:39 +010031perf-y += rbtree.o
32perf-y += libstring.o
33perf-y += bitmap.o
34perf-y += hweight.o
35perf-y += smt.o
36perf-y += strbuf.o
37perf-y += string.o
38perf-y += strlist.o
39perf-y += strfilter.o
40perf-y += top.o
41perf-y += usage.o
42perf-y += dso.o
Arnaldo Carvalho de Melo4a3cec82019-08-30 11:11:01 -030043perf-y += dsos.o
Jiri Olsa5ff32882019-02-13 13:32:39 +010044perf-y += symbol.o
45perf-y += symbol_fprintf.o
46perf-y += color.o
47perf-y += color_config.o
48perf-y += metricgroup.o
49perf-y += header.o
50perf-y += callchain.o
51perf-y += values.o
52perf-y += debug.o
Andi Kleend9664582019-11-20 16:15:11 -080053perf-y += fncache.o
Jiri Olsa5ff32882019-02-13 13:32:39 +010054perf-y += machine.o
55perf-y += map.o
56perf-y += pstack.o
57perf-y += session.o
58perf-y += sample-raw.o
59perf-y += s390-sample-raw.o
60perf-$(CONFIG_TRACE) += syscalltbl.o
61perf-y += ordered-events.o
62perf-y += namespaces.o
63perf-y += comm.o
64perf-y += thread.o
65perf-y += thread_map.o
66perf-y += trace-event-parse.o
67perf-y += parse-events-flex.o
68perf-y += parse-events-bison.o
69perf-y += pmu.o
70perf-y += pmu-flex.o
71perf-y += pmu-bison.o
72perf-y += trace-event-read.o
73perf-y += trace-event-info.o
74perf-y += trace-event-scripting.o
75perf-y += trace-event.o
76perf-y += svghelper.o
77perf-y += sort.o
78perf-y += hist.o
79perf-y += util.o
Jiri Olsa5ff32882019-02-13 13:32:39 +010080perf-y += cpumap.o
Andi Kleen267ed5d2019-11-20 16:15:12 -080081perf-y += affinity.o
Jiri Olsa5135d5e2019-02-19 10:58:13 +010082perf-y += cputopo.o
Jiri Olsa5ff32882019-02-13 13:32:39 +010083perf-y += cgroup.o
84perf-y += target.o
85perf-y += rblist.o
86perf-y += intlist.o
87perf-y += vdso.o
88perf-y += counts.o
89perf-y += stat.o
90perf-y += stat-shadow.o
91perf-y += stat-display.o
Arnaldo Carvalho de Melo40c7d242020-05-05 11:49:08 -030092perf-y += perf_api_probe.o
Jiri Olsa5ff32882019-02-13 13:32:39 +010093perf-y += record.o
94perf-y += srcline.o
95perf-y += srccode.o
Arnaldo Carvalho de Melo055c67e2019-09-18 16:08:52 -030096perf-y += synthetic-events.o
Jiri Olsa5ff32882019-02-13 13:32:39 +010097perf-y += data.o
98perf-y += tsc.o
99perf-y += cloexec.o
100perf-y += call-path.o
101perf-y += rwsem.o
102perf-y += thread-stack.o
Jin Yaocebf7d52019-09-25 09:14:46 +0800103perf-y += spark.o
Kan Liang687986b2020-09-11 07:48:05 -0700104perf-y += topdown.o
Jin Yao480accb2020-10-09 10:28:39 +0800105perf-y += stream.o
Jiri Olsa5ff32882019-02-13 13:32:39 +0100106perf-$(CONFIG_AUXTRACE) += auxtrace.o
107perf-$(CONFIG_AUXTRACE) += intel-pt-decoder/
108perf-$(CONFIG_AUXTRACE) += intel-pt.o
109perf-$(CONFIG_AUXTRACE) += intel-bts.o
110perf-$(CONFIG_AUXTRACE) += arm-spe.o
Tan Xiaojun4db25f62020-05-30 20:24:40 +0800111perf-$(CONFIG_AUXTRACE) += arm-spe-decoder/
Jiri Olsa5ff32882019-02-13 13:32:39 +0100112perf-$(CONFIG_AUXTRACE) += s390-cpumsf.o
Mathieu Poirier440a23b2018-01-17 10:52:11 -0700113
114ifdef CONFIG_LIBOPENCSD
Jiri Olsa5ff32882019-02-13 13:32:39 +0100115perf-$(CONFIG_AUXTRACE) += cs-etm.o
116perf-$(CONFIG_AUXTRACE) += cs-etm-decoder/
Mathieu Poirier440a23b2018-01-17 10:52:11 -0700117endif
118
Jiri Olsa5ff32882019-02-13 13:32:39 +0100119perf-y += parse-branch-options.o
120perf-y += dump-insn.o
121perf-y += parse-regs-options.o
Changbin Dua80abe22020-08-08 10:31:30 +0800122perf-y += parse-sublevel-options.o
Jiri Olsa5ff32882019-02-13 13:32:39 +0100123perf-y += term.o
124perf-y += help-unknown-cmd.o
125perf-y += mem-events.o
126perf-y += vsprintf.o
127perf-y += units.o
128perf-y += time-utils.o
Jiri Olsa26226a92020-02-28 10:36:13 +0100129perf-y += expr-flex.o
Jiri Olsa5ff32882019-02-13 13:32:39 +0100130perf-y += expr-bison.o
Jiri Olsa576a65b2020-02-28 10:36:12 +0100131perf-y += expr.o
Jiri Olsa5ff32882019-02-13 13:32:39 +0100132perf-y += branch.o
133perf-y += mem2node.o
Jiri Olsa6953beb2020-08-05 11:34:38 +0200134perf-y += clockid.o
Jiri Olsa9352aab2014-12-29 17:42:46 +0100135
Jiri Olsa5ff32882019-02-13 13:32:39 +0100136perf-$(CONFIG_LIBBPF) += bpf-loader.o
Arnaldo Carvalho de Melod19f85642019-02-19 16:11:56 -0300137perf-$(CONFIG_LIBBPF) += bpf_map.o
Song Liufa853c42020-12-29 13:42:14 -0800138perf-$(CONFIG_PERF_BPF_SKEL) += bpf_counter.o
Jiri Olsa5ff32882019-02-13 13:32:39 +0100139perf-$(CONFIG_BPF_PROLOGUE) += bpf-prologue.o
140perf-$(CONFIG_LIBELF) += symbol-elf.o
141perf-$(CONFIG_LIBELF) += probe-file.o
142perf-$(CONFIG_LIBELF) += probe-event.o
Jiri Olsa709e6792014-12-29 23:52:25 +0100143
Ian Rogerseee19502020-05-15 15:17:29 -0700144ifndef CONFIG_LIBBPF
145perf-y += hashmap.o
146endif
147
Jiri Olsa709e6792014-12-29 23:52:25 +0100148ifndef CONFIG_LIBELF
Jiri Olsa5ff32882019-02-13 13:32:39 +0100149perf-y += symbol-minimal.o
Jiri Olsa709e6792014-12-29 23:52:25 +0100150endif
151
Arnaldo Carvalho de Melo86bcdb52017-07-18 17:15:29 -0300152ifndef CONFIG_SETNS
Jiri Olsa5ff32882019-02-13 13:32:39 +0100153perf-y += setns.o
Arnaldo Carvalho de Melo86bcdb52017-07-18 17:15:29 -0300154endif
155
Jiri Olsa5ff32882019-02-13 13:32:39 +0100156perf-$(CONFIG_DWARF) += probe-finder.o
157perf-$(CONFIG_DWARF) += dwarf-aux.o
158perf-$(CONFIG_DWARF) += dwarf-regs.o
Jiri Olsa8379fce2014-12-30 00:06:25 +0100159
Jiri Olsa5ff32882019-02-13 13:32:39 +0100160perf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o
161perf-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind-local.o
162perf-$(CONFIG_LIBUNWIND) += unwind-libunwind.o
163perf-$(CONFIG_LIBUNWIND_X86) += libunwind/x86_32.o
164perf-$(CONFIG_LIBUNWIND_AARCH64) += libunwind/arm64.o
Jiri Olsab2e45c32014-12-30 00:11:11 +0100165
Jiri Olsa5ff32882019-02-13 13:32:39 +0100166perf-$(CONFIG_LIBBABELTRACE) += data-convert-bt.o
Jiri Olsaedbe9812015-02-20 23:17:00 +0100167
Jiri Olsa5ff32882019-02-13 13:32:39 +0100168perf-y += scripting-engines/
Jiri Olsac7355f82014-12-30 13:11:32 +0100169
Jiri Olsa5ff32882019-02-13 13:32:39 +0100170perf-$(CONFIG_ZLIB) += zlib.o
171perf-$(CONFIG_LZMA) += lzma.o
Alexey Budankovf24c1d72019-03-18 20:42:55 +0300172perf-$(CONFIG_ZSTD) += zstd.o
173
Igor Lubashevc22e1502019-08-07 10:44:14 -0400174perf-$(CONFIG_LIBCAP) += cap.o
175
Fabian Hemmercef7af22021-02-03 16:15:37 -0500176perf-y += demangle-ocaml.o
Jiri Olsa5ff32882019-02-13 13:32:39 +0100177perf-y += demangle-java.o
178perf-y += demangle-rust.o
Arnaldo Carvalho de Melo46dad052016-03-07 18:48:45 -0300179
Jiri Olsae12b2022016-03-10 17:41:13 +0100180ifdef CONFIG_JITDUMP
Jiri Olsa5ff32882019-02-13 13:32:39 +0100181perf-$(CONFIG_LIBELF) += jitdump.o
182perf-$(CONFIG_LIBELF) += genelf.o
183perf-$(CONFIG_DWARF) += genelf_debug.o
Arnaldo Carvalho de Melo46dad052016-03-07 18:48:45 -0300184endif
Jiri Olsa3bc33742014-12-30 13:30:04 +0100185
Jiri Olsa5ff32882019-02-13 13:32:39 +0100186perf-y += perf-hooks.o
Wang Nana0748652016-11-26 07:03:28 +0000187
Jiri Olsa5ff32882019-02-13 13:32:39 +0100188perf-$(CONFIG_LIBBPF) += bpf-event.o
Song Liu45178a92019-01-17 08:15:18 -0800189
Jiri Olsa5ff32882019-02-13 13:32:39 +0100190perf-$(CONFIG_CXX) += c++/
Wang Nan00b86692016-11-26 07:03:34 +0000191
Stephane Eranian70943492020-05-05 11:29:43 -0700192perf-$(CONFIG_LIBPFM4) += pfm.o
193
Jiri Olsa9352aab2014-12-29 17:42:46 +0100194CFLAGS_config.o += -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"
Arnaldo Carvalho de Melo1b16fff2018-05-04 10:37:27 -0300195CFLAGS_llvm-utils.o += -DPERF_INCLUDE_DIR="BUILD_STR($(perf_include_dir_SQ))"
196
Stephane Eranian598b7c62015-11-30 10:02:23 +0100197# avoid compiler warnings in 32-bit mode
198CFLAGS_genelf_debug.o += -Wno-packed
Jiri Olsa9352aab2014-12-29 17:42:46 +0100199
Ian Rogers4b971df2020-06-18 21:33:51 -0700200$(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-flex.h: util/parse-events.l $(OUTPUT)util/parse-events-bison.c
Jiri Olsa19993072014-12-30 18:44:38 +0100201 $(call rule_mkdir)
Ian Rogers4b971df2020-06-18 21:33:51 -0700202 $(Q)$(call echo-cmd,flex)$(FLEX) -o $(OUTPUT)util/parse-events-flex.c \
203 --header-file=$(OUTPUT)util/parse-events-flex.h $(PARSER_DEBUG_FLEX) $<
Jiri Olsa9352aab2014-12-29 17:42:46 +0100204
Ian Rogersef9894d2020-06-18 21:33:52 -0700205$(OUTPUT)util/parse-events-bison.c $(OUTPUT)util/parse-events-bison.h: util/parse-events.y
Jiri Olsa19993072014-12-30 18:44:38 +0100206 $(call rule_mkdir)
Ian Rogersef9894d2020-06-18 21:33:52 -0700207 $(Q)$(call echo-cmd,bison)$(BISON) -v $< -d $(PARSER_DEBUG_BISON) \
208 -o $(OUTPUT)util/parse-events-bison.c -p parse_events_
Jiri Olsa9352aab2014-12-29 17:42:46 +0100209
Ian Rogers4b971df2020-06-18 21:33:51 -0700210$(OUTPUT)util/expr-flex.c $(OUTPUT)util/expr-flex.h: util/expr.l $(OUTPUT)util/expr-bison.c
Jiri Olsa26226a92020-02-28 10:36:13 +0100211 $(call rule_mkdir)
Ian Rogers4b971df2020-06-18 21:33:51 -0700212 $(Q)$(call echo-cmd,flex)$(FLEX) -o $(OUTPUT)util/expr-flex.c \
213 --header-file=$(OUTPUT)util/expr-flex.h $(PARSER_DEBUG_FLEX) $<
Jiri Olsa26226a92020-02-28 10:36:13 +0100214
Ian Rogersef9894d2020-06-18 21:33:52 -0700215$(OUTPUT)util/expr-bison.c $(OUTPUT)util/expr-bison.h: util/expr.y
Andi Kleen07516732017-03-20 13:17:05 -0700216 $(call rule_mkdir)
Ian Rogersef9894d2020-06-18 21:33:52 -0700217 $(Q)$(call echo-cmd,bison)$(BISON) -v $< -d $(PARSER_DEBUG_BISON) \
218 -o $(OUTPUT)util/expr-bison.c -p expr_
Andi Kleen07516732017-03-20 13:17:05 -0700219
Ian Rogers4b971df2020-06-18 21:33:51 -0700220$(OUTPUT)util/pmu-flex.c $(OUTPUT)util/pmu-flex.h: util/pmu.l $(OUTPUT)util/pmu-bison.c
Jiri Olsa19993072014-12-30 18:44:38 +0100221 $(call rule_mkdir)
Ian Rogers4b971df2020-06-18 21:33:51 -0700222 $(Q)$(call echo-cmd,flex)$(FLEX) -o $(OUTPUT)util/pmu-flex.c \
223 --header-file=$(OUTPUT)util/pmu-flex.h $(PARSER_DEBUG_FLEX) $<
Jiri Olsa9352aab2014-12-29 17:42:46 +0100224
Ian Rogersef9894d2020-06-18 21:33:52 -0700225$(OUTPUT)util/pmu-bison.c $(OUTPUT)util/pmu-bison.h: util/pmu.y
Jiri Olsa19993072014-12-30 18:44:38 +0100226 $(call rule_mkdir)
Ian Rogersef9894d2020-06-18 21:33:52 -0700227 $(Q)$(call echo-cmd,bison)$(BISON) -v $< -d $(PARSER_DEBUG_BISON) \
228 -o $(OUTPUT)util/pmu-bison.c -p perf_pmu_
Jiri Olsa9352aab2014-12-29 17:42:46 +0100229
Ian Rogers304d7a92020-06-18 21:33:53 -0700230FLEX_GE_26 := $(shell expr $(shell $(FLEX) --version | sed -e 's/flex \([0-9]\+\).\([0-9]\+\)/\1\2/g') \>\= 26)
231ifeq ($(FLEX_GE_26),1)
232 flex_flags := -Wno-switch-enum -Wno-switch-default -Wno-unused-function -Wno-redundant-decls -Wno-sign-compare -Wno-unused-parameter -Wno-missing-prototypes -Wno-missing-declarations
233 CC_HASNT_MISLEADING_INDENTATION := $(shell echo "int main(void) { return 0 }" | $(CC) -Werror -Wno-misleading-indentation -o /dev/null -xc - 2>&1 | grep -q -- -Wno-misleading-indentation ; echo $$?)
234 ifeq ($(CC_HASNT_MISLEADING_INDENTATION), 1)
235 flex_flags += -Wno-misleading-indentation
236 endif
237else
238 flex_flags := -w
239endif
240CFLAGS_parse-events-flex.o += $(flex_flags)
241CFLAGS_pmu-flex.o += $(flex_flags)
242CFLAGS_expr-flex.o += $(flex_flags)
Ian Rogers1f16fca2020-06-18 21:33:56 -0700243
244bison_flags := -DYYENABLE_NLS=0
245BISON_GE_35 := $(shell expr $(shell $(BISON) --version | grep bison | sed -e 's/.\+ \([0-9]\+\).\([0-9]\+\)/\1\2/g') \>\= 35)
246ifeq ($(BISON_GE_35),1)
247 bison_flags += -Wno-unused-parameter -Wno-nested-externs -Wno-implicit-function-declaration -Wno-switch-enum
248else
249 bison_flags += -w
250endif
251CFLAGS_parse-events-bison.o += $(bison_flags)
252CFLAGS_pmu-bison.o += -DYYLTYPE_IS_TRIVIAL=0 $(bison_flags)
253CFLAGS_expr-bison.o += -DYYLTYPE_IS_TRIVIAL=0 $(bison_flags)
Jiri Olsa9352aab2014-12-29 17:42:46 +0100254
255$(OUTPUT)util/parse-events.o: $(OUTPUT)util/parse-events-flex.c $(OUTPUT)util/parse-events-bison.c
256$(OUTPUT)util/pmu.o: $(OUTPUT)util/pmu-flex.c $(OUTPUT)util/pmu-bison.c
Jiri Olsa26226a92020-02-28 10:36:13 +0100257$(OUTPUT)util/expr.o: $(OUTPUT)util/expr-flex.c $(OUTPUT)util/expr-bison.c
Jiri Olsa9352aab2014-12-29 17:42:46 +0100258
Arnaldo Carvalho de Melo915b0882016-01-08 12:33:37 -0300259CFLAGS_bitmap.o += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"
Arnaldo Carvalho de Melo552eb9752016-01-08 10:46:52 -0300260CFLAGS_find_bit.o += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"
Jiri Olsa9352aab2014-12-29 17:42:46 +0100261CFLAGS_rbtree.o += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"
Arnaldo Carvalho de Melo4ddd3272015-11-16 11:36:29 -0300262CFLAGS_libstring.o += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"
Jiri Olsa9352aab2014-12-29 17:42:46 +0100263CFLAGS_hweight.o += -Wno-unused-parameter -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"
264CFLAGS_parse-events.o += -Wno-redundant-decls
Jiri Olsa26226a92020-02-28 10:36:13 +0100265CFLAGS_expr.o += -Wno-redundant-decls
Soramichi AKIYAMAd25ed5d2017-01-17 00:22:37 +0900266CFLAGS_header.o += -include $(OUTPUT)PERF-VERSION-FILE
Jiri Olsa9352aab2014-12-29 17:42:46 +0100267
268$(OUTPUT)util/kallsyms.o: ../lib/symbol/kallsyms.c FORCE
Jiri Olsa19993072014-12-30 18:44:38 +0100269 $(call rule_mkdir)
Jiri Olsa9352aab2014-12-29 17:42:46 +0100270 $(call if_changed_dep,cc_o_c)
271
Arnaldo Carvalho de Melo9c105482019-06-26 15:27:58 -0300272$(OUTPUT)util/argv_split.o: ../lib/argv_split.c FORCE
273 $(call rule_mkdir)
274 $(call if_changed_dep,cc_o_c)
275
Arnaldo Carvalho de Melo915b0882016-01-08 12:33:37 -0300276$(OUTPUT)util/bitmap.o: ../lib/bitmap.c FORCE
277 $(call rule_mkdir)
278 $(call if_changed_dep,cc_o_c)
279
Arnaldo Carvalho de Melo3052ba52019-06-25 17:27:31 -0300280$(OUTPUT)util/ctype.o: ../lib/ctype.c FORCE
281 $(call rule_mkdir)
282 $(call if_changed_dep,cc_o_c)
283
Arnaldo Carvalho de Melo552eb9752016-01-08 10:46:52 -0300284$(OUTPUT)util/find_bit.o: ../lib/find_bit.c FORCE
Jiri Olsa19993072014-12-30 18:44:38 +0100285 $(call rule_mkdir)
Jiri Olsa9352aab2014-12-29 17:42:46 +0100286 $(call if_changed_dep,cc_o_c)
287
Arnaldo Carvalho de Melo3f735372015-07-05 22:48:21 -0300288$(OUTPUT)util/rbtree.o: ../lib/rbtree.c FORCE
Jiri Olsa19993072014-12-30 18:44:38 +0100289 $(call rule_mkdir)
Jiri Olsa9352aab2014-12-29 17:42:46 +0100290 $(call if_changed_dep,cc_o_c)
291
Arnaldo Carvalho de Melo4ddd3272015-11-16 11:36:29 -0300292$(OUTPUT)util/libstring.o: ../lib/string.c FORCE
293 $(call rule_mkdir)
294 $(call if_changed_dep,cc_o_c)
295
Arnaldo Carvalho de Melo0aefc352015-07-09 16:27:25 -0300296$(OUTPUT)util/hweight.o: ../lib/hweight.c FORCE
Jiri Olsa19993072014-12-30 18:44:38 +0100297 $(call rule_mkdir)
Jiri Olsa9352aab2014-12-29 17:42:46 +0100298 $(call if_changed_dep,cc_o_c)
Arnaldo Carvalho de Melod0761e32016-07-07 15:42:33 -0300299
300$(OUTPUT)util/vsprintf.o: ../lib/vsprintf.c FORCE
301 $(call rule_mkdir)
302 $(call if_changed_dep,cc_o_c)