mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 13:11:40 +00:00
dd2e18e9ac
When looking at PT or brstackinsn traces with 'perf script' it can be very useful to see the source code. This adds a simple facility to print them with 'perf script', if the information is available through dwarf % perf record ... % perf script -F insn,ip,sym,srccode ... 4004c6 main 5 for (i = 0; i < 10000000; i++) 4004cd main 5 for (i = 0; i < 10000000; i++) 4004c6 main 5 for (i = 0; i < 10000000; i++) 4004cd main 5 for (i = 0; i < 10000000; i++) 4004cd main 5 for (i = 0; i < 10000000; i++) 4004cd main 5 for (i = 0; i < 10000000; i++) 4004cd main 5 for (i = 0; i < 10000000; i++) 4004cd main 5 for (i = 0; i < 10000000; i++) 4004b3 main 6 v++; % perf record -b ... % perf script -F insn,ip,sym,srccode,brstackinsn ... main+22: 0000000000400543 insn: e8 ca ff ff ff # PRED |18 f1(); f1: 0000000000400512 insn: 55 |10 { 0000000000400513 insn: 48 89 e5 0000000000400516 insn: b8 00 00 00 00 |11 f2(); 000000000040051b insn: e8 d6 ff ff ff # PRED f2: 00000000004004f6 insn: 55 |5 { 00000000004004f7 insn: 48 89 e5 00000000004004fa insn: 8b 05 2c 0b 20 00 |6 c = a / b; 0000000000400500 insn: 8b 0d 2a 0b 20 00 0000000000400506 insn: 99 0000000000400507 insn: f7 f9 0000000000400509 insn: 89 05 29 0b 20 00 000000000040050f insn: 90 |7 } 0000000000400510 insn: 5d 0000000000400511 insn: c3 # PRED f1+14: 0000000000400520 insn: b8 00 00 00 00 |12 f2(); 0000000000400525 insn: e8 cc ff ff ff # PRED f2: 00000000004004f6 insn: 55 |5 { 00000000004004f7 insn: 48 89 e5 00000000004004fa insn: 8b 05 2c 0b 20 00 |6 c = a / b; Not supported for callchains currently, would need some layout changes there. Committer notes: Fixed the build on Alpine Linux (3.4 .. 3.8) by addressing this warning: In file included from util/srccode.c:19:0: /usr/include/sys/fcntl.h:1:2: error: #warning redirecting incorrect #include <sys/fcntl.h> to <fcntl.h> [-Werror=cpp] #warning redirecting incorrect #include <sys/fcntl.h> to <fcntl.h> ^~~~~~~ cc1: all warnings being treated as errors Signed-off-by: Andi Kleen <ak@linux.intel.com> Tested-by: Jiri Olsa <jolsa@kernel.org> Link: http://lkml.kernel.org/r/20181204001848.24769-1-andi@firstfloor.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
227 lines
6.7 KiB
Plaintext
227 lines
6.7 KiB
Plaintext
libperf-y += annotate.o
|
|
libperf-y += block-range.o
|
|
libperf-y += build-id.o
|
|
libperf-y += config.o
|
|
libperf-y += ctype.o
|
|
libperf-y += db-export.o
|
|
libperf-y += env.o
|
|
libperf-y += event.o
|
|
libperf-y += evlist.o
|
|
libperf-y += evsel.o
|
|
libperf-y += evsel_fprintf.o
|
|
libperf-y += find_bit.o
|
|
libperf-y += get_current_dir_name.o
|
|
libperf-y += kallsyms.o
|
|
libperf-y += levenshtein.o
|
|
libperf-y += llvm-utils.o
|
|
libperf-y += mmap.o
|
|
libperf-y += memswap.o
|
|
libperf-y += parse-events.o
|
|
libperf-y += perf_regs.o
|
|
libperf-y += path.o
|
|
libperf-y += print_binary.o
|
|
libperf-y += rbtree.o
|
|
libperf-y += libstring.o
|
|
libperf-y += bitmap.o
|
|
libperf-y += hweight.o
|
|
libperf-y += smt.o
|
|
libperf-y += strbuf.o
|
|
libperf-y += string.o
|
|
libperf-y += strlist.o
|
|
libperf-y += strfilter.o
|
|
libperf-y += top.o
|
|
libperf-y += usage.o
|
|
libperf-y += dso.o
|
|
libperf-y += symbol.o
|
|
libperf-y += symbol_fprintf.o
|
|
libperf-y += color.o
|
|
libperf-y += metricgroup.o
|
|
libperf-y += header.o
|
|
libperf-y += callchain.o
|
|
libperf-y += values.o
|
|
libperf-y += debug.o
|
|
libperf-y += machine.o
|
|
libperf-y += map.o
|
|
libperf-y += pstack.o
|
|
libperf-y += session.o
|
|
libperf-$(CONFIG_TRACE) += syscalltbl.o
|
|
libperf-y += ordered-events.o
|
|
libperf-y += namespaces.o
|
|
libperf-y += comm.o
|
|
libperf-y += thread.o
|
|
libperf-y += thread_map.o
|
|
libperf-y += trace-event-parse.o
|
|
libperf-y += parse-events-flex.o
|
|
libperf-y += parse-events-bison.o
|
|
libperf-y += pmu.o
|
|
libperf-y += pmu-flex.o
|
|
libperf-y += pmu-bison.o
|
|
libperf-y += trace-event-read.o
|
|
libperf-y += trace-event-info.o
|
|
libperf-y += trace-event-scripting.o
|
|
libperf-y += trace-event.o
|
|
libperf-y += svghelper.o
|
|
libperf-y += sort.o
|
|
libperf-y += hist.o
|
|
libperf-y += util.o
|
|
libperf-y += xyarray.o
|
|
libperf-y += cpumap.o
|
|
libperf-y += cgroup.o
|
|
libperf-y += target.o
|
|
libperf-y += rblist.o
|
|
libperf-y += intlist.o
|
|
libperf-y += vdso.o
|
|
libperf-y += counts.o
|
|
libperf-y += stat.o
|
|
libperf-y += stat-shadow.o
|
|
libperf-y += stat-display.o
|
|
libperf-y += record.o
|
|
libperf-y += srcline.o
|
|
libperf-y += srccode.o
|
|
libperf-y += data.o
|
|
libperf-y += tsc.o
|
|
libperf-y += cloexec.o
|
|
libperf-y += call-path.o
|
|
libperf-y += rwsem.o
|
|
libperf-y += thread-stack.o
|
|
libperf-$(CONFIG_AUXTRACE) += auxtrace.o
|
|
libperf-$(CONFIG_AUXTRACE) += intel-pt-decoder/
|
|
libperf-$(CONFIG_AUXTRACE) += intel-pt.o
|
|
libperf-$(CONFIG_AUXTRACE) += intel-bts.o
|
|
libperf-$(CONFIG_AUXTRACE) += arm-spe.o
|
|
libperf-$(CONFIG_AUXTRACE) += arm-spe-pkt-decoder.o
|
|
libperf-$(CONFIG_AUXTRACE) += s390-cpumsf.o
|
|
|
|
ifdef CONFIG_LIBOPENCSD
|
|
libperf-$(CONFIG_AUXTRACE) += cs-etm.o
|
|
libperf-$(CONFIG_AUXTRACE) += cs-etm-decoder/
|
|
endif
|
|
|
|
libperf-y += parse-branch-options.o
|
|
libperf-y += dump-insn.o
|
|
libperf-y += parse-regs-options.o
|
|
libperf-y += term.o
|
|
libperf-y += help-unknown-cmd.o
|
|
libperf-y += mem-events.o
|
|
libperf-y += vsprintf.o
|
|
libperf-y += drv_configs.o
|
|
libperf-y += units.o
|
|
libperf-y += time-utils.o
|
|
libperf-y += expr-bison.o
|
|
libperf-y += branch.o
|
|
libperf-y += mem2node.o
|
|
|
|
libperf-$(CONFIG_LIBBPF) += bpf-loader.o
|
|
libperf-$(CONFIG_BPF_PROLOGUE) += bpf-prologue.o
|
|
libperf-$(CONFIG_LIBELF) += symbol-elf.o
|
|
libperf-$(CONFIG_LIBELF) += probe-file.o
|
|
libperf-$(CONFIG_LIBELF) += probe-event.o
|
|
|
|
ifndef CONFIG_LIBELF
|
|
libperf-y += symbol-minimal.o
|
|
endif
|
|
|
|
ifndef CONFIG_SETNS
|
|
libperf-y += setns.o
|
|
endif
|
|
|
|
libperf-$(CONFIG_DWARF) += probe-finder.o
|
|
libperf-$(CONFIG_DWARF) += dwarf-aux.o
|
|
libperf-$(CONFIG_DWARF) += dwarf-regs.o
|
|
|
|
libperf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o
|
|
libperf-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind-local.o
|
|
libperf-$(CONFIG_LIBUNWIND) += unwind-libunwind.o
|
|
libperf-$(CONFIG_LIBUNWIND_X86) += libunwind/x86_32.o
|
|
libperf-$(CONFIG_LIBUNWIND_AARCH64) += libunwind/arm64.o
|
|
|
|
libperf-$(CONFIG_LIBBABELTRACE) += data-convert-bt.o
|
|
|
|
libperf-y += scripting-engines/
|
|
|
|
libperf-$(CONFIG_ZLIB) += zlib.o
|
|
libperf-$(CONFIG_LZMA) += lzma.o
|
|
libperf-y += demangle-java.o
|
|
libperf-y += demangle-rust.o
|
|
|
|
ifdef CONFIG_JITDUMP
|
|
libperf-$(CONFIG_LIBELF) += jitdump.o
|
|
libperf-$(CONFIG_LIBELF) += genelf.o
|
|
libperf-$(CONFIG_DWARF) += genelf_debug.o
|
|
endif
|
|
|
|
libperf-y += perf-hooks.o
|
|
|
|
libperf-$(CONFIG_CXX) += c++/
|
|
|
|
CFLAGS_config.o += -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"
|
|
CFLAGS_llvm-utils.o += -DPERF_INCLUDE_DIR="BUILD_STR($(perf_include_dir_SQ))"
|
|
|
|
# avoid compiler warnings in 32-bit mode
|
|
CFLAGS_genelf_debug.o += -Wno-packed
|
|
|
|
$(OUTPUT)util/parse-events-flex.c: util/parse-events.l $(OUTPUT)util/parse-events-bison.c
|
|
$(call rule_mkdir)
|
|
$(Q)$(call echo-cmd,flex)$(FLEX) -o $@ --header-file=$(OUTPUT)util/parse-events-flex.h $(PARSER_DEBUG_FLEX) util/parse-events.l
|
|
|
|
$(OUTPUT)util/parse-events-bison.c: util/parse-events.y
|
|
$(call rule_mkdir)
|
|
$(Q)$(call echo-cmd,bison)$(BISON) -v util/parse-events.y -d $(PARSER_DEBUG_BISON) -o $@ -p parse_events_
|
|
|
|
$(OUTPUT)util/expr-bison.c: util/expr.y
|
|
$(call rule_mkdir)
|
|
$(Q)$(call echo-cmd,bison)$(BISON) -v util/expr.y -d $(PARSER_DEBUG_BISON) -o $@ -p expr__
|
|
|
|
$(OUTPUT)util/pmu-flex.c: util/pmu.l $(OUTPUT)util/pmu-bison.c
|
|
$(call rule_mkdir)
|
|
$(Q)$(call echo-cmd,flex)$(FLEX) -o $@ --header-file=$(OUTPUT)util/pmu-flex.h util/pmu.l
|
|
|
|
$(OUTPUT)util/pmu-bison.c: util/pmu.y
|
|
$(call rule_mkdir)
|
|
$(Q)$(call echo-cmd,bison)$(BISON) -v util/pmu.y -d -o $@ -p perf_pmu_
|
|
|
|
CFLAGS_parse-events-flex.o += -w
|
|
CFLAGS_pmu-flex.o += -w
|
|
CFLAGS_parse-events-bison.o += -DYYENABLE_NLS=0 -w
|
|
CFLAGS_pmu-bison.o += -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w
|
|
CFLAGS_expr-bison.o += -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -w
|
|
|
|
$(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
|
|
|
|
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_parse-events.o += -Wno-redundant-decls
|
|
CFLAGS_header.o += -include $(OUTPUT)PERF-VERSION-FILE
|
|
|
|
$(OUTPUT)util/kallsyms.o: ../lib/symbol/kallsyms.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/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)
|