perf tools: Assorted fixes
Jiri Olsa
reviewercover perf tools: Assorted fixes
hi,
sending assorted general fixes that queued
up in my other branches.
Also available in here:
https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
perf/fixes
thanks,
jirka
---
Jiri Olsa (10):
perf tools: Compile perf with libperf-in.o instead of libperf.a perf tools: Rename LIB_FILE to LIBPERF_A
perf tools: Rename build libperf to perf
perf tools: Fix legacy events symbol separator parsing perf list: Display metric expressions for --details option perf header: Fix wrong node write in NUMA_TOPOLOGY feature perf header: Get rid of write_it label
perf header: Remove cpu_nr from struct cpu_topo
perf tools: Add perf_topo_cpu object
perf tools: Add perf_topo_numa object
tools/perf/Build | 10 +++--- tools/perf/Makefile.perf | 22 ++++++------ tools/perf/arch/Build | 4 +-- tools/perf/arch/arm/Build | 4 +-- tools/perf/arch/arm/tests/Build | 8 ++--- tools/perf/arch/arm/util/Build | 8 ++--- tools/perf/arch/arm64/Build | 4 +-- tools/perf/arch/arm64/tests/Build | 6 ++-- tools/perf/arch/arm64/util/Build | 12 +++---- tools/perf/arch/nds32/Build | 2 +- tools/perf/arch/nds32/util/Build | 2 +- tools/perf/arch/powerpc/Build | 4 +-- tools/perf/arch/powerpc/tests/Build | 6 ++-- tools/perf/arch/powerpc/util/Build | 18 +++++----- tools/perf/arch/s390/Build | 2 +- tools/perf/arch/s390/util/Build | 12 +++---- tools/perf/arch/sh/Build | 2 +- tools/perf/arch/sh/util/Build | 2 +- tools/perf/arch/sparc/Build | 2 +- tools/perf/arch/sparc/util/Build | 2 +- tools/perf/arch/x86/Build | 4 +-- tools/perf/arch/x86/tests/Build | 14 ++++---- tools/perf/arch/x86/util/Build | 30 ++++++++-------- tools/perf/arch/xtensa/Build | 2 +- tools/perf/arch/xtensa/util/Build | 2 +- tools/perf/builtin-list.c | 8 ++--- tools/perf/scripts/Build | 4 +-- tools/perf/scripts/perl/Perf-Trace-Util/Build | 2 +- tools/perf/scripts/python/Perf-Trace-Util/Build | 2 +- tools/perf/tests/parse-events.c | 30 ++++++++++++++++ tools/perf/trace/beauty/Build | 26 +++++++------- tools/perf/ui/Build | 18 +++++----- tools/perf/ui/browsers/Build | 10 +++--- tools/perf/ui/tui/Build | 8 ++--- tools/perf/util/Build | 277 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------- tools/perf/util/c++/Build | 4 +-- tools/perf/util/cputopo.c | 264 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ tools/perf/util/cputopo.h | 33 +++++++++++++++++ tools/perf/util/cs-etm-decoder/Build | 2 +- tools/perf/util/header.c | 277 +++++++++++++++++------------------------------------------------------------------------------------------------------------------------------ tools/perf/util/intel-pt-decoder/Build | 2 +- tools/perf/util/metricgroup.c | 8 ++++- tools/perf/util/metricgroup.h | 3 +- tools/perf/util/parse-events.c | 2 +- tools/perf/util/parse-events.y | 4 +-- tools/perf/util/scripting-engines/Build | 4 +-- 46 files changed, 647 insertions(+), 525 deletions(-) create mode 100644 tools/perf/util/cputopo.c create mode 100644 tools/perf/util/cputopo.h
Jiri Olsa
reviewerPATCH 1/10 perf tools: Compile perf with libperf-in.o instead of libperf.a
There's no need for perf build to use libperf.a,
we can use directly libperf-in.o.
The libperf.a stays as a target if needed:
$ make libperf.a
...
CC util/pmu.o
CC util/pmu-flex.o
LD util/libperf-in.o
LD libperf-in.o
AR libperf.a--- tools/perf/Makefile.perf | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
tools/perf/Makefile.perf +8 -8
@@ -346,7 +346,7 @@ export PERL_PATH LIB_FILE=$(OUTPUT)libperf.a -PERFLIBS = $(LIB_FILE) $(LIBAPI) $(LIBTRACEEVENT) $(LIBSUBCMD) +PERFLIBS = $(LIBAPI) $(LIBTRACEEVENT) $(LIBSUBCMD) ifndef NO_LIBBPF PERFLIBS += $(LIBBPF) endif
@@ -549,6 +549,8 @@ JEVENTS_IN := $(OUTPUT)pmu-events/jevents-in.o PMU_EVENTS_IN := $(OUTPUT)pmu-events/pmu-events-in.o +LIBPERF_IN := $(OUTPUT)libperf-in.o + export JEVENTS build := -f $(srctree)/tools/build/Makefile.build dir=. obj
@@ -565,9 +567,12 @@ $(JEVENTS): $(JEVENTS_IN) $(PMU_EVENTS_IN): $(JEVENTS) FORCE $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=pmu-events obj=pmu-events -$(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(PMU_EVENTS_IN) $(LIBTRACEEVENT_DYNAMIC_LIST) +$(LIBPERF_IN): prepare FORCE + $(Q)$(MAKE) $(build)=libperf + +$(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(PMU_EVENTS_IN) $(LIBPERF_IN) $(LIBTRACEEVENT_DYNAMIC_LIST) $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS) \ - $(PERF_IN) $(PMU_EVENTS_IN) $(LIBS) -o $@ + $(PERF_IN) $(PMU_EVENTS_IN) $(LIBPERF_IN) $(LIBS) -o $@ $(GTK_IN): FORCE $(Q)$(MAKE) $(build)=gtk
@@ -683,11 +688,6 @@ endif $(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h) -LIBPERF_IN := $(OUTPUT)libperf-in.o - -$(LIBPERF_IN): prepare FORCE - $(Q)$(MAKE) $(build)=libperf - $(LIB_FILE): $(LIBPERF_IN) $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIBPERF_IN) $(LIB_OBJS)
Signature · 1 line
2.17.2
Jiri Olsa
reviewerPATCH 2/10 perf tools: Rename LIB_FILE to LIBPERF_A
In reply to Jiri OlsaSimple rename, no functional change.
--- tools/perf/Makefile.perf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tools/perf/Makefile.perf +3 -3
@@ -344,7 +344,7 @@ endif export PERL_PATH -LIB_FILE=$(OUTPUT)libperf.a +LIBPERF_A=$(OUTPUT)libperf.a PERFLIBS = $(LIBAPI) $(LIBTRACEEVENT) $(LIBSUBCMD) ifndef NO_LIBBPF
@@ -688,7 +688,7 @@ endif $(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h) -$(LIB_FILE): $(LIBPERF_IN) +$(LIBPERF_A): $(LIBPERF_IN) $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIBPERF_IN) $(LIB_OBJS) LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ) 'EXTRA_CFLAGS=$(EXTRA_CFLAGS)' 'LDFLAGS=$(LDFLAGS)'
@@ -910,7 +910,7 @@ python-clean: $(python-clean) clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean config-clean fixdep-clean python-clean - $(call QUIET_CLEAN, core-objs) $(RM) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(LANG_BINDINGS) + $(call QUIET_CLEAN, core-objs) $(RM) $(LIBPERF_A) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(LANG_BINDINGS) $(Q)find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete $(Q)$(RM) $(OUTPUT).config-detected $(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf perf-read-vdso32 perf-read-vdsox32 $(OUTPUT)pmu-events/jevents $(OUTPUT)$(LIBJVMTI).so
Signature · 1 line
2.17.2
Jiri Olsa
reviewerPATCH 3/10 perf tools: Rename build libperf to perf
In reply to Jiri OlsaRenaming build libperf to perf, because it's used to build perf. The libperf build object name will be used for libperf library.
--- tools/perf/Build | 10 +- tools/perf/arch/Build | 4 +- tools/perf/arch/arm/Build | 4 +- tools/perf/arch/arm/tests/Build | 8 +- tools/perf/arch/arm/util/Build | 8 +- tools/perf/arch/arm64/Build | 4 +- tools/perf/arch/arm64/tests/Build | 6 +- tools/perf/arch/arm64/util/Build | 12 +- tools/perf/arch/nds32/Build | 2 +- tools/perf/arch/nds32/util/Build | 2 +- tools/perf/arch/powerpc/Build | 4 +- tools/perf/arch/powerpc/tests/Build | 6 +- tools/perf/arch/powerpc/util/Build | 18 +- tools/perf/arch/s390/Build | 2 +- tools/perf/arch/s390/util/Build | 12 +- tools/perf/arch/sh/Build | 2 +- tools/perf/arch/sh/util/Build | 2 +- tools/perf/arch/sparc/Build | 2 +- tools/perf/arch/sparc/util/Build | 2 +- tools/perf/arch/x86/Build | 4 +- tools/perf/arch/x86/tests/Build | 14 +- tools/perf/arch/x86/util/Build | 30 +- tools/perf/arch/xtensa/Build | 2 +- tools/perf/arch/xtensa/util/Build | 2 +- tools/perf/scripts/Build | 4 +- tools/perf/scripts/perl/Perf-Trace-Util/Build | 2 +- .../perf/scripts/python/Perf-Trace-Util/Build | 2 +- tools/perf/trace/beauty/Build | 26 +- tools/perf/ui/Build | 18 +- tools/perf/ui/browsers/Build | 10 +- tools/perf/ui/tui/Build | 8 +- tools/perf/util/Build | 276 +++++++++--------- tools/perf/util/c++/Build | 4 +- tools/perf/util/cs-etm-decoder/Build | 2 +- tools/perf/util/intel-pt-decoder/Build | 2 +- tools/perf/util/scripting-engines/Build | 4 +- 36 files changed, 260 insertions(+), 260 deletions(-)
tools/perf/Build +5 -5
@@ -46,10 +46,10 @@ CFLAGS_builtin-trace.o += -DSTRACE_GROUPS_DIR="BUILD_STR($(STRACE_GROUPS_DIR_ CFLAGS_builtin-report.o += -DTIPDIR="BUILD_STR($(tipdir_SQ))" CFLAGS_builtin-report.o += -DDOCDIR="BUILD_STR($(srcdir_SQ)/Documentation)" -libperf-y += util/ -libperf-y += arch/ -libperf-y += ui/ -libperf-y += scripts/ -libperf-$(CONFIG_TRACE) += trace/beauty/ +perf-y += util/ +perf-y += arch/ +perf-y += ui/ +perf-y += scripts/ +perf-$(CONFIG_TRACE) += trace/beauty/ gtk-y += ui/gtk/
tools/perf/arch/Build +2 -2
@@ -1,2 +1,2 @@ -libperf-y += common.o -libperf-y += $(SRCARCH)/ +perf-y += common.o +perf-y += $(SRCARCH)/
tools/perf/arch/arm/Build +2 -2
@@ -1,2 +1,2 @@ -libperf-y += util/ -libperf-$(CONFIG_DWARF_UNWIND) += tests/ +perf-y += util/ +perf-$(CONFIG_DWARF_UNWIND) += tests/
tools/perf/arch/arm/tests/Build +4 -4
@@ -1,5 +1,5 @@ -libperf-y += regs_load.o -libperf-y += dwarf-unwind.o -libperf-y += vectors-page.o +perf-y += regs_load.o +perf-y += dwarf-unwind.o +perf-y += vectors-page.o -libperf-y += arch-tests.o +perf-y += arch-tests.o
tools/perf/arch/arm/util/Build +4 -4
@@ -1,6 +1,6 @@ -libperf-$(CONFIG_DWARF) += dwarf-regs.o +perf-$(CONFIG_DWARF) += dwarf-regs.o -libperf-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o -libperf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o +perf-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o +perf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o -libperf-$(CONFIG_AUXTRACE) += pmu.o auxtrace.o cs-etm.o +perf-$(CONFIG_AUXTRACE) += pmu.o auxtrace.o cs-etm.o
tools/perf/arch/arm64/Build +2 -2
@@ -1,2 +1,2 @@ -libperf-y += util/ -libperf-$(CONFIG_DWARF_UNWIND) += tests/ +perf-y += util/ +perf-$(CONFIG_DWARF_UNWIND) += tests/
tools/perf/arch/arm64/tests/Build +3 -3
@@ -1,4 +1,4 @@ -libperf-y += regs_load.o -libperf-y += dwarf-unwind.o +perf-y += regs_load.o +perf-y += dwarf-unwind.o -libperf-y += arch-tests.o +perf-y += arch-tests.o
tools/perf/arch/arm64/util/Build +6 -6
@@ -1,10 +1,10 @@ -libperf-y += header.o -libperf-y += sym-handling.o -libperf-$(CONFIG_DWARF) += dwarf-regs.o -libperf-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o -libperf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o +perf-y += header.o +perf-y += sym-handling.o +perf-$(CONFIG_DWARF) += dwarf-regs.o +perf-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o +perf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o -libperf-$(CONFIG_AUXTRACE) += ../../arm/util/pmu.o \ +perf-$(CONFIG_AUXTRACE) += ../../arm/util/pmu.o \ ../../arm/util/auxtrace.o \ ../../arm/util/cs-etm.o \ arm-spe.o
tools/perf/arch/nds32/Build +1 -1
@@ -1 +1 @@ -libperf-y += util/ +perf-y += util/
tools/perf/arch/nds32/util/Build +1 -1
@@ -1 +1 @@ -libperf-y += header.o +perf-y += header.o
tools/perf/arch/powerpc/Build +2 -2
@@ -1,2 +1,2 @@ -libperf-y += util/ -libperf-y += tests/ +perf-y += util/ +perf-y += tests/
tools/perf/arch/powerpc/tests/Build +3 -3
@@ -1,4 +1,4 @@ -libperf-$(CONFIG_DWARF_UNWIND) += regs_load.o -libperf-$(CONFIG_DWARF_UNWIND) += dwarf-unwind.o +perf-$(CONFIG_DWARF_UNWIND) += regs_load.o +perf-$(CONFIG_DWARF_UNWIND) += dwarf-unwind.o -libperf-y += arch-tests.o +perf-y += arch-tests.o
tools/perf/arch/powerpc/util/Build +9 -9
@@ -1,11 +1,11 @@ -libperf-y += header.o -libperf-y += sym-handling.o -libperf-y += kvm-stat.o -libperf-y += perf_regs.o -libperf-y += mem-events.o +perf-y += header.o +perf-y += sym-handling.o +perf-y += kvm-stat.o +perf-y += perf_regs.o +perf-y += mem-events.o -libperf-$(CONFIG_DWARF) += dwarf-regs.o -libperf-$(CONFIG_DWARF) += skip-callchain-idx.o +perf-$(CONFIG_DWARF) += dwarf-regs.o +perf-$(CONFIG_DWARF) += skip-callchain-idx.o -libperf-$(CONFIG_LIBUNWIND) += unwind-libunwind.o -libperf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o +perf-$(CONFIG_LIBUNWIND) += unwind-libunwind.o +perf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o
tools/perf/arch/s390/Build +1 -1
@@ -1 +1 @@ -libperf-y += util/ +perf-y += util/
tools/perf/arch/s390/util/Build +6 -6
@@ -1,9 +1,9 @@ -libperf-y += header.o -libperf-y += kvm-stat.o +perf-y += header.o +perf-y += kvm-stat.o -libperf-$(CONFIG_DWARF) += dwarf-regs.o -libperf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o +perf-$(CONFIG_DWARF) += dwarf-regs.o +perf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o -libperf-y += machine.o +perf-y += machine.o -libperf-$(CONFIG_AUXTRACE) += auxtrace.o +perf-$(CONFIG_AUXTRACE) += auxtrace.o
tools/perf/arch/sh/Build +1 -1
@@ -1 +1 @@ -libperf-y += util/ +perf-y += util/
tools/perf/arch/sh/util/Build +1 -1
@@ -1 +1 @@ -libperf-$(CONFIG_DWARF) += dwarf-regs.o +perf-$(CONFIG_DWARF) += dwarf-regs.o
tools/perf/arch/sparc/Build +1 -1
@@ -1 +1 @@ -libperf-y += util/ +perf-y += util/
tools/perf/arch/sparc/util/Build +1 -1
@@ -1 +1 @@ -libperf-$(CONFIG_DWARF) += dwarf-regs.o +perf-$(CONFIG_DWARF) += dwarf-regs.o
tools/perf/arch/x86/Build +2 -2
@@ -1,2 +1,2 @@ -libperf-y += util/ -libperf-y += tests/ +perf-y += util/ +perf-y += tests/
tools/perf/arch/x86/tests/Build +7 -7
@@ -1,8 +1,8 @@ -libperf-$(CONFIG_DWARF_UNWIND) += regs_load.o -libperf-$(CONFIG_DWARF_UNWIND) += dwarf-unwind.o +perf-$(CONFIG_DWARF_UNWIND) += regs_load.o +perf-$(CONFIG_DWARF_UNWIND) += dwarf-unwind.o -libperf-y += arch-tests.o -libperf-y += rdpmc.o -libperf-y += perf-time-to-tsc.o -libperf-$(CONFIG_AUXTRACE) += insn-x86.o -libperf-$(CONFIG_X86_64) += bp-modify.o +perf-y += arch-tests.o +perf-y += rdpmc.o +perf-y += perf-time-to-tsc.o +perf-$(CONFIG_AUXTRACE) += insn-x86.o +perf-$(CONFIG_X86_64) += bp-modify.o
tools/perf/arch/x86/util/Build +15 -15
@@ -1,18 +1,18 @@ -libperf-y += header.o -libperf-y += tsc.o -libperf-y += pmu.o -libperf-y += kvm-stat.o -libperf-y += perf_regs.o -libperf-y += group.o -libperf-y += machine.o -libperf-y += event.o +perf-y += header.o +perf-y += tsc.o +perf-y += pmu.o +perf-y += kvm-stat.o +perf-y += perf_regs.o +perf-y += group.o +perf-y += machine.o +perf-y += event.o -libperf-$(CONFIG_DWARF) += dwarf-regs.o -libperf-$(CONFIG_BPF_PROLOGUE) += dwarf-regs.o +perf-$(CONFIG_DWARF) += dwarf-regs.o +perf-$(CONFIG_BPF_PROLOGUE) += dwarf-regs.o -libperf-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o -libperf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o +perf-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o +perf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o -libperf-$(CONFIG_AUXTRACE) += auxtrace.o -libperf-$(CONFIG_AUXTRACE) += intel-pt.o -libperf-$(CONFIG_AUXTRACE) += intel-bts.o +perf-$(CONFIG_AUXTRACE) += auxtrace.o +perf-$(CONFIG_AUXTRACE) += intel-pt.o +perf-$(CONFIG_AUXTRACE) += intel-bts.o
tools/perf/arch/xtensa/Build +1 -1
@@ -1 +1 @@ -libperf-y += util/ +perf-y += util/
tools/perf/arch/xtensa/util/Build +1 -1
@@ -1 +1 @@ -libperf-$(CONFIG_DWARF) += dwarf-regs.o +perf-$(CONFIG_DWARF) += dwarf-regs.o
tools/perf/scripts/Build +2 -2
@@ -1,2 +1,2 @@ -libperf-$(CONFIG_LIBPERL) += perl/Perf-Trace-Util/ -libperf-$(CONFIG_LIBPYTHON) += python/Perf-Trace-Util/ +perf-$(CONFIG_LIBPERL) += perl/Perf-Trace-Util/ +perf-$(CONFIG_LIBPYTHON) += python/Perf-Trace-Util/
tools/perf/scripts/perl/Perf-Trace-Util/Build +1 -1
@@ -1,4 +1,4 @@ -libperf-y += Context.o +perf-y += Context.o CFLAGS_Context.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes CFLAGS_Context.o += -Wno-unused-parameter -Wno-nested-externs -Wno-undef
tools/perf/scripts/python/Perf-Trace-Util/Build +1 -1
@@ -1,3 +1,3 @@ -libperf-y += Context.o +perf-y += Context.o CFLAGS_Context.o += $(PYTHON_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs
tools/perf/trace/beauty/Build +13 -13
@@ -1,15 +1,15 @@ -libperf-y += clone.o -libperf-y += fcntl.o -libperf-y += flock.o +perf-y += clone.o +perf-y += fcntl.o +perf-y += flock.o ifeq ($(SRCARCH),$(filter $(SRCARCH),x86)) -libperf-y += ioctl.o +perf-y += ioctl.o endif -libperf-y += kcmp.o -libperf-y += mount_flags.o -libperf-y += pkey_alloc.o -libperf-y += arch_prctl.o -libperf-y += prctl.o -libperf-y += renameat.o -libperf-y += sockaddr.o -libperf-y += socket.o -libperf-y += statx.o +perf-y += kcmp.o +perf-y += mount_flags.o +perf-y += pkey_alloc.o +perf-y += arch_prctl.o +perf-y += prctl.o +perf-y += renameat.o +perf-y += sockaddr.o +perf-y += socket.o +perf-y += statx.o
tools/perf/ui/Build +9 -9
@@ -1,14 +1,14 @@ -libperf-y += setup.o -libperf-y += helpline.o -libperf-y += progress.o -libperf-y += util.o -libperf-y += hist.o -libperf-y += stdio/hist.o +perf-y += setup.o +perf-y += helpline.o +perf-y += progress.o +perf-y += util.o +perf-y += hist.o +perf-y += stdio/hist.o CFLAGS_setup.o += -DLIBDIR="BUILD_STR($(LIBDIR))" -libperf-$(CONFIG_SLANG) += browser.o -libperf-$(CONFIG_SLANG) += browsers/ -libperf-$(CONFIG_SLANG) += tui/ +perf-$(CONFIG_SLANG) += browser.o +perf-$(CONFIG_SLANG) += browsers/ +perf-$(CONFIG_SLANG) += tui/ CFLAGS_browser.o += -DENABLE_SLFUTURE_CONST
tools/perf/ui/browsers/Build +5 -5
@@ -1,8 +1,8 @@ -libperf-y += annotate.o -libperf-y += hists.o -libperf-y += map.o -libperf-y += scripts.o -libperf-y += header.o +perf-y += annotate.o +perf-y += hists.o +perf-y += map.o +perf-y += scripts.o +perf-y += header.o CFLAGS_annotate.o += -DENABLE_SLFUTURE_CONST CFLAGS_hists.o += -DENABLE_SLFUTURE_CONST
tools/perf/ui/tui/Build +4 -4
@@ -1,4 +1,4 @@ -libperf-y += setup.o -libperf-y += util.o -libperf-y += helpline.o -libperf-y += progress.o +perf-y += setup.o +perf-y += util.o +perf-y += helpline.o +perf-y += progress.o
tools/perf/util/Build +138 -138
300 lines not on this page · raw message
tools/perf/util/c++/Build +2 -2
@@ -1,2 +1,2 @@ -libperf-$(CONFIG_CLANGLLVM) += clang.o -libperf-$(CONFIG_CLANGLLVM) += clang-test.o +perf-$(CONFIG_CLANGLLVM) += clang.o +perf-$(CONFIG_CLANGLLVM) += clang-test.o
tools/perf/util/cs-etm-decoder/Build +1 -1
@@ -1 +1 @@ -libperf-$(CONFIG_AUXTRACE) += cs-etm-decoder.o +perf-$(CONFIG_AUXTRACE) += cs-etm-decoder.o
tools/perf/util/intel-pt-decoder/Build +1 -1
@@ -1,4 +1,4 @@ -libperf-$(CONFIG_AUXTRACE) += intel-pt-pkt-decoder.o intel-pt-insn-decoder.o intel-pt-log.o intel-pt-decoder.o +perf-$(CONFIG_AUXTRACE) += intel-pt-pkt-decoder.o intel-pt-insn-decoder.o intel-pt-log.o intel-pt-decoder.o inat_tables_script = util/intel-pt-decoder/gen-insn-attr-x86.awk inat_tables_maps = util/intel-pt-decoder/x86-opcode-map.txt
tools/perf/util/scripting-engines/Build +2 -2
@@ -1,5 +1,5 @@ -libperf-$(CONFIG_LIBPERL) += trace-event-perl.o -libperf-$(CONFIG_LIBPYTHON) += trace-event-python.o +perf-$(CONFIG_LIBPERL) += trace-event-perl.o +perf-$(CONFIG_LIBPYTHON) += trace-event-python.o CFLAGS_trace-event-perl.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow -Wno-nested-externs -Wno-undef -Wno-switch-default
Signature · 1 line
2.17.2
Jiri Olsa
reviewerPATCH 5/10 perf list: Display metric expressions for --details option
In reply to Jiri OlsaDisplaying metric expression itself when --details is specified.
Current list with no details:
# perf list metrics
...
TopDownL1:
IPC
[Instructions Per Cycle (per logical thread)]
SLOTS
[Total issue-pipeline slots]
...Detailed output with metric formula:
# perf list --details metrics
...
TopDownL1:
IPC
[Instructions Per Cycle (per logical thread)]
[inst_retired.any / cpu_clk_unhalted.thread]
SLOTS
[Total issue-pipeline slots]
[4*(( cpu_clk_unhalted.thread_any / 2 ) if #smt_on else cycles)]
...--- tools/perf/builtin-list.c | 8 ++++---- tools/perf/util/metricgroup.c | 8 +++++++- tools/perf/util/metricgroup.h | 3 ++- tools/perf/util/parse-events.c | 2 +- 4 files changed, 14 insertions(+), 7 deletions(-)
tools/perf/builtin-list.c +4 -4
@@ -82,9 +82,9 @@ int cmd_list(int argc, const char **argv)else if (strcmp (argv[i],"sdt" ) ==0 )print_sdt_events (NULL ,NULL , raw_dump);else if (strcmp (argv[i],"metric" ) ==0 ) -metricgroup__print (true, false,NULL , raw_dump); +metricgroup__print (true, false,NULL , raw_dump, details_flag);else if (strcmp (argv[i],"metricgroup" ) ==0 ) -metricgroup__print (false, true,NULL , raw_dump); +metricgroup__print (false, true,NULL , raw_dump, details_flag);else if ((sep =strchr (argv[i],':' )) !=NULL ) {int sep_idx;
@@ -102,7 +102,7 @@ int cmd_list(int argc, const char **argv) s[sep_idx] ='\0' ;print_tracepoint_events (s, s + sep_idx +1 , raw_dump);print_sdt_events (s, s + sep_idx +1 , raw_dump); -metricgroup__print (true, true, s, raw_dump); +metricgroup__print (true, true, s, raw_dump, details_flag);free (s); }else {if (asprintf (&s,"*%s*" , argv[i]) <0 ) {
@@ -119,7 +119,7 @@ int cmd_list(int argc, const char **argv) details_flag);print_tracepoint_events (NULL , s, raw_dump);print_sdt_events (NULL , s, raw_dump); -metricgroup__print (true, true,NULL , raw_dump); +metricgroup__print (true, true,NULL , raw_dump, details_flag);free (s); } }
tools/perf/util/metricgroup.c +7 -1
@@ -270,7 +270,7 @@ static void metricgroup__print_strlist(struct strlist *metrics, bool raw) }void metricgroup__print (bool metrics,bool metricgroups,char *filter, -bool raw) +bool raw,bool details) {struct pmu_events_map *map =perf_pmu__find_map (NULL );struct pmu_event *pe;
@@ -329,6 +329,12 @@ void metricgroup__print(bool metrics, bool metricgroups, char *filter,if (asprintf (&s,"%s\n%*s%s]" , pe->metric_name,8 ,"[" , pe->desc) <0 )return ; + +if (details) { +if (asprintf (&s,"%s\n%*s%s]" , + s,8 ,"[" , pe->metric_expr) <0 ) +return ; + } }if (!s)
tools/perf/util/metricgroup.h +2 -1
@@ -27,6 +27,7 @@ int metricgroup__parse_groups(const struct option *opt,const char *str, struct rblist *metric_events); -void metricgroup__print (bool metrics,bool groups,char *filter,bool raw); +void metricgroup__print (bool metrics,bool groups,char *filter, +bool raw,bool details);bool metricgroup__has_metric (const char *metric);#endif
tools/perf/util/parse-events.c +1 -1
@@ -2540,7 +2540,7 @@ void print_events(const char *event_glob, bool name_only, bool quiet_flag,print_sdt_events (NULL ,NULL , name_only); -metricgroup__print (true, true,NULL , name_only); +metricgroup__print (true, true,NULL , name_only, details_flag); }int parse_events__is_hardcoded_term (struct parse_events_term *term)
Signature · 1 line
2.17.2
Jiri Olsa
reviewerPATCH 6/10 perf header: Fix wrong node write in NUMA_TOPOLOGY feature
In reply to Jiri OlsaWe are currently passing the node index instead of the real node number.
--- tools/perf/util/header.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/header.c +1 -1
@@ -881,7 +881,7 @@ static int write_numa_topology(struct feat_fd *ff,if (ret <0 )break ; - ret =write_topo_node (ff, i); + ret =write_topo_node (ff, j);if (ret <0 )break ; }
Signature · 1 line
2.17.2
Jiri Olsa
reviewerPATCH 8/10 perf header: Remove cpu_nr from struct cpu_topo
In reply to Jiri OlsaIt's not used.
--- tools/perf/util/header.c | 2 -- 1 file changed, 2 deletions(-)
tools/perf/util/header.c +0 -2
@@ -563,7 +563,6 @@ static int write_cmdline(struct feat_fd *ff,"/sys/devices/system/cpu/cpu%d/topology/thread_siblings_list" struct cpu_topo { -u32 cpu_nr;u32 core_sib;u32 thread_sib;char **core_siblings;
@@ -679,7 +678,6 @@ static struct cpu_topo *build_cpu_topology(void) goto out_free; tp = addr; - tp->cpu_nr = nr; addr +=sizeof (*tp); tp->core_siblings = addr; addr += sz;
Signature · 1 line
2.17.2
Jiri Olsa
reviewerPATCH 10/10 perf tools: Add perf_topo_numa object
In reply to Jiri OlsaAdding perf_topo_numa object to return the list of numa nodes together with their cpus. It will replace the numa code in header.c and will be used from perf record code in following patches.
Adding following interface functions to load numa details:
struct perf_topo_numa *perf_topo_numa__new(void); void perf_topo_numa__free(struct perf_topo_numa *tp);
And replacing current (copied) local interface, with no functional changes.
--- tools/perf/util/cputopo.c | 120 ++++++++++++++++++++++++++++++++++++++ tools/perf/util/cputopo.h | 16 +++++ tools/perf/util/header.c | 119 +++++++++---------------------------- 3 files changed, 162 insertions(+), 93 deletions(-)
tools/perf/util/cputopo.c +120 -0
@@ -1,9 +1,11 @@// SPDX-License-Identifier: GPL-2.0 #include <sys/param.h> +#include <inttypes.h> #include "cputopo.h" #include "cpumap.h" #include "util.h" +#include "env.h" #define CORE_SIB_FMT \
@@ -142,3 +144,121 @@ struct perf_topo_cpu *perf_topo_cpu__new(void) }return tp; } + +static int load_numa_node (struct perf_topo_node *node,int nr) +{ +char str[MAXPATHLEN ]; +char field[32 ]; +char *buf =NULL , *p; +size_t len =0 ; +int ret =-1 ; +FILE *fp; +u64 mem; + + node->node = (u32 ) nr; + +sprintf (str,"/sys/devices/system/node/node%d/meminfo" , nr); + fp =fopen (str,"r" ); +if (!fp) +return -1 ; + +while (getline (&buf, &len, fp) >0 ) { +/* skip over invalid lines */ +if (!strchr (buf,':' )) +continue ; +if (sscanf (buf,"%*s %*d %31s %" PRIu64, field, &mem) !=2 ) + goto err; +if (!strcmp (field,"MemTotal:" )) + node->mem_total = mem; +if (!strcmp (field,"MemFree:" )) + node->mem_free = mem; +if (node->mem_total && node->mem_free) +break ; + } + +fclose (fp); + fp =NULL ; + buf =NULL ; + + ret =-1 ; +sprintf (str,"/sys/devices/system/node/node%d/cpulist" , nr); + + fp =fopen (str,"r" ); +if (!fp) +return -1 ; + +if (getline (&buf, &len, fp) <=0 ) + goto err; + + p =strchr (buf,'\n' ); +if (p) + *p ='\0' ; + + node->cpus = buf; +fclose (fp); +return 0 ; + +err: +free (buf); +if (fp) +fclose (fp); +return ret; +} + +struct perf_topo_numa *perf_topo_numa__new (void ) +{ +struct cpu_map *node_map =NULL ; +struct perf_topo_numa *tp =NULL ; +char *buf =NULL ; +size_t len =0 ; +u32 nr, i; +FILE *fp; +char *c; + + fp =fopen ("/sys/devices/system/node/online" ,"r" ); +if (!fp) +return NULL ; + +if (getline (&buf, &len, fp) <=0 ) + goto out; + + c =strchr (buf,'\n' ); +if (c) + *c ='\0' ; + + node_map =cpu_map__new (buf); +if (!node_map) + goto out; + + nr = (u32 ) node_map->nr; + + tp =zalloc (sizeof (*tp) +sizeof (tp->nodes[0 ])*nr); +if (!tp) + goto out; + + tp->nr = nr; + +for (i =0 ; i < nr; i++) { +if (load_numa_node (&tp->nodes[i], node_map->map[i])) { +perf_topo_numa__free (tp); + tp =NULL ; +break ; + } + } + +out: +free (buf); +fclose (fp); +cpu_map__put (node_map); +return tp; +} + +void perf_topo_numa__free (struct perf_topo_numa *tp) +{ +u32 i; + +for (i =0 ; i < tp->nr; i++) +free (tp->nodes[i].cpus); + +free (tp); +}
tools/perf/util/cputopo.h +16 -0
@@ -3,6 +3,7 @@#define __PERF_CPUTOPO_H#include <linux/types.h> +#include "env.h" struct perf_topo_cpu {u32 core_sib;
@@ -11,7 +12,22 @@ struct perf_topo_cpu { char **thread_siblings; }; +struct perf_topo_node { +char *cpus; +u32 node; +u64 mem_total; +u64 mem_free; +}; + +struct perf_topo_numa { +u32 nr; +struct perf_topo_node nodes[0 ]; +}; +struct perf_topo_cpu *perf_topo_cpu__new (void );void perf_topo_cpu__free (struct perf_topo_cpu *tp); +struct perf_topo_numa *perf_topo_numa__new (void ); +void perf_topo_numa__free (struct perf_topo_numa *tp); +#endif /* __PERF_CPUTOPO_H */
tools/perf/util/header.c +26 -93
138 lines not on this page · raw message
Signature · 1 line
2.17.2
Jiri Olsa
reviewerPATCH 9/10 perf tools: Add perf_topo_cpu object
In reply to Jiri OlsaMaking struct cpu_topo global and renaming it to struct perf_topo_cpu, so it can be used from record command in following patches.
Adding following interface functions to load/free cpu topology details:
struct perf_topo_cpu *perf_topo_cpu__new(void); void perf_topo_cpu__free(struct perf_topo_cpu *tp);
Moving it into separate object file cputopo.c together with numa related object in following patches.
No functional change, the new interface will be used in upcoming changes.
--- tools/perf/util/Build | 1 + tools/perf/util/cputopo.c | 144 ++++++++++++++++++++++++++++++++++++ tools/perf/util/cputopo.h | 17 +++++ tools/perf/util/header.c | 150 +------------------------------------- 4 files changed, 166 insertions(+), 146 deletions(-) create mode 100644 tools/perf/util/cputopo.c create mode 100644 tools/perf/util/cputopo.h
tools/perf/util/Build +1 -0
@@ -69,6 +69,7 @@ perf-y += hist.o perf-y += util.o perf-y += xyarray.o perf-y += cpumap.o +perf-y += cputopo.o perf-y += cgroup.o perf-y += target.o perf-y += rblist.o
tools/perf/util/cputopo.c new file +144 -0
144 lines not on this page · raw message
tools/perf/util/cputopo.h new file +17 -0
@@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __PERF_CPUTOPO_H +#define __PERF_CPUTOPO_H + +#include <linux/types.h> + +struct perf_topo_cpu { +u32 core_sib; +u32 thread_sib; +char **core_siblings; +char **thread_siblings; +}; + +struct perf_topo_cpu *perf_topo_cpu__new (void ); +void perf_topo_cpu__free (struct perf_topo_cpu *tp); + +#endif /* __PERF_CPUTOPO_H */
tools/perf/util/header.c +4 -146
175 lines not on this page · raw message
Signature · 1 line
2.17.2
Jiri Olsa
reviewerPATCH 7/10 perf header: Get rid of write_it label
In reply to Jiri OlsaAnd simplify the code a bit.
--- tools/perf/util/header.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
tools/perf/util/header.c +2 -4
@@ -1042,11 +1042,9 @@ static int write_cpuid(struct feat_fd *ff,int ret; ret =get_cpuid (buffer,sizeof (buffer)); -if (!ret) - goto write_it; +if (ret) +return -1 ; -return -1 ; -write_it:return do_write_string (ff, buffer); }
Signature · 1 line
2.17.2
Jiri Olsa
reviewerPATCH 4/10 perf tools: Fix legacy events symbol separator parsing
In reply to Jiri OlsaFixing legacy symbol events parsing. We can't support single slash separator, like 'cycles/u', because it conflicts with non empty terms, like 'cycles/period/u'.
Keeping only '//' and ':' separator for these events:
cycles//u
cycles:k
And removing '/' separator support, which is not working anymore. Also adding automated tests for above events.
--- tools/perf/tests/parse-events.c | 30 ++++++++++++++++++++++++++++++ tools/perf/util/parse-events.y | 4 ++-- 2 files changed, 32 insertions(+), 2 deletions(-)
tools/perf/tests/parse-events.c +30 -0
@@ -1330,6 +1330,26 @@ static int test__checkevent_complex_name(struct perf_evlist *evlist)return 0 ; } +static int test__sym_event_slash (struct perf_evlist *evlist) +{ +struct perf_evsel *evsel =perf_evlist__first (evlist); + +TEST_ASSERT_VAL ("wrong type" , evsel->attr.type ==PERF_TYPE_HARDWARE ); +TEST_ASSERT_VAL ("wrong config" , evsel->attr.config ==PERF_COUNT_HW_CPU_CYCLES ); +TEST_ASSERT_VAL ("wrong exclude_kernel" , evsel->attr.exclude_kernel); +return 0 ; +} + +static int test__sym_event_dc (struct perf_evlist *evlist) +{ +struct perf_evsel *evsel =perf_evlist__first (evlist); + +TEST_ASSERT_VAL ("wrong type" , evsel->attr.type ==PERF_TYPE_HARDWARE ); +TEST_ASSERT_VAL ("wrong config" , evsel->attr.config ==PERF_COUNT_HW_CPU_CYCLES ); +TEST_ASSERT_VAL ("wrong exclude_user" , evsel->attr.exclude_user); +return 0 ; +} +static int count_tracepoints (void ) {struct dirent *events_ent;
@@ -1670,6 +1690,16 @@ static struct evlist_test test__events[] = { .name = "cycles/name='COMPLEX_CYCLES_NAME:orig=cycles,desc=chip-clock-ticks'/Duk", .check = test__checkevent_complex_name, .id = 53 + }, + { + .name = "cycles//u", + .check = test__sym_event_slash, + .id = 54, + }, + { + .name = "cycles:k", + .check = test__sym_event_dc, + .id = 55, } };
tools/perf/util/parse-events.y +2 -2
@@ -311,7 +311,7 @@ value_sym '/' event_config '/' $$ = list; } | -value_sym sep_slash_dc +value_sym sep_slash_slash_dc { struct list_head *list; int type = $1 >> 16;
@@ -702,7 +702,7 @@ PE_VALUE PE_ARRAY_RANGE PE_VALUE sep_dc: ':' | -sep_slash_dc: '/' | ':' | +sep_slash_slash_dc: '/' '/' | ':' | %%
Signature · 1 line
2.17.2
tip-bot for Jiri Olsa
merge bot[tip:perf/core] perf tools: Compile perf with libperf-in.o instead of libperf.a
In reply to Jiri Olsaperf tools: Compile perf with libperf-in.o instead of libperf.a
Commit-ID: d0bfbedad72b74f93b028c26474acba1ba3d73ed Gitweb: https://git.kernel.org/tip/d0bfbedad72b74f93b028c26474acba1ba3d73ed Author: Jiri Olsa <[email protected]> AuthorDate: Wed, 13 Feb 2019 13:32:37 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Thu, 14 Feb 2019 15:18:08 -0300
perf tools: Compile perf with libperf-in.o instead of libperf.a
There's no need for perf build to use libperf.a,
we can use directly libperf-in.o.
The libperf.a stays as a target if needed:
$ make libperf.a
...
CC util/pmu.o
CC util/pmu-flex.o
LD util/libperf-in.o
LD libperf-in.o
AR libperf.a--- tools/perf/Makefile.perf | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
tools/perf/Makefile.perf +8 -8
@@ -346,7 +346,7 @@ export PERL_PATH LIB_FILE=$(OUTPUT)libperf.a -PERFLIBS = $(LIB_FILE) $(LIBAPI) $(LIBTRACEEVENT) $(LIBSUBCMD) +PERFLIBS = $(LIBAPI) $(LIBTRACEEVENT) $(LIBSUBCMD) ifndef NO_LIBBPF PERFLIBS += $(LIBBPF) endif
@@ -549,6 +549,8 @@ JEVENTS_IN := $(OUTPUT)pmu-events/jevents-in.o PMU_EVENTS_IN := $(OUTPUT)pmu-events/pmu-events-in.o +LIBPERF_IN := $(OUTPUT)libperf-in.o + export JEVENTS build := -f $(srctree)/tools/build/Makefile.build dir=. obj
@@ -565,9 +567,12 @@ $(JEVENTS): $(JEVENTS_IN) $(PMU_EVENTS_IN): $(JEVENTS) FORCE $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=pmu-events obj=pmu-events -$(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(PMU_EVENTS_IN) $(LIBTRACEEVENT_DYNAMIC_LIST) +$(LIBPERF_IN): prepare FORCE + $(Q)$(MAKE) $(build)=libperf + +$(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(PMU_EVENTS_IN) $(LIBPERF_IN) $(LIBTRACEEVENT_DYNAMIC_LIST) $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS) \ - $(PERF_IN) $(PMU_EVENTS_IN) $(LIBS) -o $@ + $(PERF_IN) $(PMU_EVENTS_IN) $(LIBPERF_IN) $(LIBS) -o $@ $(GTK_IN): FORCE $(Q)$(MAKE) $(build)=gtk
@@ -683,11 +688,6 @@ endif $(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h) -LIBPERF_IN := $(OUTPUT)libperf-in.o - -$(LIBPERF_IN): prepare FORCE - $(Q)$(MAKE) $(build)=libperf - $(LIB_FILE): $(LIBPERF_IN) $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIBPERF_IN) $(LIB_OBJS)
tip-bot for Jiri Olsa
merge bot[tip:perf/core] perf tools: Rename LIB_FILE to LIBPERF_A
In reply to Jiri Olsaperf tools: Rename LIB_FILE to LIBPERF_A
Commit-ID: 6368942a9223fb8cd9b5623fc0b99d75d5ca93a7 Gitweb: https://git.kernel.org/tip/6368942a9223fb8cd9b5623fc0b99d75d5ca93a7 Author: Jiri Olsa <[email protected]> AuthorDate: Wed, 13 Feb 2019 13:32:38 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Thu, 14 Feb 2019 15:18:08 -0300
perf tools: Rename LIB_FILE to LIBPERF_A
Simple rename, no functional change.
--- tools/perf/Makefile.perf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tools/perf/Makefile.perf +3 -3
@@ -344,7 +344,7 @@ endif export PERL_PATH -LIB_FILE=$(OUTPUT)libperf.a +LIBPERF_A=$(OUTPUT)libperf.a PERFLIBS = $(LIBAPI) $(LIBTRACEEVENT) $(LIBSUBCMD) ifndef NO_LIBBPF
@@ -688,7 +688,7 @@ endif $(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h) -$(LIB_FILE): $(LIBPERF_IN) +$(LIBPERF_A): $(LIBPERF_IN) $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIBPERF_IN) $(LIB_OBJS) LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ) 'EXTRA_CFLAGS=$(EXTRA_CFLAGS)' 'LDFLAGS=$(LDFLAGS)'
@@ -910,7 +910,7 @@ python-clean: $(python-clean) clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean config-clean fixdep-clean python-clean - $(call QUIET_CLEAN, core-objs) $(RM) $(LIB_FILE) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(LANG_BINDINGS) + $(call QUIET_CLEAN, core-objs) $(RM) $(LIBPERF_A) $(OUTPUT)perf-archive $(OUTPUT)perf-with-kcore $(LANG_BINDINGS) $(Q)find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete $(Q)$(RM) $(OUTPUT).config-detected $(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf perf-read-vdso32 perf-read-vdsox32 $(OUTPUT)pmu-events/jevents $(OUTPUT)$(LIBJVMTI).so
tip-bot for Jiri Olsa
merge bot[tip:perf/core] perf tools: Rename build libperf to perf
In reply to Jiri Olsaperf tools: Rename build libperf to perf
Commit-ID: 5ff328836dfde0cef9f28c8b8791a90a36d7a183 Gitweb: https://git.kernel.org/tip/5ff328836dfde0cef9f28c8b8791a90a36d7a183 Author: Jiri Olsa <[email protected]> AuthorDate: Wed, 13 Feb 2019 13:32:39 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Thu, 14 Feb 2019 15:18:08 -0300
perf tools: Rename build libperf to perf
Rename build libperf to perf, because it's used to build perf.
The libperf build object name will be used for libperf library.
--- tools/perf/Build | 10 +- tools/perf/arch/Build | 4 +- tools/perf/arch/arm/Build | 4 +- tools/perf/arch/arm/tests/Build | 8 +- tools/perf/arch/arm/util/Build | 8 +- tools/perf/arch/arm64/Build | 4 +- tools/perf/arch/arm64/tests/Build | 6 +- tools/perf/arch/arm64/util/Build | 12 +- tools/perf/arch/nds32/Build | 2 +- tools/perf/arch/nds32/util/Build | 2 +- tools/perf/arch/powerpc/Build | 4 +- tools/perf/arch/powerpc/tests/Build | 6 +- tools/perf/arch/powerpc/util/Build | 18 +- tools/perf/arch/s390/Build | 2 +- tools/perf/arch/s390/util/Build | 12 +- tools/perf/arch/sh/Build | 2 +- tools/perf/arch/sh/util/Build | 2 +- tools/perf/arch/sparc/Build | 2 +- tools/perf/arch/sparc/util/Build | 2 +- tools/perf/arch/x86/Build | 4 +- tools/perf/arch/x86/tests/Build | 14 +- tools/perf/arch/x86/util/Build | 30 +-- tools/perf/arch/xtensa/Build | 2 +- tools/perf/arch/xtensa/util/Build | 2 +- tools/perf/scripts/Build | 4 +- tools/perf/scripts/perl/Perf-Trace-Util/Build | 2 +- tools/perf/scripts/python/Perf-Trace-Util/Build | 2 +- tools/perf/trace/beauty/Build | 26 +-- tools/perf/ui/Build | 18 +- tools/perf/ui/browsers/Build | 10 +- tools/perf/ui/tui/Build | 8 +- tools/perf/util/Build | 276 ++++++++++++------------ tools/perf/util/c++/Build | 4 +- tools/perf/util/cs-etm-decoder/Build | 2 +- tools/perf/util/intel-pt-decoder/Build | 2 +- tools/perf/util/scripting-engines/Build | 4 +- 36 files changed, 260 insertions(+), 260 deletions(-)
tools/perf/Build +5 -5
@@ -46,10 +46,10 @@ CFLAGS_builtin-trace.o += -DSTRACE_GROUPS_DIR="BUILD_STR($(STRACE_GROUPS_DIR_ CFLAGS_builtin-report.o += -DTIPDIR="BUILD_STR($(tipdir_SQ))" CFLAGS_builtin-report.o += -DDOCDIR="BUILD_STR($(srcdir_SQ)/Documentation)" -libperf-y += util/ -libperf-y += arch/ -libperf-y += ui/ -libperf-y += scripts/ -libperf-$(CONFIG_TRACE) += trace/beauty/ +perf-y += util/ +perf-y += arch/ +perf-y += ui/ +perf-y += scripts/ +perf-$(CONFIG_TRACE) += trace/beauty/ gtk-y += ui/gtk/
tools/perf/arch/Build +2 -2
@@ -1,2 +1,2 @@ -libperf-y += common.o -libperf-y += $(SRCARCH)/ +perf-y += common.o +perf-y += $(SRCARCH)/
tools/perf/arch/arm/Build +2 -2
@@ -1,2 +1,2 @@ -libperf-y += util/ -libperf-$(CONFIG_DWARF_UNWIND) += tests/ +perf-y += util/ +perf-$(CONFIG_DWARF_UNWIND) += tests/
tools/perf/arch/arm/tests/Build +4 -4
@@ -1,5 +1,5 @@ -libperf-y += regs_load.o -libperf-y += dwarf-unwind.o -libperf-y += vectors-page.o +perf-y += regs_load.o +perf-y += dwarf-unwind.o +perf-y += vectors-page.o -libperf-y += arch-tests.o +perf-y += arch-tests.o
tools/perf/arch/arm/util/Build +4 -4
@@ -1,6 +1,6 @@ -libperf-$(CONFIG_DWARF) += dwarf-regs.o +perf-$(CONFIG_DWARF) += dwarf-regs.o -libperf-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o -libperf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o +perf-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o +perf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o -libperf-$(CONFIG_AUXTRACE) += pmu.o auxtrace.o cs-etm.o +perf-$(CONFIG_AUXTRACE) += pmu.o auxtrace.o cs-etm.o
tools/perf/arch/arm64/Build +2 -2
@@ -1,2 +1,2 @@ -libperf-y += util/ -libperf-$(CONFIG_DWARF_UNWIND) += tests/ +perf-y += util/ +perf-$(CONFIG_DWARF_UNWIND) += tests/
tools/perf/arch/arm64/tests/Build +3 -3
@@ -1,4 +1,4 @@ -libperf-y += regs_load.o -libperf-y += dwarf-unwind.o +perf-y += regs_load.o +perf-y += dwarf-unwind.o -libperf-y += arch-tests.o +perf-y += arch-tests.o
tools/perf/arch/arm64/util/Build +6 -6
@@ -1,10 +1,10 @@ -libperf-y += header.o -libperf-y += sym-handling.o -libperf-$(CONFIG_DWARF) += dwarf-regs.o -libperf-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o -libperf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o +perf-y += header.o +perf-y += sym-handling.o +perf-$(CONFIG_DWARF) += dwarf-regs.o +perf-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o +perf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o -libperf-$(CONFIG_AUXTRACE) += ../../arm/util/pmu.o \ +perf-$(CONFIG_AUXTRACE) += ../../arm/util/pmu.o \ ../../arm/util/auxtrace.o \ ../../arm/util/cs-etm.o \ arm-spe.o
tools/perf/arch/nds32/Build +1 -1
@@ -1 +1 @@ -libperf-y += util/ +perf-y += util/
tools/perf/arch/nds32/util/Build +1 -1
@@ -1 +1 @@ -libperf-y += header.o +perf-y += header.o
tools/perf/arch/powerpc/Build +2 -2
@@ -1,2 +1,2 @@ -libperf-y += util/ -libperf-y += tests/ +perf-y += util/ +perf-y += tests/
tools/perf/arch/powerpc/tests/Build +3 -3
@@ -1,4 +1,4 @@ -libperf-$(CONFIG_DWARF_UNWIND) += regs_load.o -libperf-$(CONFIG_DWARF_UNWIND) += dwarf-unwind.o +perf-$(CONFIG_DWARF_UNWIND) += regs_load.o +perf-$(CONFIG_DWARF_UNWIND) += dwarf-unwind.o -libperf-y += arch-tests.o +perf-y += arch-tests.o
tools/perf/arch/powerpc/util/Build +9 -9
@@ -1,11 +1,11 @@ -libperf-y += header.o -libperf-y += sym-handling.o -libperf-y += kvm-stat.o -libperf-y += perf_regs.o -libperf-y += mem-events.o +perf-y += header.o +perf-y += sym-handling.o +perf-y += kvm-stat.o +perf-y += perf_regs.o +perf-y += mem-events.o -libperf-$(CONFIG_DWARF) += dwarf-regs.o -libperf-$(CONFIG_DWARF) += skip-callchain-idx.o +perf-$(CONFIG_DWARF) += dwarf-regs.o +perf-$(CONFIG_DWARF) += skip-callchain-idx.o -libperf-$(CONFIG_LIBUNWIND) += unwind-libunwind.o -libperf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o +perf-$(CONFIG_LIBUNWIND) += unwind-libunwind.o +perf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o
tools/perf/arch/s390/Build +1 -1
@@ -1 +1 @@ -libperf-y += util/ +perf-y += util/
tools/perf/arch/s390/util/Build +6 -6
@@ -1,9 +1,9 @@ -libperf-y += header.o -libperf-y += kvm-stat.o +perf-y += header.o +perf-y += kvm-stat.o -libperf-$(CONFIG_DWARF) += dwarf-regs.o -libperf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o +perf-$(CONFIG_DWARF) += dwarf-regs.o +perf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o -libperf-y += machine.o +perf-y += machine.o -libperf-$(CONFIG_AUXTRACE) += auxtrace.o +perf-$(CONFIG_AUXTRACE) += auxtrace.o
tools/perf/arch/sh/Build +1 -1
@@ -1 +1 @@ -libperf-y += util/ +perf-y += util/
tools/perf/arch/sh/util/Build +1 -1
@@ -1 +1 @@ -libperf-$(CONFIG_DWARF) += dwarf-regs.o +perf-$(CONFIG_DWARF) += dwarf-regs.o
tools/perf/arch/sparc/Build +1 -1
@@ -1 +1 @@ -libperf-y += util/ +perf-y += util/
tools/perf/arch/sparc/util/Build +1 -1
@@ -1 +1 @@ -libperf-$(CONFIG_DWARF) += dwarf-regs.o +perf-$(CONFIG_DWARF) += dwarf-regs.o
tools/perf/arch/x86/Build +2 -2
@@ -1,2 +1,2 @@ -libperf-y += util/ -libperf-y += tests/ +perf-y += util/ +perf-y += tests/
tools/perf/arch/x86/tests/Build +7 -7
@@ -1,8 +1,8 @@ -libperf-$(CONFIG_DWARF_UNWIND) += regs_load.o -libperf-$(CONFIG_DWARF_UNWIND) += dwarf-unwind.o +perf-$(CONFIG_DWARF_UNWIND) += regs_load.o +perf-$(CONFIG_DWARF_UNWIND) += dwarf-unwind.o -libperf-y += arch-tests.o -libperf-y += rdpmc.o -libperf-y += perf-time-to-tsc.o -libperf-$(CONFIG_AUXTRACE) += insn-x86.o -libperf-$(CONFIG_X86_64) += bp-modify.o +perf-y += arch-tests.o +perf-y += rdpmc.o +perf-y += perf-time-to-tsc.o +perf-$(CONFIG_AUXTRACE) += insn-x86.o +perf-$(CONFIG_X86_64) += bp-modify.o
tools/perf/arch/x86/util/Build +15 -15
@@ -1,18 +1,18 @@ -libperf-y += header.o -libperf-y += tsc.o -libperf-y += pmu.o -libperf-y += kvm-stat.o -libperf-y += perf_regs.o -libperf-y += group.o -libperf-y += machine.o -libperf-y += event.o +perf-y += header.o +perf-y += tsc.o +perf-y += pmu.o +perf-y += kvm-stat.o +perf-y += perf_regs.o +perf-y += group.o +perf-y += machine.o +perf-y += event.o -libperf-$(CONFIG_DWARF) += dwarf-regs.o -libperf-$(CONFIG_BPF_PROLOGUE) += dwarf-regs.o +perf-$(CONFIG_DWARF) += dwarf-regs.o +perf-$(CONFIG_BPF_PROLOGUE) += dwarf-regs.o -libperf-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o -libperf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o +perf-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o +perf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o -libperf-$(CONFIG_AUXTRACE) += auxtrace.o -libperf-$(CONFIG_AUXTRACE) += intel-pt.o -libperf-$(CONFIG_AUXTRACE) += intel-bts.o +perf-$(CONFIG_AUXTRACE) += auxtrace.o +perf-$(CONFIG_AUXTRACE) += intel-pt.o +perf-$(CONFIG_AUXTRACE) += intel-bts.o
tools/perf/arch/xtensa/Build +1 -1
@@ -1 +1 @@ -libperf-y += util/ +perf-y += util/
tools/perf/arch/xtensa/util/Build +1 -1
@@ -1 +1 @@ -libperf-$(CONFIG_DWARF) += dwarf-regs.o +perf-$(CONFIG_DWARF) += dwarf-regs.o
tools/perf/scripts/Build +2 -2
@@ -1,2 +1,2 @@ -libperf-$(CONFIG_LIBPERL) += perl/Perf-Trace-Util/ -libperf-$(CONFIG_LIBPYTHON) += python/Perf-Trace-Util/ +perf-$(CONFIG_LIBPERL) += perl/Perf-Trace-Util/ +perf-$(CONFIG_LIBPYTHON) += python/Perf-Trace-Util/
tools/perf/scripts/perl/Perf-Trace-Util/Build +1 -1
@@ -1,4 +1,4 @@ -libperf-y += Context.o +perf-y += Context.o CFLAGS_Context.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes CFLAGS_Context.o += -Wno-unused-parameter -Wno-nested-externs -Wno-undef
tools/perf/scripts/python/Perf-Trace-Util/Build +1 -1
@@ -1,3 +1,3 @@ -libperf-y += Context.o +perf-y += Context.o CFLAGS_Context.o += $(PYTHON_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs
tools/perf/trace/beauty/Build +13 -13
@@ -1,15 +1,15 @@ -libperf-y += clone.o -libperf-y += fcntl.o -libperf-y += flock.o +perf-y += clone.o +perf-y += fcntl.o +perf-y += flock.o ifeq ($(SRCARCH),$(filter $(SRCARCH),x86)) -libperf-y += ioctl.o +perf-y += ioctl.o endif -libperf-y += kcmp.o -libperf-y += mount_flags.o -libperf-y += pkey_alloc.o -libperf-y += arch_prctl.o -libperf-y += prctl.o -libperf-y += renameat.o -libperf-y += sockaddr.o -libperf-y += socket.o -libperf-y += statx.o +perf-y += kcmp.o +perf-y += mount_flags.o +perf-y += pkey_alloc.o +perf-y += arch_prctl.o +perf-y += prctl.o +perf-y += renameat.o +perf-y += sockaddr.o +perf-y += socket.o +perf-y += statx.o
tools/perf/ui/Build +9 -9
@@ -1,14 +1,14 @@ -libperf-y += setup.o -libperf-y += helpline.o -libperf-y += progress.o -libperf-y += util.o -libperf-y += hist.o -libperf-y += stdio/hist.o +perf-y += setup.o +perf-y += helpline.o +perf-y += progress.o +perf-y += util.o +perf-y += hist.o +perf-y += stdio/hist.o CFLAGS_setup.o += -DLIBDIR="BUILD_STR($(LIBDIR))" -libperf-$(CONFIG_SLANG) += browser.o -libperf-$(CONFIG_SLANG) += browsers/ -libperf-$(CONFIG_SLANG) += tui/ +perf-$(CONFIG_SLANG) += browser.o +perf-$(CONFIG_SLANG) += browsers/ +perf-$(CONFIG_SLANG) += tui/ CFLAGS_browser.o += -DENABLE_SLFUTURE_CONST
tools/perf/ui/browsers/Build +5 -5
@@ -1,8 +1,8 @@ -libperf-y += annotate.o -libperf-y += hists.o -libperf-y += map.o -libperf-y += scripts.o -libperf-y += header.o +perf-y += annotate.o +perf-y += hists.o +perf-y += map.o +perf-y += scripts.o +perf-y += header.o CFLAGS_annotate.o += -DENABLE_SLFUTURE_CONST CFLAGS_hists.o += -DENABLE_SLFUTURE_CONST
tools/perf/ui/tui/Build +4 -4
@@ -1,4 +1,4 @@ -libperf-y += setup.o -libperf-y += util.o -libperf-y += helpline.o -libperf-y += progress.o +perf-y += setup.o +perf-y += util.o +perf-y += helpline.o +perf-y += progress.o
tools/perf/util/Build +138 -138
300 lines not on this page · raw message
tools/perf/util/c++/Build +2 -2
@@ -1,2 +1,2 @@ -libperf-$(CONFIG_CLANGLLVM) += clang.o -libperf-$(CONFIG_CLANGLLVM) += clang-test.o +perf-$(CONFIG_CLANGLLVM) += clang.o +perf-$(CONFIG_CLANGLLVM) += clang-test.o
tools/perf/util/cs-etm-decoder/Build +1 -1
@@ -1 +1 @@ -libperf-$(CONFIG_AUXTRACE) += cs-etm-decoder.o +perf-$(CONFIG_AUXTRACE) += cs-etm-decoder.o
tools/perf/util/intel-pt-decoder/Build +1 -1
@@ -1,4 +1,4 @@ -libperf-$(CONFIG_AUXTRACE) += intel-pt-pkt-decoder.o intel-pt-insn-decoder.o intel-pt-log.o intel-pt-decoder.o +perf-$(CONFIG_AUXTRACE) += intel-pt-pkt-decoder.o intel-pt-insn-decoder.o intel-pt-log.o intel-pt-decoder.o inat_tables_script = util/intel-pt-decoder/gen-insn-attr-x86.awk inat_tables_maps = util/intel-pt-decoder/x86-opcode-map.txt
tools/perf/util/scripting-engines/Build +2 -2
@@ -1,5 +1,5 @@ -libperf-$(CONFIG_LIBPERL) += trace-event-perl.o -libperf-$(CONFIG_LIBPYTHON) += trace-event-python.o +perf-$(CONFIG_LIBPERL) += trace-event-perl.o +perf-$(CONFIG_LIBPYTHON) += trace-event-python.o CFLAGS_trace-event-perl.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow -Wno-nested-externs -Wno-undef -Wno-switch-default
tip-bot for Jiri Olsa
merge bot[tip:perf/core] perf tools: Fix legacy events symbol separator parsing
In reply to Jiri Olsaperf tools: Fix legacy events symbol separator parsing
Commit-ID: 714a92d83fd1e20461f53549cfbee77b20be5032 Gitweb: https://git.kernel.org/tip/714a92d83fd1e20461f53549cfbee77b20be5032 Author: Jiri Olsa <[email protected]> AuthorDate: Wed, 13 Feb 2019 13:32:40 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Thu, 14 Feb 2019 15:18:08 -0300
perf tools: Fix legacy events symbol separator parsing
Fixing legacy symbol events parsing. We can't support single slash separator, like 'cycles/u', because it conflicts with non empty terms, like 'cycles/period/u'.
Keeping only '//' and ':' separator for these events:
cycles//u
cycles:k
And removing '/' separator support, which is not working anymore. Also adding automated tests for above events.
--- tools/perf/tests/parse-events.c | 30 ++++++++++++++++++++++++++++++ tools/perf/util/parse-events.y | 4 ++-- 2 files changed, 32 insertions(+), 2 deletions(-)
tools/perf/tests/parse-events.c +30 -0
@@ -1330,6 +1330,26 @@ static int test__checkevent_complex_name(struct perf_evlist *evlist)return 0 ; } +static int test__sym_event_slash (struct perf_evlist *evlist) +{ +struct perf_evsel *evsel =perf_evlist__first (evlist); + +TEST_ASSERT_VAL ("wrong type" , evsel->attr.type ==PERF_TYPE_HARDWARE ); +TEST_ASSERT_VAL ("wrong config" , evsel->attr.config ==PERF_COUNT_HW_CPU_CYCLES ); +TEST_ASSERT_VAL ("wrong exclude_kernel" , evsel->attr.exclude_kernel); +return 0 ; +} + +static int test__sym_event_dc (struct perf_evlist *evlist) +{ +struct perf_evsel *evsel =perf_evlist__first (evlist); + +TEST_ASSERT_VAL ("wrong type" , evsel->attr.type ==PERF_TYPE_HARDWARE ); +TEST_ASSERT_VAL ("wrong config" , evsel->attr.config ==PERF_COUNT_HW_CPU_CYCLES ); +TEST_ASSERT_VAL ("wrong exclude_user" , evsel->attr.exclude_user); +return 0 ; +} +static int count_tracepoints (void ) {struct dirent *events_ent;
@@ -1670,6 +1690,16 @@ static struct evlist_test test__events[] = { .name = "cycles/name='COMPLEX_CYCLES_NAME:orig=cycles,desc=chip-clock-ticks'/Duk", .check = test__checkevent_complex_name, .id = 53 + }, + { + .name = "cycles//u", + .check = test__sym_event_slash, + .id = 54, + }, + { + .name = "cycles:k", + .check = test__sym_event_dc, + .id = 55, } };
tools/perf/util/parse-events.y +2 -2
@@ -311,7 +311,7 @@ value_sym '/' event_config '/' $$ = list; } | -value_sym sep_slash_dc +value_sym sep_slash_slash_dc { struct list_head *list; int type = $1 >> 16;
@@ -702,7 +702,7 @@ PE_VALUE PE_ARRAY_RANGE PE_VALUE sep_dc: ':' | -sep_slash_dc: '/' | ':' | +sep_slash_slash_dc: '/' '/' | ':' | %%
tip-bot for Jiri Olsa
merge bot[tip:perf/core] perf list: Display metric expressions for --details option
In reply to Jiri Olsaperf list: Display metric expressions for --details option
Commit-ID: 33bbc571ed79cace481fae4031b80a51d93ae997 Gitweb: https://git.kernel.org/tip/33bbc571ed79cace481fae4031b80a51d93ae997 Author: Jiri Olsa <[email protected]> AuthorDate: Wed, 13 Feb 2019 13:32:41 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Thu, 14 Feb 2019 15:18:09 -0300
perf list: Display metric expressions for --details option
Display metric expression itself when --details is specified.
Current list with no details:
# perf list metrics
...
TopDownL1:
IPC
[Instructions Per Cycle (per logical thread)]
SLOTS
[Total issue-pipeline slots]
...Detailed output with metric formula:
# perf list --details metrics
...
TopDownL1:
IPC
[Instructions Per Cycle (per logical thread)]
[inst_retired.any / cpu_clk_unhalted.thread]
SLOTS
[Total issue-pipeline slots]
[4*(( cpu_clk_unhalted.thread_any / 2 ) if #smt_on else cycles)]
...--- tools/perf/builtin-list.c | 8 ++++---- tools/perf/util/metricgroup.c | 8 +++++++- tools/perf/util/metricgroup.h | 3 ++- tools/perf/util/parse-events.c | 2 +- 4 files changed, 14 insertions(+), 7 deletions(-)
tools/perf/builtin-list.c +4 -4
@@ -82,9 +82,9 @@ int cmd_list(int argc, const char **argv)else if (strcmp (argv[i],"sdt" ) ==0 )print_sdt_events (NULL ,NULL , raw_dump);else if (strcmp (argv[i],"metric" ) ==0 ) -metricgroup__print (true, false,NULL , raw_dump); +metricgroup__print (true, false,NULL , raw_dump, details_flag);else if (strcmp (argv[i],"metricgroup" ) ==0 ) -metricgroup__print (false, true,NULL , raw_dump); +metricgroup__print (false, true,NULL , raw_dump, details_flag);else if ((sep =strchr (argv[i],':' )) !=NULL ) {int sep_idx;
@@ -102,7 +102,7 @@ int cmd_list(int argc, const char **argv) s[sep_idx] ='\0' ;print_tracepoint_events (s, s + sep_idx +1 , raw_dump);print_sdt_events (s, s + sep_idx +1 , raw_dump); -metricgroup__print (true, true, s, raw_dump); +metricgroup__print (true, true, s, raw_dump, details_flag);free (s); }else {if (asprintf (&s,"*%s*" , argv[i]) <0 ) {
@@ -119,7 +119,7 @@ int cmd_list(int argc, const char **argv) details_flag);print_tracepoint_events (NULL , s, raw_dump);print_sdt_events (NULL , s, raw_dump); -metricgroup__print (true, true,NULL , raw_dump); +metricgroup__print (true, true,NULL , raw_dump, details_flag);free (s); } }
tools/perf/util/metricgroup.c +7 -1
@@ -270,7 +270,7 @@ static void metricgroup__print_strlist(struct strlist *metrics, bool raw) }void metricgroup__print (bool metrics,bool metricgroups,char *filter, -bool raw) +bool raw,bool details) {struct pmu_events_map *map =perf_pmu__find_map (NULL );struct pmu_event *pe;
@@ -329,6 +329,12 @@ void metricgroup__print(bool metrics, bool metricgroups, char *filter,if (asprintf (&s,"%s\n%*s%s]" , pe->metric_name,8 ,"[" , pe->desc) <0 )return ; + +if (details) { +if (asprintf (&s,"%s\n%*s%s]" , + s,8 ,"[" , pe->metric_expr) <0 ) +return ; + } }if (!s)
tools/perf/util/metricgroup.h +2 -1
@@ -27,6 +27,7 @@ int metricgroup__parse_groups(const struct option *opt,const char *str, struct rblist *metric_events); -void metricgroup__print (bool metrics,bool groups,char *filter,bool raw); +void metricgroup__print (bool metrics,bool groups,char *filter, +bool raw,bool details);bool metricgroup__has_metric (const char *metric);#endif
tools/perf/util/parse-events.c +1 -1
@@ -2540,7 +2540,7 @@ void print_events(const char *event_glob, bool name_only, bool quiet_flag,print_sdt_events (NULL ,NULL , name_only); -metricgroup__print (true, true,NULL , name_only); +metricgroup__print (true, true,NULL , name_only, details_flag); }int parse_events__is_hardcoded_term (struct parse_events_term *term)
tip-bot for Jiri Olsa
merge bot[tip:perf/core] perf header: Get rid of write_it label
In reply to Jiri Olsaperf header: Get rid of write_it label
Commit-ID: a9aeb87b98badb55ec28dfcae8a8ce127d6208f5 Gitweb: https://git.kernel.org/tip/a9aeb87b98badb55ec28dfcae8a8ce127d6208f5 Author: Jiri Olsa <[email protected]> AuthorDate: Wed, 13 Feb 2019 13:32:43 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Thu, 14 Feb 2019 15:18:09 -0300
perf header: Get rid of write_it label
Simplifying the code a bit.
--- tools/perf/util/header.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
tools/perf/util/header.c +2 -4
@@ -1042,11 +1042,9 @@ static int write_cpuid(struct feat_fd *ff,int ret; ret =get_cpuid (buffer,sizeof (buffer)); -if (!ret) - goto write_it; +if (ret) +return -1 ; -return -1 ; -write_it:return do_write_string (ff, buffer); }
tip-bot for Jiri Olsa
merge bot[tip:perf/core] perf header: Remove unused 'cpu_nr' field from 'struct cpu_topo'
In reply to Jiri Olsaperf header: Remove unused 'cpu_nr' field from 'struct cpu_topo'
Commit-ID: aa4df30db52293c146b1851b88021d0bc2dd3b89 Gitweb: https://git.kernel.org/tip/aa4df30db52293c146b1851b88021d0bc2dd3b89 Author: Jiri Olsa <[email protected]> AuthorDate: Wed, 13 Feb 2019 13:32:44 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Thu, 14 Feb 2019 15:18:09 -0300
perf header: Remove unused 'cpu_nr' field from 'struct cpu_topo'
Not used at all.
--- tools/perf/util/header.c | 2 -- 1 file changed, 2 deletions(-)
tools/perf/util/header.c +0 -2
@@ -563,7 +563,6 @@ static int write_cmdline(struct feat_fd *ff,"/sys/devices/system/cpu/cpu%d/topology/thread_siblings_list" struct cpu_topo { -u32 cpu_nr;u32 core_sib;u32 thread_sib;char **core_siblings;
@@ -679,7 +678,6 @@ static struct cpu_topo *build_cpu_topology(void) goto out_free; tp = addr; - tp->cpu_nr = nr; addr +=sizeof (*tp); tp->core_siblings = addr; addr += sz;
Re: [PATCH 09/10] perf tools: Add perf_topo_cpu object
In reply to a message not in the archiveQuoted 16 lines · Arnaldo Carvalho de Melo
Em Wed, Feb 13, 2019 at 01:32:45PM +0100, Jiri Olsa escreveu:
Quoted 9 lines
Making struct
cpu_topoglobal and renaming it to structperf_topo_cpu, so it can be used from record command in following patches.Adding following interface functions to load/free cpu topology details:
structperf_topo_cpu*perf_topo_cpu__new(void); voidperf_topo_cpu__free(struct perf_topo_cpu *tp);Quoted 5 lines
Moving it into separate object file
cputopo.ctogether with numa related object in following patches.No functional change, the new interface will be used in upcoming changes.
Quoted 6 lines
Please rename it to 'struct
cpu_topology' and make its related functions becpu_topology__new, the__free()should be__delete()since it doesn't just free its members, but deletes itself as well.I think this is not perf specific at all, so no need for the 'perf' prefix.
ok, will do
jirka
Re: [PATCH 06/10] perf header: Fix wrong node write in NUMA_TOPOLOGY feature
In reply to a message not in the archiveQuoted 5 lines · Arnaldo Carvalho de Melo
Em Wed, Feb 13, 2019 at 06:09:43PM -0300, Arnaldo Carvalho de Melo escreveu:
Quoted 4 lines
Em Wed, Feb 13, 2019 at 01:32:42PM +0100, Jiri Olsa escreveu:
Quoted 2 lines
We are currently passing the node index instead of the real node number.
Quoted 8 lines
Quoted 2 lines
Next time please add a Fixes: so that the stables guys get this thing... /me looking for that now.
So this comes from:
Fixes fbe96f29ce4b ("perf tools: Make perf.data more self-descriptive (v8)"Right?
right, thanks
jirka
Quoted 34 lines
- Arnaldo
Quoted 27 lines
- Arnaldo
Quoted 21 lines
Signed-off-by Jiri Olsa <[email protected]>--- tools/perf/util/header.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/perf/util/header.c +1
-1@@ -881,7 +881,7 @@ static int write_numa_topology(struct feat_fd *ff,if (ret <0 )break ; - ret =write_topo_node (ff, i); + ret =write_topo_node (ff, j);if (ret <0 )break ; }Signature · 1 line
2.17.2Signature · 1 line
- ArnaldoSignature · 1 line
- Arnaldo