Commit 43f4e627 authored by Ingo Molnar's avatar Ingo Molnar

Merge tag 'perf-core-for-mingo-5.1-20190214' of...

Merge tag 'perf-core-for-mingo-5.1-20190214' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core

Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:

perf list:

  Jiri Olsa:

  - Display metric expressions for --details option

perf record:

  Alexey Budankov:

  - Implement --affinity=node|cpu option, leftover, the other patches
    in this kit were already applied.

perf trace:

  Arnaldo Carvalho de Melo:

  - Fix segfaults due to not properly handling negative file descriptor syscall args.

  - Fix segfault related to the 'waitid' 'options' prefix showing logic.

  - Filter out 'gnome-terminal*' if it is a parent of 'perf trace', to reduce the
    syscall feedback loop in system wide sessions.

BPF:

  Song Liu:

  - Silence "Couldn't synthesize bpf events" warning for EPERM.

Build system:

  Arnaldo Carvalho de Melo:

  - Fix the test-all.c feature detection fast path that was broken for
    quite a while leading to longer build times.

Event parsing:

  Jiri Olsa:

  - Fix legacy events symbol separator parsing

cs-etm:

  Mathieu Poirier:

  - Fix some error path return errors and plug some memory leaks.

  - Add proper header file for symbols

  - Remove unused structure fields.

  - Modularize auxtrace_buffer fetch, decoder and packet processing loop.

Vendor events:

  Paul Clarke:

  - Add assorted metrics for the Power8 and Power9 architectures.

