Skip to content

Commit

Permalink
Merge tag 'perf-core-for-mingo-5.1-20190214' of git://git.kernel.org/…
Browse files Browse the repository at this point in the history
…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: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Ingo Molnar committed Feb 15, 2019
2 parents 02106f8 + 44ec839 commit 43f4e62
Show file tree
Hide file tree
Showing 64 changed files with 4,877 additions and 512 deletions.
10 changes: 5 additions & 5 deletions tools/build/Makefile.feature
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ FEATURE_TESTS_BASIC := \
libslang \
libcrypto \
libunwind \
libunwind-x86 \
libunwind-x86_64 \
libunwind-arm \
libunwind-aarch64 \
pthread-attr-setaffinity-np \
pthread-barrier \
reallocarray \
Expand All @@ -70,7 +66,6 @@ FEATURE_TESTS_BASIC := \
sched_getcpu \
sdt \
setns \
libopencsd \
libaio

# FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
Expand All @@ -84,6 +79,11 @@ FEATURE_TESTS_EXTRA := \
libbabeltrace \
libbfd-liberty \
libbfd-liberty-z \
libopencsd \
libunwind-x86 \
libunwind-x86_64 \
libunwind-arm \
libunwind-aarch64 \
libunwind-debug-frame \
libunwind-debug-frame-arm \
libunwind-debug-frame-aarch64 \
Expand Down
10 changes: 5 additions & 5 deletions tools/build/feature/test-all.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,14 @@
# include "test-setns.c"
#undef main

#define main main_test_libopencsd
# include "test-libopencsd.c"
#undef main

#define main main_test_libaio
# include "test-libaio.c"
#undef main

#define main main_test_reallocarray
# include "test-reallocarray.c"
#undef main

int main(int argc, char *argv[])
{
main_test_libpython();
Expand Down Expand Up @@ -217,8 +217,8 @@ int main(int argc, char *argv[])
main_test_sched_getcpu();
main_test_sdt();
main_test_setns();
main_test_libopencsd();
main_test_libaio();
main_test_reallocarray();

return 0;
}
1 change: 1 addition & 0 deletions tools/build/feature/test-get_current_dir_name.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ int main(void)
free(get_current_dir_name());
return 0;
}
#undef _GNU_SOURCE
1 change: 1 addition & 0 deletions tools/build/feature/test-libpython.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ int main(void)

return 0;
}
#undef _GNU_SOURCE
2 changes: 2 additions & 0 deletions tools/build/feature/test-reallocarray.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ int main(void)
{
return !!reallocarray(NULL, 1, 1);
}

#undef _GNU_SOURCE
2 changes: 2 additions & 0 deletions tools/build/feature/test-sched_getcpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ int main(void)
{
return sched_getcpu();
}

#undef _GNU_SOURCE
1 change: 1 addition & 0 deletions tools/build/feature/test-setns.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ int main(void)
{
return setns(0, 0);
}
#undef _GNU_SOURCE
10 changes: 5 additions & 5 deletions tools/perf/Build
Original file line number Diff line number Diff line change
Expand Up @@ -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/
5 changes: 5 additions & 0 deletions tools/perf/Documentation/perf-record.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
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::
Configure all used events to run in kernel space.

Expand Down
14 changes: 13 additions & 1 deletion tools/perf/Makefile.config
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@ FEATURE_CHECK_LDFLAGS-libunwind = $(LIBUNWIND_LDFLAGS) $(LIBUNWIND_LIBS)
FEATURE_CHECK_CFLAGS-libunwind-debug-frame = $(LIBUNWIND_CFLAGS)
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
LIBOPENCSD_CFLAGS := -I$(CSINCLUDES)
endif
Expand Down Expand Up @@ -218,6 +225,8 @@ FEATURE_CHECK_LDFLAGS-libpython := $(PYTHON_EMBED_LDOPTS)
FEATURE_CHECK_CFLAGS-libpython-version := $(PYTHON_EMBED_CCOPTS)
FEATURE_CHECK_LDFLAGS-libpython-version := $(PYTHON_EMBED_LDOPTS)

FEATURE_CHECK_LDFLAGS-libaio = -lrt

CFLAGS += -fno-omit-frame-pointer
CFLAGS += -ggdb3
CFLAGS += -funwind-tables
Expand Down Expand Up @@ -386,7 +395,8 @@ ifeq ($(feature-setns), 1)
$(call detected,CONFIG_SETNS)
endif

ifndef NO_CORESIGHT
ifdef CORESIGHT
$(call feature_check,libopencsd)
ifeq ($(feature-libopencsd), 1)
CFLAGS += -DHAVE_CSTRACE_SUPPORT $(LIBOPENCSD_CFLAGS)
LDFLAGS += $(LIBOPENCSD_LDFLAGS)
Expand Down Expand Up @@ -482,6 +492,7 @@ endif
ifndef NO_LIBUNWIND
have_libunwind :=

$(call feature_check,libunwind-x86)
ifeq ($(feature-libunwind-x86), 1)
$(call detected,CONFIG_LIBUNWIND_X86)
CFLAGS += -DHAVE_LIBUNWIND_X86_SUPPORT
Expand All @@ -490,6 +501,7 @@ ifndef NO_LIBUNWIND
have_libunwind = 1
endif

$(call feature_check,libunwind-aarch64)
ifeq ($(feature-libunwind-aarch64), 1)
$(call detected,CONFIG_LIBUNWIND_AARCH64)
CFLAGS += -DHAVE_LIBUNWIND_AARCH64_SUPPORT
Expand Down
24 changes: 12 additions & 12 deletions tools/perf/Makefile.perf
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ include ../scripts/utilities.mak
# When selected, pass LLVM_CONFIG=/path/to/llvm-config to `make' if
# 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
# streaming for record mode. Currently Posix AIO trace streaming is
Expand Down Expand Up @@ -344,9 +344,9 @@ endif

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
PERFLIBS += $(LIBBPF)
endif
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -683,12 +688,7 @@ 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)
$(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)'
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tools/perf/arch/Build
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
libperf-y += common.o
libperf-y += $(SRCARCH)/
perf-y += common.o
perf-y += $(SRCARCH)/
4 changes: 2 additions & 2 deletions tools/perf/arch/arm/Build
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
libperf-y += util/
libperf-$(CONFIG_DWARF_UNWIND) += tests/
perf-y += util/
perf-$(CONFIG_DWARF_UNWIND) += tests/
8 changes: 4 additions & 4 deletions tools/perf/arch/arm/tests/Build
Original file line number Diff line number Diff line change
@@ -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
8 changes: 4 additions & 4 deletions tools/perf/arch/arm/util/Build
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions tools/perf/arch/arm64/Build
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
libperf-y += util/
libperf-$(CONFIG_DWARF_UNWIND) += tests/
perf-y += util/
perf-$(CONFIG_DWARF_UNWIND) += tests/
6 changes: 3 additions & 3 deletions tools/perf/arch/arm64/tests/Build
Original file line number Diff line number Diff line change
@@ -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
12 changes: 6 additions & 6 deletions tools/perf/arch/arm64/util/Build
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion tools/perf/arch/nds32/Build
Original file line number Diff line number Diff line change
@@ -1 +1 @@
libperf-y += util/
perf-y += util/
2 changes: 1 addition & 1 deletion tools/perf/arch/nds32/util/Build
Original file line number Diff line number Diff line change
@@ -1 +1 @@
libperf-y += header.o
perf-y += header.o
4 changes: 2 additions & 2 deletions tools/perf/arch/powerpc/Build
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
libperf-y += util/
libperf-y += tests/
perf-y += util/
perf-y += tests/
6 changes: 3 additions & 3 deletions tools/perf/arch/powerpc/tests/Build
Original file line number Diff line number Diff line change
@@ -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
18 changes: 9 additions & 9 deletions tools/perf/arch/powerpc/util/Build
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion tools/perf/arch/s390/Build
Original file line number Diff line number Diff line change
@@ -1 +1 @@
libperf-y += util/
perf-y += util/
12 changes: 6 additions & 6 deletions tools/perf/arch/s390/util/Build
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion tools/perf/arch/sh/Build
Original file line number Diff line number Diff line change
@@ -1 +1 @@
libperf-y += util/
perf-y += util/
2 changes: 1 addition & 1 deletion tools/perf/arch/sh/util/Build
Original file line number Diff line number Diff line change
@@ -1 +1 @@
libperf-$(CONFIG_DWARF) += dwarf-regs.o
perf-$(CONFIG_DWARF) += dwarf-regs.o
2 changes: 1 addition & 1 deletion tools/perf/arch/sparc/Build
Original file line number Diff line number Diff line change
@@ -1 +1 @@
libperf-y += util/
perf-y += util/
2 changes: 1 addition & 1 deletion tools/perf/arch/sparc/util/Build
Original file line number Diff line number Diff line change
@@ -1 +1 @@
libperf-$(CONFIG_DWARF) += dwarf-regs.o
perf-$(CONFIG_DWARF) += dwarf-regs.o
4 changes: 2 additions & 2 deletions tools/perf/arch/x86/Build
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
libperf-y += util/
libperf-y += tests/
perf-y += util/
perf-y += tests/
14 changes: 7 additions & 7 deletions tools/perf/arch/x86/tests/Build
Original file line number Diff line number Diff line change
@@ -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
Loading

0 comments on commit 43f4e62

Please sign in to comment.