perf report:

  Thomas Richter:

  - Add s390 diagnostic sampling descriptor size
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents 02106f88 44ec8396
...@@ -53,10 +53,6 @@ FEATURE_TESTS_BASIC := \ ...@@ -53,10 +53,6 @@ FEATURE_TESTS_BASIC := \
libslang \ libslang \
libcrypto \ libcrypto \
libunwind \ libunwind \
libunwind-x86 \
libunwind-x86_64 \
libunwind-arm \
libunwind-aarch64 \
pthread-attr-setaffinity-np \ pthread-attr-setaffinity-np \
pthread-barrier \ pthread-barrier \
reallocarray \ reallocarray \
...@@ -70,7 +66,6 @@ FEATURE_TESTS_BASIC := \ ...@@ -70,7 +66,6 @@ FEATURE_TESTS_BASIC := \
sched_getcpu \ sched_getcpu \
sdt \ sdt \
setns \ setns \
libopencsd \
libaio libaio
# FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list # FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
...@@ -84,6 +79,11 @@ FEATURE_TESTS_EXTRA := \ ...@@ -84,6 +79,11 @@ FEATURE_TESTS_EXTRA := \
libbabeltrace \ libbabeltrace \
libbfd-liberty \ libbfd-liberty \
libbfd-liberty-z \ libbfd-liberty-z \
libopencsd \
libunwind-x86 \
libunwind-x86_64 \
libunwind-arm \
libunwind-aarch64 \
libunwind-debug-frame \ libunwind-debug-frame \
libunwind-debug-frame-arm \ libunwind-debug-frame-arm \
libunwind-debug-frame-aarch64 \ libunwind-debug-frame-aarch64 \
......
...@@ -170,14 +170,14 @@ ...@@ -170,14 +170,14 @@
# include "test-setns.c" # include "test-setns.c"
#undef main #undef main
#define main main_test_libopencsd
# include "test-libopencsd.c"
#undef main
#define main main_test_libaio #define main main_test_libaio
# include "test-libaio.c" # include "test-libaio.c"
#undef main #undef main
#define main main_test_reallocarray
# include "test-reallocarray.c"
#undef main
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
main_test_libpython(); main_test_libpython();
...@@ -217,8 +217,8 @@ int main(int argc, char *argv[]) ...@@ -217,8 +217,8 @@ int main(int argc, char *argv[])
main_test_sched_getcpu(); main_test_sched_getcpu();
main_test_sdt(); main_test_sdt();
main_test_setns(); main_test_setns();
main_test_libopencsd();
main_test_libaio(); main_test_libaio();
main_test_reallocarray();
return 0; return 0;
} }
...@@ -8,3 +8,4 @@ int main(void) ...@@ -8,3 +8,4 @@ int main(void)
free(get_current_dir_name()); free(get_current_dir_name());
return 0; return 0;
} }
#undef _GNU_SOURCE
...@@ -7,3 +7,4 @@ int main(void) ...@@ -7,3 +7,4 @@ int main(void)
return 0; return 0;
} }
#undef _GNU_SOURCE
...@@ -6,3 +6,5 @@ int main(void) ...@@ -6,3 +6,5 @@ int main(void)
{ {
return !!reallocarray(NULL, 1, 1); return !!reallocarray(NULL, 1, 1);
} }
#undef _GNU_SOURCE
...@@ -8,3 +8,5 @@ int main(void) ...@@ -8,3 +8,5 @@ int main(void)
{ {
return sched_getcpu(); return sched_getcpu();
} }
#undef _GNU_SOURCE
...@@ -5,3 +5,4 @@ int main(void) ...@@ -5,3 +5,4 @@ int main(void)
{ {
return setns(0, 0); return setns(0, 0);
} }
#undef _GNU_SOURCE
...@@ -46,10 +46,10 @@ CFLAGS_builtin-trace.o += -DSTRACE_GROUPS_DIR="BUILD_STR($(STRACE_GROUPS_DIR_ ...@@ -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 += -DTIPDIR="BUILD_STR($(tipdir_SQ))"
CFLAGS_builtin-report.o += -DDOCDIR="BUILD_STR($(srcdir_SQ)/Documentation)" CFLAGS_builtin-report.o += -DDOCDIR="BUILD_STR($(srcdir_SQ)/Documentation)"
libperf-y += util/ perf-y += util/
libperf-y += arch/ perf-y += arch/
libperf-y += ui/ perf-y += ui/
libperf-y += scripts/ perf-y += scripts/
libperf-$(CONFIG_TRACE) += trace/beauty/ perf-$(CONFIG_TRACE) += trace/beauty/
gtk-y += ui/gtk/ gtk-y += ui/gtk/
...@@ -454,6 +454,11 @@ Use <n> control blocks in asynchronous (Posix AIO) trace writing mode (default: ...@@ -454,6 +454,11 @@ Use <n> control blocks in asynchronous (Posix AIO) trace writing mode (default:
Asynchronous mode is supported only when linking Perf tool with libc library Asynchronous mode is supported only when linking Perf tool with libc library
providing implementation for Posix AIO API. providing implementation for Posix AIO API.
--affinity=mode::
Set affinity mask of trace reading thread according to the policy defined by 'mode' value:
node - thread affinity mask is set to NUMA node cpu mask of the processed mmap buffer
cpu - thread affinity mask is set to cpu of the processed mmap buffer
--all-kernel:: --all-kernel::
Configure all used events to run in kernel space. Configure all used events to run in kernel space.
......
...@@ -109,6 +109,13 @@ FEATURE_CHECK_LDFLAGS-libunwind = $(LIBUNWIND_LDFLAGS) $(LIBUNWIND_LIBS) ...@@ -109,6 +109,13 @@ FEATURE_CHECK_LDFLAGS-libunwind = $(LIBUNWIND_LDFLAGS) $(LIBUNWIND_LIBS)
FEATURE_CHECK_CFLAGS-libunwind-debug-frame = $(LIBUNWIND_CFLAGS) FEATURE_CHECK_CFLAGS-libunwind-debug-frame = $(LIBUNWIND_CFLAGS)
FEATURE_CHECK_LDFLAGS-libunwind-debug-frame = $(LIBUNWIND_LDFLAGS) $(LIBUNWIND_LIBS) FEATURE_CHECK_LDFLAGS-libunwind-debug-frame = $(LIBUNWIND_LDFLAGS) $(LIBUNWIND_LIBS)
FEATURE_CHECK_LDFLAGS-libunwind-arm = -lunwind -lunwind-arm
FEATURE_CHECK_LDFLAGS-libunwind-aarch64 = -lunwind -lunwind-aarch64
FEATURE_CHECK_LDFLAGS-libunwind-x86 = -lunwind -llzma -lunwind-x86
FEATURE_CHECK_LDFLAGS-libunwind-x86_64 = -lunwind -llzma -lunwind-x86_64
FEATURE_CHECK_LDFLAGS-libcrypto = -lcrypto
ifdef CSINCLUDES ifdef CSINCLUDES
LIBOPENCSD_CFLAGS := -I$(CSINCLUDES) LIBOPENCSD_CFLAGS := -I$(CSINCLUDES)
endif endif
...@@ -218,6 +225,8 @@ FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS) ...@@ -218,6 +225,8 @@ FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)
FEATURE_CHECK_CFLAGS-libpython-version := $(PYTHON_EMBED_CCOPTS) FEATURE_CHECK_CFLAGS-libpython-version := $(PYTHON_EMBED_CCOPTS)
FEATURE_CHECK_LDFLAGS-libpython-version := $(PYTHON_EMBED_LDOPTS) FEATURE_CHECK_LDFLAGS-libpython-version := $(PYTHON_EMBED_LDOPTS)
FEATURE_CHECK_LDFLAGS-libaio = -lrt
CFLAGS += -fno-omit-frame-pointer CFLAGS += -fno-omit-frame-pointer
CFLAGS += -ggdb3 CFLAGS += -ggdb3
CFLAGS += -funwind-tables CFLAGS += -funwind-tables
...@@ -386,7 +395,8 @@ ifeq ($(feature-setns), 1) ...@@ -386,7 +395,8 @@ ifeq ($(feature-setns), 1)
$(call detected,CONFIG_SETNS) $(call detected,CONFIG_SETNS)
endif endif
ifndef NO_CORESIGHT ifdef CORESIGHT
$(call feature_check,libopencsd)
ifeq ($(feature-libopencsd), 1) ifeq ($(feature-libopencsd), 1)
CFLAGS += -DHAVE_CSTRACE_SUPPORT $(LIBOPENCSD_CFLAGS) CFLAGS += -DHAVE_CSTRACE_SUPPORT $(LIBOPENCSD_CFLAGS)
LDFLAGS += $(LIBOPENCSD_LDFLAGS) LDFLAGS += $(LIBOPENCSD_LDFLAGS)
...@@ -482,6 +492,7 @@ endif ...@@ -482,6 +492,7 @@ endif
ifndef NO_LIBUNWIND ifndef NO_LIBUNWIND
have_libunwind := have_libunwind :=
$(call feature_check,libunwind-x86)
ifeq ($(feature-libunwind-x86), 1) ifeq ($(feature-libunwind-x86), 1)
$(call detected,CONFIG_LIBUNWIND_X86) $(call detected,CONFIG_LIBUNWIND_X86)
CFLAGS += -DHAVE_LIBUNWIND_X86_SUPPORT CFLAGS += -DHAVE_LIBUNWIND_X86_SUPPORT
...@@ -490,6 +501,7 @@ ifndef NO_LIBUNWIND ...@@ -490,6 +501,7 @@ ifndef NO_LIBUNWIND
have_libunwind = 1 have_libunwind = 1
endif endif
$(call feature_check,libunwind-aarch64)
ifeq ($(feature-libunwind-aarch64), 1) ifeq ($(feature-libunwind-aarch64), 1)
$(call detected,CONFIG_LIBUNWIND_AARCH64) $(call detected,CONFIG_LIBUNWIND_AARCH64)
CFLAGS += -DHAVE_LIBUNWIND_AARCH64_SUPPORT CFLAGS += -DHAVE_LIBUNWIND_AARCH64_SUPPORT
......
...@@ -102,7 +102,7 @@ include ../scripts/utilities.mak ...@@ -102,7 +102,7 @@ include ../scripts/utilities.mak
# When selected, pass LLVM_CONFIG=/path/to/llvm-config to `make' if # When selected, pass LLVM_CONFIG=/path/to/llvm-config to `make' if
# llvm-config is not in $PATH. # llvm-config is not in $PATH.
# #
# Define NO_CORESIGHT if you do not want support for CoreSight trace decoding. # Define CORESIGHT if you DO WANT support for CoreSight trace decoding.
# #
# Define NO_AIO if you do not want support of Posix AIO based trace # Define NO_AIO if you do not want support of Posix AIO based trace
# streaming for record mode. Currently Posix AIO trace streaming is # streaming for record mode. Currently Posix AIO trace streaming is
...@@ -344,9 +344,9 @@ endif ...@@ -344,9 +344,9 @@ endif
export PERL_PATH export PERL_PATH
LIB_FILE=$(OUTPUT)libperf.a LIBPERF_A=$(OUTPUT)libperf.a
PERFLIBS = $(LIB_FILE) $(LIBAPI) $(LIBTRACEEVENT) $(LIBSUBCMD) PERFLIBS = $(LIBAPI) $(LIBTRACEEVENT) $(LIBSUBCMD)
ifndef NO_LIBBPF ifndef NO_LIBBPF
PERFLIBS += $(LIBBPF) PERFLIBS += $(LIBBPF)
endif endif
...@@ -549,6 +549,8 @@ JEVENTS_IN := $(OUTPUT)pmu-events/jevents-in.o ...@@ -549,6 +549,8 @@ JEVENTS_IN := $(OUTPUT)pmu-events/jevents-in.o
PMU_EVENTS_IN := $(OUTPUT)pmu-events/pmu-events-in.o PMU_EVENTS_IN := $(OUTPUT)pmu-events/pmu-events-in.o
LIBPERF_IN := $(OUTPUT)libperf-in.o
export JEVENTS export JEVENTS
build := -f $(srctree)/tools/build/Makefile.build dir=. obj build := -f $(srctree)/tools/build/Makefile.build dir=. obj
...@@ -565,9 +567,12 @@ $(JEVENTS): $(JEVENTS_IN) ...@@ -565,9 +567,12 @@ $(JEVENTS): $(JEVENTS_IN)
$(PMU_EVENTS_IN): $(JEVENTS) FORCE $(PMU_EVENTS_IN): $(JEVENTS) FORCE
$(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=pmu-events obj=pmu-events $(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) \ $(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 $(GTK_IN): FORCE
$(Q)$(MAKE) $(build)=gtk $(Q)$(MAKE) $(build)=gtk
...@@ -683,12 +688,7 @@ endif ...@@ -683,12 +688,7 @@ endif
$(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h) $(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h)
LIBPERF_IN := $(OUTPUT)libperf-in.o $(LIBPERF_A): $(LIBPERF_IN)
$(LIBPERF_IN): prepare FORCE
$(Q)$(MAKE) $(build)=libperf
$(LIB_FILE): $(LIBPERF_IN)
$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIBPERF_IN) $(LIB_OBJS) $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIBPERF_IN) $(LIB_OBJS)
LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ) 'EXTRA_CFLAGS=$(EXTRA_CFLAGS)' 'LDFLAGS=$(LDFLAGS)' LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ) 'EXTRA_CFLAGS=$(EXTRA_CFLAGS)' 'LDFLAGS=$(LDFLAGS)'
...@@ -910,7 +910,7 @@ python-clean: ...@@ -910,7 +910,7 @@ python-clean:
$(python-clean) $(python-clean)
clean:: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean $(LIBBPF)-clean $(LIBSUBCMD)-clean config-clean fixdep-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)find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
$(Q)$(RM) $(OUTPUT).config-detected $(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 $(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf perf-read-vdso32 perf-read-vdsox32 $(OUTPUT)pmu-events/jevents $(OUTPUT)$(LIBJVMTI).so
......
libperf-y += common.o perf-y += common.o
libperf-y += $(SRCARCH)/ perf-y += $(SRCARCH)/
libperf-y += util/ perf-y += util/
libperf-$(CONFIG_DWARF_UNWIND) += tests/ perf-$(CONFIG_DWARF_UNWIND) += tests/
libperf-y += regs_load.o perf-y += regs_load.o
libperf-y += dwarf-unwind.o perf-y += dwarf-unwind.o
libperf-y += vectors-page.o perf-y += vectors-page.o
libperf-y += arch-tests.o perf-y += arch-tests.o
libperf-$(CONFIG_DWARF) += dwarf-regs.o perf-$(CONFIG_DWARF) += dwarf-regs.o
libperf-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o perf-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o
libperf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.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
libperf-y += util/ perf-y += util/
libperf-$(CONFIG_DWARF_UNWIND) += tests/ perf-$(CONFIG_DWARF_UNWIND) += tests/
libperf-y += regs_load.o perf-y += regs_load.o
libperf-y += dwarf-unwind.o perf-y += dwarf-unwind.o
libperf-y += arch-tests.o perf-y += arch-tests.o
libperf-y += header.o perf-y += header.o
libperf-y += sym-handling.o perf-y += sym-handling.o
libperf-$(CONFIG_DWARF) += dwarf-regs.o perf-$(CONFIG_DWARF) += dwarf-regs.o
libperf-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o perf-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o
libperf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.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/auxtrace.o \
../../arm/util/cs-etm.o \ ../../arm/util/cs-etm.o \
arm-spe.o arm-spe.o
libperf-y += util/ perf-y += util/
libperf-y += header.o perf-y += header.o
libperf-y += util/ perf-y += util/
libperf-y += tests/ perf-y += tests/
libperf-$(CONFIG_DWARF_UNWIND) += regs_load.o perf-$(CONFIG_DWARF_UNWIND) += regs_load.o
libperf-$(CONFIG_DWARF_UNWIND) += dwarf-unwind.o perf-$(CONFIG_DWARF_UNWIND) += dwarf-unwind.o
libperf-y += arch-tests.o perf-y += arch-tests.o
libperf-y += header.o perf-y += header.o
libperf-y += sym-handling.o perf-y += sym-handling.o
libperf-y += kvm-stat.o perf-y += kvm-stat.o
libperf-y += perf_regs.o perf-y += perf_regs.o
libperf-y += mem-events.o perf-y += mem-events.o
libperf-$(CONFIG_DWARF) += dwarf-regs.o perf-$(CONFIG_DWARF) += dwarf-regs.o
libperf-$(CONFIG_DWARF) += skip-callchain-idx.o perf-$(CONFIG_DWARF) += skip-callchain-idx.o
libperf-$(CONFIG_LIBUNWIND) += unwind-libunwind.o perf-$(CONFIG_LIBUNWIND) += unwind-libunwind.o
libperf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o perf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o
libperf-y += util/ perf-y += util/
libperf-y += header.o perf-y += header.o
libperf-y += kvm-stat.o perf-y += kvm-stat.o
libperf-$(CONFIG_DWARF) += dwarf-regs.o perf-$(CONFIG_DWARF) += dwarf-regs.o
libperf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.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
libperf-y += util/ perf-y += util/
libperf-$(CONFIG_DWARF) += dwarf-regs.o perf-$(CONFIG_DWARF) += dwarf-regs.o
libperf-y += util/ perf-y += util/
libperf-$(CONFIG_DWARF) += dwarf-regs.o perf-$(CONFIG_DWARF) += dwarf-regs.o
libperf-y += util/ perf-y += util/
libperf-y += tests/ perf-y += tests/
libperf-$(CONFIG_DWARF_UNWIND) += regs_load.o perf-$(CONFIG_DWARF_UNWIND) += regs_load.o
libperf-$(CONFIG_DWARF_UNWIND) += dwarf-unwind.o perf-$(CONFIG_DWARF_UNWIND) += dwarf-unwind.o
libperf-y += arch-tests.o perf-y += arch-tests.o
libperf-y += rdpmc.o perf-y += rdpmc.o
libperf-y += perf-time-to-tsc.o perf-y += perf-time-to-tsc.o
libperf-$(CONFIG_AUXTRACE) += insn-x86.o perf-$(CONFIG_AUXTRACE) += insn-x86.o
libperf-$(CONFIG_X86_64) += bp-modify.o perf-$(CONFIG_X86_64) += bp-modify.o
libperf-y += header.o perf-y += header.o
libperf-y += tsc.o perf-y += tsc.o
libperf-y += pmu.o perf-y += pmu.o
libperf-y += kvm-stat.o perf-y += kvm-stat.o
libperf-y += perf_regs.o perf-y += perf_regs.o
libperf-y += group.o perf-y += group.o
libperf-y += machine.o perf-y += machine.o
libperf-y += event.o perf-y += event.o
libperf-$(CONFIG_DWARF) += dwarf-regs.o perf-$(CONFIG_DWARF) += dwarf-regs.o
libperf-$(CONFIG_BPF_PROLOGUE) += dwarf-regs.o perf-$(CONFIG_BPF_PROLOGUE) += dwarf-regs.o
libperf-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o perf-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind.o
libperf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o perf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o
libperf-$(CONFIG_AUXTRACE) += auxtrace.o perf-$(CONFIG_AUXTRACE) += auxtrace.o
libperf-$(CONFIG_AUXTRACE) += intel-pt.o perf-$(CONFIG_AUXTRACE) += intel-pt.o
libperf-$(CONFIG_AUXTRACE) += intel-bts.o perf-$(CONFIG_AUXTRACE) += intel-bts.o
libperf-y += util/ perf-y += util/
libperf-$(CONFIG_DWARF) += dwarf-regs.o perf-$(CONFIG_DWARF) += dwarf-regs.o
...@@ -82,9 +82,9 @@ int cmd_list(int argc, const char **argv) ...@@ -82,9 +82,9 @@ int cmd_list(int argc, const char **argv)
else if (strcmp(argv[i], "sdt") == 0) else if (strcmp(argv[i], "sdt") == 0)
print_sdt_events(NULL, NULL, raw_dump); print_sdt_events(NULL, NULL, raw_dump);
else if (strcmp(argv[i], "metric") == 0) 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) 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) { else if ((sep = strchr(argv[i], ':')) != NULL) {
int sep_idx; int sep_idx;
...@@ -102,7 +102,7 @@ int cmd_list(int argc, const char **argv) ...@@ -102,7 +102,7 @@ int cmd_list(int argc, const char **argv)
s[sep_idx] = '\0'; s[sep_idx] = '\0';
print_tracepoint_events(s, s + sep_idx + 1, raw_dump); print_tracepoint_events(s, s + sep_idx + 1, raw_dump);
print_sdt_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); free(s);
} else { } else {
if (asprintf(&s, "*%s*", argv[i]) < 0) { if (asprintf(&s, "*%s*", argv[i]) < 0) {
...@@ -119,7 +119,7 @@ int cmd_list(int argc, const char **argv) ...@@ -119,7 +119,7 @@ int cmd_list(int argc, const char **argv)
details_flag); details_flag);
print_tracepoint_events(NULL, s, raw_dump); print_tracepoint_events(NULL, s, raw_dump);
print_sdt_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); free(s);
} }
} }
......
...@@ -1656,6 +1656,21 @@ static int parse_clockid(const struct option *opt, const char *str, int unset) ...@@ -1656,6 +1656,21 @@ static int parse_clockid(const struct option *opt, const char *str, int unset)
return -1; return -1;
} }
static int record__parse_affinity(const struct option *opt, const char *str, int unset)
{
struct record_opts *opts = (struct record_opts *)opt->value;
if (unset || !str)
return 0;
if (!strcasecmp(str, "node"))
opts->affinity = PERF_AFFINITY_NODE;
else if (!strcasecmp(str, "cpu"))
opts->affinity = PERF_AFFINITY_CPU;
return 0;
}
static int record__parse_mmap_pages(const struct option *opt, static int record__parse_mmap_pages(const struct option *opt,
const char *str, const char *str,
int unset __maybe_unused) int unset __maybe_unused)
...@@ -1964,6 +1979,9 @@ static struct option __record_options[] = { ...@@ -1964,6 +1979,9 @@ static struct option __record_options[] = {
&nr_cblocks_default, "n", "Use <n> control blocks in asynchronous trace writing mode (default: 1, max: 4)", &nr_cblocks_default, "n", "Use <n> control blocks in asynchronous trace writing mode (default: 1, max: 4)",
record__aio_parse), record__aio_parse),
#endif #endif
OPT_CALLBACK(0, "affinity", &record.opts, "node|cpu",
"Set affinity mask of trace reading thread to NUMA node cpu mask or cpu of processed mmap buffer",
record__parse_affinity),
OPT_END() OPT_END()
}; };
......
...@@ -1041,6 +1041,9 @@ static const size_t trace__entry_str_size = 2048; ...@@ -1041,6 +1041,9 @@ static const size_t trace__entry_str_size = 2048;
static struct file *thread_trace__files_entry(struct thread_trace *ttrace, int fd) static struct file *thread_trace__files_entry(struct thread_trace *ttrace, int fd)
{ {
if (fd < 0)
return NULL;
if (fd > ttrace->files.max) { if (fd > ttrace->files.max) {
struct file *nfiles = realloc(ttrace->files.table, (fd + 1) * sizeof(struct file)); struct file *nfiles = realloc(ttrace->files.table, (fd + 1) * sizeof(struct file));
...@@ -2768,7 +2771,8 @@ static int trace__set_filter_loop_pids(struct trace *trace) ...@@ -2768,7 +2771,8 @@ static int trace__set_filter_loop_pids(struct trace *trace)
if (parent == NULL) if (parent == NULL)
break; break;
if (!strcmp(thread__comm_str(parent), "sshd")) { if (!strcmp(thread__comm_str(parent), "sshd") ||
strstarts(thread__comm_str(parent), "gnome-terminal")) {
pids[nr++] = parent->tid; pids[nr++] = parent->tid;
break; break;
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
libperf-$(CONFIG_LIBPERL) += perl/Perf-Trace-Util/ perf-$(CONFIG_LIBPERL) += perl/Perf-Trace-Util/
libperf-$(CONFIG_LIBPYTHON) += python/Perf-Trace-Util/ perf-$(CONFIG_LIBPYTHON) += python/Perf-Trace-Util/
libperf-y += Context.o perf-y += Context.o
CFLAGS_Context.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes CFLAGS_Context.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes
CFLAGS_Context.o += -Wno-unused-parameter -Wno-nested-externs -Wno-undef CFLAGS_Context.o += -Wno-unused-parameter -Wno-nested-externs -Wno-undef
......
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 CFLAGS_Context.o += $(PYTHON_EMBED_CCOPTS) -Wno-redundant-decls -Wno-strict-prototypes -Wno-unused-parameter -Wno-nested-externs
...@@ -1330,6 +1330,26 @@ static int test__checkevent_complex_name(struct perf_evlist *evlist) ...@@ -1330,6 +1330,26 @@ static int test__checkevent_complex_name(struct perf_evlist *evlist)
return 0; 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) static int count_tracepoints(void)
{ {
struct dirent *events_ent; struct dirent *events_ent;
...@@ -1670,6 +1690,16 @@ static struct evlist_test test__events[] = { ...@@ -1670,6 +1690,16 @@ static struct evlist_test test__events[] = {
.name = "cycles/name='COMPLEX_CYCLES_NAME:orig=cycles,desc=chip-clock-ticks'/Duk", .name = "cycles/name='COMPLEX_CYCLES_NAME:orig=cycles,desc=chip-clock-ticks'/Duk",
.check = test__checkevent_complex_name, .check = test__checkevent_complex_name,
.id = 53 .id = 53
},
{
.name = "cycles//u",
.check = test__sym_event_slash,
.id = 54,
},
{
.name = "cycles:k",
.check = test__sym_event_dc,
.id = 55,
} }
}; };
......
libperf-y += clone.o perf-y += clone.o
libperf-y += fcntl.o perf-y += fcntl.o
libperf-y += flock.o perf-y += flock.o
ifeq ($(SRCARCH),$(filter $(SRCARCH),x86)) ifeq ($(SRCARCH),$(filter $(SRCARCH),x86))
libperf-y += ioctl.o perf-y += ioctl.o
endif endif
libperf-y += kcmp.o perf-y += kcmp.o
libperf-y += mount_flags.o perf-y += mount_flags.o
libperf-y += pkey_alloc.o perf-y += pkey_alloc.o
libperf-y += arch_prctl.o perf-y += arch_prctl.o
libperf-y += prctl.o perf-y += prctl.o
libperf-y += renameat.o perf-y += renameat.o
libperf-y += sockaddr.o perf-y += sockaddr.o
libperf-y += socket.o perf-y += socket.o
libperf-y += statx.o perf-y += statx.o
...@@ -175,7 +175,7 @@ static size_t ioctl__scnprintf_cmd(unsigned long cmd, char *bf, size_t size, boo ...@@ -175,7 +175,7 @@ static size_t ioctl__scnprintf_cmd(unsigned long cmd, char *bf, size_t size, boo
size_t syscall_arg__scnprintf_ioctl_cmd(char *bf, size_t size, struct syscall_arg *arg) size_t syscall_arg__scnprintf_ioctl_cmd(char *bf, size_t size, struct syscall_arg *arg)
{ {
unsigned long cmd = arg->val; unsigned long cmd = arg->val;
unsigned int fd = syscall_arg__val(arg, 0); int fd = syscall_arg__val(arg, 0);
struct file *file = thread__files_entry(arg->thread, fd); struct file *file = thread__files_entry(arg->thread, fd);
if (file != NULL) { if (file != NULL) {
......
...@@ -11,7 +11,7 @@ static size_t syscall_arg__scnprintf_waitid_options(char *bf, size_t size, ...@@ -11,7 +11,7 @@ static size_t syscall_arg__scnprintf_waitid_options(char *bf, size_t size,
#define P_OPTION(n) \ #define P_OPTION(n) \
if (options & W##n) { \ if (options & W##n) { \
printed += scnprintf(bf + printed, size - printed, "%s%s%s", printed ? "|" : "", show_prefix ? prefix : #n); \ printed += scnprintf(bf + printed, size - printed, "%s%s%s", printed ? "|" : "", show_prefix ? prefix : "", #n); \
options &= ~W##n; \ options &= ~W##n; \
} }
......
libperf-y += setup.o perf-y += setup.o
libperf-y += helpline.o perf-y += helpline.o
libperf-y += progress.o perf-y += progress.o
libperf-y += util.o perf-y += util.o
libperf-y += hist.o perf-y += hist.o
libperf-y += stdio/hist.o perf-y += stdio/hist.o
CFLAGS_setup.o += -DLIBDIR="BUILD_STR($(LIBDIR))" CFLAGS_setup.o += -DLIBDIR="BUILD_STR($(LIBDIR))"
libperf-$(CONFIG_SLANG) += browser.o perf-$(CONFIG_SLANG) += browser.o
libperf-$(CONFIG_SLANG) += browsers/ perf-$(CONFIG_SLANG) += browsers/
libperf-$(CONFIG_SLANG) += tui/ perf-$(CONFIG_SLANG) += tui/
CFLAGS_browser.o += -DENABLE_SLFUTURE_CONST CFLAGS_browser.o += -DENABLE_SLFUTURE_CONST
libperf-y += annotate.o perf-y += annotate.o
libperf-y += hists.o perf-y += hists.o
libperf-y += map.o perf-y += map.o
libperf-y += scripts.o perf-y += scripts.o
libperf-y += header.o perf-y += header.o
CFLAGS_annotate.o += -DENABLE_SLFUTURE_CONST CFLAGS_annotate.o += -DENABLE_SLFUTURE_CONST
CFLAGS_hists.o += -DENABLE_SLFUTURE_CONST CFLAGS_hists.o += -DENABLE_SLFUTURE_CONST
......
libperf-y += setup.o perf-y += setup.o
libperf-y += util.o perf-y += util.o
libperf-y += helpline.o perf-y += helpline.o
libperf-y += progress.o perf-y += progress.o
libperf-y += annotate.o perf-y += annotate.o
libperf-y += block-range.o perf-y += block-range.o
libperf-y += build-id.o perf-y += build-id.o
libperf-y += config.o perf-y += config.o
libperf-y += ctype.o perf-y += ctype.o
libperf-y += db-export.o perf-y += db-export.o
libperf-y += env.o perf-y += env.o
libperf-y += event.o perf-y += event.o
libperf-y += evlist.o perf-y += evlist.o
libperf-y += evsel.o perf-y += evsel.o
libperf-y += evsel_fprintf.o perf-y += evsel_fprintf.o
libperf-y += find_bit.o perf-y += find_bit.o
libperf-y += get_current_dir_name.o perf-y += get_current_dir_name.o
libperf-y += kallsyms.o perf-y += kallsyms.o
libperf-y += levenshtein.o perf-y += levenshtein.o
libperf-y += llvm-utils.o perf-y += llvm-utils.o
libperf-y += mmap.o perf-y += mmap.o
libperf-y += memswap.o perf-y += memswap.o
libperf-y += parse-events.o perf-y += parse-events.o
libperf-y += perf_regs.o perf-y += perf_regs.o
libperf-y += path.o perf-y += path.o
libperf-y += print_binary.o perf-y += print_binary.o
libperf-y += rbtree.o perf-y += rbtree.o
libperf-y += libstring.o perf-y += libstring.o
libperf-y += bitmap.o perf-y += bitmap.o
libperf-y += hweight.o perf-y += hweight.o
libperf-y += smt.o perf-y += smt.o
libperf-y += strbuf.o perf-y += strbuf.o
libperf-y += string.o perf-y += string.o
libperf-y += strlist.o perf-y += strlist.o
libperf-y += strfilter.o perf-y += strfilter.o
libperf-y += top.o perf-y += top.o
libperf-y += usage.o perf-y += usage.o
libperf-y += dso.o perf-y += dso.o
libperf-y += symbol.o perf-y += symbol.o
libperf-y += symbol_fprintf.o perf-y += symbol_fprintf.o
libperf-y += color.o perf-y += color.o
libperf-y += color_config.o perf-y += color_config.o
libperf-y += metricgroup.o perf-y += metricgroup.o
libperf-y += header.o perf-y += header.o
libperf-y += callchain.o perf-y += callchain.o
libperf-y += values.o perf-y += values.o
libperf-y += debug.o perf-y += debug.o
libperf-y += machine.o perf-y += machine.o
libperf-y += map.o perf-y += map.o
libperf-y += pstack.o perf-y += pstack.o
libperf-y += session.o perf-y += session.o
libperf-y += sample-raw.o perf-y += sample-raw.o
libperf-y += s390-sample-raw.o perf-y += s390-sample-raw.o
libperf-$(CONFIG_TRACE) += syscalltbl.o perf-$(CONFIG_TRACE) += syscalltbl.o
libperf-y += ordered-events.o perf-y += ordered-events.o
libperf-y += namespaces.o perf-y += namespaces.o
libperf-y += comm.o perf-y += comm.o
libperf-y += thread.o perf-y += thread.o
libperf-y += thread_map.o perf-y += thread_map.o
libperf-y += trace-event-parse.o perf-y += trace-event-parse.o
libperf-y += parse-events-flex.o perf-y += parse-events-flex.o
libperf-y += parse-events-bison.o perf-y += parse-events-bison.o
libperf-y += pmu.o perf-y += pmu.o
libperf-y += pmu-flex.o perf-y += pmu-flex.o
libperf-y += pmu-bison.o perf-y += pmu-bison.o
libperf-y += trace-event-read.o perf-y += trace-event-read.o
libperf-y += trace-event-info.o perf-y += trace-event-info.o
libperf-y += trace-event-scripting.o perf-y += trace-event-scripting.o
libperf-y += trace-event.o perf-y += trace-event.o
libperf-y += svghelper.o perf-y += svghelper.o
libperf-y += sort.o perf-y += sort.o
libperf-y += hist.o perf-y += hist.o
libperf-y += util.o perf-y += util.o
libperf-y += xyarray.o perf-y += xyarray.o
libperf-y += cpumap.o perf-y += cpumap.o
libperf-y += cgroup.o perf-y += cgroup.o
libperf-y += target.o perf-y += target.o
libperf-y += rblist.o perf-y += rblist.o
libperf-y += intlist.o perf-y += intlist.o
libperf-y += vdso.o perf-y += vdso.o
libperf-y += counts.o perf-y += counts.o
libperf-y += stat.o perf-y += stat.o
libperf-y += stat-shadow.o perf-y += stat-shadow.o
libperf-y += stat-display.o perf-y += stat-display.o
libperf-y += record.o perf-y += record.o
libperf-y += srcline.o perf-y += srcline.o
libperf-y += srccode.o perf-y += srccode.o
libperf-y += data.o perf-y += data.o
libperf-y += tsc.o perf-y += tsc.o
libperf-y += cloexec.o perf-y += cloexec.o
libperf-y += call-path.o perf-y += call-path.o
libperf-y += rwsem.o perf-y += rwsem.o
libperf-y += thread-stack.o perf-y += thread-stack.o
libperf-$(CONFIG_AUXTRACE) += auxtrace.o perf-$(CONFIG_AUXTRACE) += auxtrace.o
libperf-$(CONFIG_AUXTRACE) += intel-pt-decoder/ perf-$(CONFIG_AUXTRACE) += intel-pt-decoder/
libperf-$(CONFIG_AUXTRACE) += intel-pt.o perf-$(CONFIG_AUXTRACE) += intel-pt.o
libperf-$(CONFIG_AUXTRACE) += intel-bts.o perf-$(CONFIG_AUXTRACE) += intel-bts.o
libperf-$(CONFIG_AUXTRACE) += arm-spe.o perf-$(CONFIG_AUXTRACE) += arm-spe.o
libperf-$(CONFIG_AUXTRACE) += arm-spe-pkt-decoder.o perf-$(CONFIG_AUXTRACE) += arm-spe-pkt-decoder.o
libperf-$(CONFIG_AUXTRACE) += s390-cpumsf.o perf-$(CONFIG_AUXTRACE) += s390-cpumsf.o
ifdef CONFIG_LIBOPENCSD ifdef CONFIG_LIBOPENCSD
libperf-$(CONFIG_AUXTRACE) += cs-etm.o perf-$(CONFIG_AUXTRACE) += cs-etm.o
libperf-$(CONFIG_AUXTRACE) += cs-etm-decoder/ perf-$(CONFIG_AUXTRACE) += cs-etm-decoder/
endif endif
libperf-y += parse-branch-options.o perf-y += parse-branch-options.o
libperf-y += dump-insn.o perf-y += dump-insn.o
libperf-y += parse-regs-options.o perf-y += parse-regs-options.o
libperf-y += term.o perf-y += term.o
libperf-y += help-unknown-cmd.o perf-y += help-unknown-cmd.o
libperf-y += mem-events.o perf-y += mem-events.o
libperf-y += vsprintf.o perf-y += vsprintf.o
libperf-y += units.o perf-y += units.o
libperf-y += time-utils.o perf-y += time-utils.o
libperf-y += expr-bison.o perf-y += expr-bison.o
libperf-y += branch.o perf-y += branch.o
libperf-y += mem2node.o perf-y += mem2node.o
libperf-$(CONFIG_LIBBPF) += bpf-loader.o perf-$(CONFIG_LIBBPF) += bpf-loader.o
libperf-$(CONFIG_BPF_PROLOGUE) += bpf-prologue.o perf-$(CONFIG_BPF_PROLOGUE) += bpf-prologue.o
libperf-$(CONFIG_LIBELF) += symbol-elf.o perf-$(CONFIG_LIBELF) += symbol-elf.o
libperf-$(CONFIG_LIBELF) += probe-file.o perf-$(CONFIG_LIBELF) += probe-file.o
libperf-$(CONFIG_LIBELF) += probe-event.o perf-$(CONFIG_LIBELF) += probe-event.o
ifndef CONFIG_LIBELF ifndef CONFIG_LIBELF
libperf-y += symbol-minimal.o perf-y += symbol-minimal.o
endif endif
ifndef CONFIG_SETNS ifndef CONFIG_SETNS
libperf-y += setns.o perf-y += setns.o
endif endif
libperf-$(CONFIG_DWARF) += probe-finder.o perf-$(CONFIG_DWARF) += probe-finder.o
libperf-$(CONFIG_DWARF) += dwarf-aux.o perf-$(CONFIG_DWARF) += dwarf-aux.o
libperf-$(CONFIG_DWARF) += dwarf-regs.o perf-$(CONFIG_DWARF) += dwarf-regs.o
libperf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o perf-$(CONFIG_LIBDW_DWARF_UNWIND) += unwind-libdw.o
libperf-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind-local.o perf-$(CONFIG_LOCAL_LIBUNWIND) += unwind-libunwind-local.o
libperf-$(CONFIG_LIBUNWIND) += unwind-libunwind.o perf-$(CONFIG_LIBUNWIND) += unwind-libunwind.o
libperf-$(CONFIG_LIBUNWIND_X86) += libunwind/x86_32.o perf-$(CONFIG_LIBUNWIND_X86) += libunwind/x86_32.o
libperf-$(CONFIG_LIBUNWIND_AARCH64) += libunwind/arm64.o perf-$(CONFIG_LIBUNWIND_AARCH64) += libunwind/arm64.o
libperf-$(CONFIG_LIBBABELTRACE) += data-convert-bt.o perf-$(CONFIG_LIBBABELTRACE) += data-convert-bt.o
libperf-y += scripting-engines/ perf-y += scripting-engines/
libperf-$(CONFIG_ZLIB) += zlib.o perf-$(CONFIG_ZLIB) += zlib.o
libperf-$(CONFIG_LZMA) += lzma.o perf-$(CONFIG_LZMA) += lzma.o
libperf-y += demangle-java.o perf-y += demangle-java.o
libperf-y += demangle-rust.o perf-y += demangle-rust.o
ifdef CONFIG_JITDUMP ifdef CONFIG_JITDUMP
libperf-$(CONFIG_LIBELF) += jitdump.o perf-$(CONFIG_LIBELF) += jitdump.o
libperf-$(CONFIG_LIBELF) += genelf.o perf-$(CONFIG_LIBELF) += genelf.o
libperf-$(CONFIG_DWARF) += genelf_debug.o perf-$(CONFIG_DWARF) += genelf_debug.o
endif endif
libperf-y += perf-hooks.o perf-y += perf-hooks.o
libperf-$(CONFIG_LIBBPF) += bpf-event.o perf-$(CONFIG_LIBBPF) += bpf-event.o
libperf-$(CONFIG_CXX) += c++/ perf-$(CONFIG_CXX) += c++/
CFLAGS_config.o += -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))" CFLAGS_config.o += -DETC_PERFCONFIG="BUILD_STR($(ETC_PERFCONFIG_SQ))"
CFLAGS_llvm-utils.o += -DPERF_INCLUDE_DIR="BUILD_STR($(perf_include_dir_SQ))" CFLAGS_llvm-utils.o += -DPERF_INCLUDE_DIR="BUILD_STR($(perf_include_dir_SQ))"
......
...@@ -236,8 +236,8 @@ int perf_event__synthesize_bpf_events(struct perf_tool *tool, ...@@ -236,8 +236,8 @@ int perf_event__synthesize_bpf_events(struct perf_tool *tool,
pr_debug("%s: can't get next program: %s%s", pr_debug("%s: can't get next program: %s%s",
__func__, strerror(errno), __func__, strerror(errno),
errno == EINVAL ? " -- kernel too old?" : ""); errno == EINVAL ? " -- kernel too old?" : "");
/* don't report error on old kernel */ /* don't report error on old kernel or EPERM */
err = (errno == EINVAL) ? 0 : -1; err = (errno == EINVAL || errno == EPERM) ? 0 : -1;
break; break;
} }
fd = bpf_prog_get_fd_by_id(id); fd = bpf_prog_get_fd_by_id(id);
......
libperf-$(CONFIG_CLANGLLVM) += clang.o perf-$(CONFIG_CLANGLLVM) += clang.o
libperf-$(CONFIG_CLANGLLVM) += clang-test.o perf-$(CONFIG_CLANGLLVM) += clang-test.o
libperf-$(CONFIG_AUXTRACE) += cs-etm-decoder.o perf-$(CONFIG_AUXTRACE) += cs-etm-decoder.o
...@@ -15,13 +15,6 @@ ...@@ -15,13 +15,6 @@
struct cs_etm_decoder; struct cs_etm_decoder;
struct cs_etm_buffer {
const unsigned char *buf;
size_t len;
u64 offset;
u64 ref_timestamp;
};
enum cs_etm_sample_type { enum cs_etm_sample_type {
CS_ETM_EMPTY, CS_ETM_EMPTY,
CS_ETM_RANGE, CS_ETM_RANGE,
...@@ -105,9 +98,10 @@ enum { ...@@ -105,9 +98,10 @@ enum {
CS_ETM_PROTO_PTM, CS_ETM_PROTO_PTM,
}; };
enum { enum cs_etm_decoder_operation {
CS_ETM_OPERATION_PRINT = 1, CS_ETM_OPERATION_PRINT = 1,
CS_ETM_OPERATION_DECODE, CS_ETM_OPERATION_DECODE,
CS_ETM_OPERATION_MAX,
}; };
int cs_etm_decoder__process_data_block(struct cs_etm_decoder *decoder, int cs_etm_decoder__process_data_block(struct cs_etm_decoder *decoder,
......
This diff is collapsed.
...@@ -105,8 +105,8 @@ struct intlist *traceid_list; ...@@ -105,8 +105,8 @@ struct intlist *traceid_list;
#define CS_ETM_HEADER_SIZE (CS_HEADER_VERSION_0_MAX * sizeof(u64)) #define CS_ETM_HEADER_SIZE (CS_HEADER_VERSION_0_MAX * sizeof(u64))
static const u64 __perf_cs_etmv3_magic = 0x3030303030303030ULL; #define __perf_cs_etmv3_magic 0x3030303030303030ULL
static const u64 __perf_cs_etmv4_magic = 0x4040404040404040ULL; #define __perf_cs_etmv4_magic 0x4040404040404040ULL
#define CS_ETMV3_PRIV_SIZE (CS_ETM_PRIV_MAX * sizeof(u64)) #define CS_ETMV3_PRIV_SIZE (CS_ETM_PRIV_MAX * sizeof(u64))
#define CS_ETMV4_PRIV_SIZE (CS_ETMV4_PRIV_MAX * sizeof(u64)) #define CS_ETMV4_PRIV_SIZE (CS_ETMV4_PRIV_MAX * sizeof(u64))
......
...@@ -563,7 +563,6 @@ static int write_cmdline(struct feat_fd *ff, ...@@ -563,7 +563,6 @@ static int write_cmdline(struct feat_fd *ff,
"/sys/devices/system/cpu/cpu%d/topology/thread_siblings_list" "/sys/devices/system/cpu/cpu%d/topology/thread_siblings_list"
struct cpu_topo { struct cpu_topo {
u32 cpu_nr;
u32 core_sib; u32 core_sib;
u32 thread_sib; u32 thread_sib;
char **core_siblings; char **core_siblings;
...@@ -679,7 +678,6 @@ static struct cpu_topo *build_cpu_topology(void) ...@@ -679,7 +678,6 @@ static struct cpu_topo *build_cpu_topology(void)
goto out_free; goto out_free;
tp = addr; tp = addr;
tp->cpu_nr = nr;
addr += sizeof(*tp); addr += sizeof(*tp);
tp->core_siblings = addr; tp->core_siblings = addr;
addr += sz; addr += sz;
...@@ -1042,11 +1040,9 @@ static int write_cpuid(struct feat_fd *ff, ...@@ -1042,11 +1040,9 @@ static int write_cpuid(struct feat_fd *ff,
int ret; int ret;
ret = get_cpuid(buffer, sizeof(buffer)); ret = get_cpuid(buffer, sizeof(buffer));
if (!ret) if (ret)
goto write_it; return -1;
return -1;
write_it:
return do_write_string(ff, buffer); return do_write_string(ff, buffer);
} }
......
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_script = util/intel-pt-decoder/gen-insn-attr-x86.awk
inat_tables_maps = util/intel-pt-decoder/x86-opcode-map.txt inat_tables_maps = util/intel-pt-decoder/x86-opcode-map.txt
......
...@@ -270,7 +270,7 @@ static void metricgroup__print_strlist(struct strlist *metrics, bool raw) ...@@ -270,7 +270,7 @@ static void metricgroup__print_strlist(struct strlist *metrics, bool raw)
} }
void metricgroup__print(bool metrics, bool metricgroups, char *filter, 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_events_map *map = perf_pmu__find_map(NULL);
struct pmu_event *pe; struct pmu_event *pe;
...@@ -329,6 +329,12 @@ void metricgroup__print(bool metrics, bool metricgroups, char *filter, ...@@ -329,6 +329,12 @@ void metricgroup__print(bool metrics, bool metricgroups, char *filter,
if (asprintf(&s, "%s\n%*s%s]", if (asprintf(&s, "%s\n%*s%s]",
pe->metric_name, 8, "[", pe->desc) < 0) pe->metric_name, 8, "[", pe->desc) < 0)
return; return;
if (details) {
if (asprintf(&s, "%s\n%*s%s]",
s, 8, "[", pe->metric_expr) < 0)
return;
}
} }
if (!s) if (!s)
......
...@@ -27,6 +27,7 @@ int metricgroup__parse_groups(const struct option *opt, ...@@ -27,6 +27,7 @@ int metricgroup__parse_groups(const struct option *opt,
const char *str, const char *str,
struct rblist *metric_events); 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); bool metricgroup__has_metric(const char *metric);
#endif #endif
...@@ -2540,7 +2540,7 @@ void print_events(const char *event_glob, bool name_only, bool quiet_flag, ...@@ -2540,7 +2540,7 @@ void print_events(const char *event_glob, bool name_only, bool quiet_flag,
print_sdt_events(NULL, NULL, name_only); 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) int parse_events__is_hardcoded_term(struct parse_events_term *term)
......
...@@ -311,7 +311,7 @@ value_sym '/' event_config '/' ...@@ -311,7 +311,7 @@ value_sym '/' event_config '/'
$$ = list; $$ = list;
} }
| |
value_sym sep_slash_dc value_sym sep_slash_slash_dc
{ {
struct list_head *list; struct list_head *list;
int type = $1 >> 16; int type = $1 >> 16;
...@@ -702,7 +702,7 @@ PE_VALUE PE_ARRAY_RANGE PE_VALUE ...@@ -702,7 +702,7 @@ PE_VALUE PE_ARRAY_RANGE PE_VALUE
sep_dc: ':' | sep_dc: ':' |
sep_slash_dc: '/' | ':' | sep_slash_slash_dc: '/' '/' | ':' |
%% %%
......
...@@ -352,6 +352,11 @@ static bool s390_cpumsf_validate(int machine_type, ...@@ -352,6 +352,11 @@ static bool s390_cpumsf_validate(int machine_type,
*dsdes = 85; *dsdes = 85;
*bsdes = 32; *bsdes = 32;
break; break;
case 2964:
case 2965:
*dsdes = 112;
*bsdes = 32;
break;
default: default:
/* Illegal trailer entry */ /* Illegal trailer entry */
return false; return false;
......
libperf-$(CONFIG_LIBPERL) += trace-event-perl.o perf-$(CONFIG_LIBPERL) += trace-event-perl.o
libperf-$(CONFIG_LIBPYTHON) += trace-event-python.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 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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment