Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6a6b12e2 authored by Ingo Molnar's avatar Ingo Molnar
Browse files

Merge tag 'perf-core-for-mingo-20161114' of...

Merge tag 'perf-core-for-mingo-20161114' 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:

New features:

 - Allow querying and setting .perfconfig variables (Taeung Song)

 - Show branch information in callchains (predicted, TSX aborts, loop
   iteractions, etc) (Jin Yao)

Infrastructure changes:

 - Support kbuild's CFLAGS_REMOVE_ in tools/build (Jiri Olsa)

 - Plug building jvmti to the main perf Makefile (Jiri Olsa)

Documentation changes:

 - Update Intel PT documentation about context switch events (Arnaldo Carvalho de Melo)

 - Fix 'perf record --call-graph dwarf' help/config in builds not linking
   with a unwind library, mentioning that is a possible record option (Rabin Vincent)

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents 91a79e5f fef51ecd
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -89,7 +89,9 @@ if_changed = $(if $(strip $(any-prereq) $(arg-check)), \
# - per target C flags
# - per object C flags
# - BUILD_STR macro to allow '-D"$(variable)"' constructs
c_flags = -Wp,-MD,$(depfile),-MT,$@ $(CFLAGS) -D"BUILD_STR(s)=\#s" $(CFLAGS_$(basetarget).o) $(CFLAGS_$(obj))
c_flags_1 = -Wp,-MD,$(depfile),-MT,$@ $(CFLAGS) -D"BUILD_STR(s)=\#s" $(CFLAGS_$(basetarget).o) $(CFLAGS_$(obj))
c_flags_2 = $(filter-out $(CFLAGS_REMOVE_$(basetarget).o), $(c_flags_1))
c_flags   = $(filter-out $(CFLAGS_REMOVE_$(obj)), $(c_flags_2))
cxx_flags = -Wp,-MD,$(depfile),-MT,$@ $(CXXFLAGS) -D"BUILD_STR(s)=\#s" $(CXXFLAGS_$(basetarget).o) $(CXXFLAGS_$(obj))

###
+4 −2
Original line number Diff line number Diff line
@@ -135,8 +135,10 @@ CFLAGS

It's possible to alter the standard object C flags in the following way:

  CFLAGS_perf.o += '...' - alters CFLAGS for perf.o object
  CFLAGS_gtk += '...'    - alters CFLAGS for gtk build object
  CFLAGS_perf.o        += '...'  - adds CFLAGS for perf.o object
  CFLAGS_gtk           += '...'  - adds CFLAGS for gtk build object
  CFLAGS_REMOVE_perf.o += '...'  - removes CFLAGS for perf.o object
  CFLAGS_REMOVE_gtk    += '...'  - removes CFLAGS for gtk build object

This C flags changes has the scope of the Build makefile they are defined in.

+5 −1
Original line number Diff line number Diff line
@@ -47,7 +47,8 @@ FILES= \
	test-bpf.bin			\
	test-get_cpuid.bin		\
	test-sdt.bin			\
	test-cxx.bin
	test-cxx.bin			\
	test-jvmti.bin

FILES := $(addprefix $(OUTPUT),$(FILES))

@@ -225,6 +226,9 @@ $(OUTPUT)test-sdt.bin:
$(OUTPUT)test-cxx.bin:
	$(BUILDXX) -std=gnu++11

$(OUTPUT)test-jvmti.bin:
	$(BUILD)

-include $(OUTPUT)*.d

###############################
+13 −0
Original line number Diff line number Diff line
#include <jvmti.h>
#include <jvmticmlr.h>

int main(void)
{
	JavaVM			jvm	__attribute__((unused));
	jvmtiEventCallbacks	cb	__attribute__((unused));
	jvmtiCapabilities	caps	__attribute__((unused));
	jvmtiJlocationFormat	format	__attribute__((unused));
	jvmtiEnv		jvmti	__attribute__((unused));

	return 0;
}
+17 −2
Original line number Diff line number Diff line
@@ -550,6 +550,18 @@ Unless /proc/sys/kernel/perf_event_paranoid is set to -1, unprivileged users
have memory limits imposed upon them.  That affects what buffer sizes they can
have as outlined above.

The v4.2 kernel introduced support for a context switch metadata event,
PERF_RECORD_SWITCH, which allows unprivileged users to see when their processes
are scheduled out and in, just not by whom, which is left for the
PERF_RECORD_SWITCH_CPU_WIDE, that is only accessible in system wide context,
which in turn requires CAP_SYS_ADMIN.

Please see the 45ac1403f564 ("perf: Add PERF_RECORD_SWITCH to indicate context
switches") commit, that introduces these metadata events for further info.

When working with kernels < v4.2, the following considerations must be taken,
as the sched:sched_switch tracepoints will be used to receive such information:

Unless /proc/sys/kernel/perf_event_paranoid is set to -1, unprivileged users are
not permitted to use tracepoints which means there is insufficient side-band
information to decode Intel PT in per-cpu mode, and potentially workload-only
@@ -564,8 +576,11 @@ sched_switch tracepoint
-----------------------

The sched_switch tracepoint is used to provide side-band data for Intel PT
decoding.  sched_switch events are automatically added. e.g. the second event
shown below
decoding in kernels where the PERF_RECORD_SWITCH metadata event isn't
available.

The sched_switch events are automatically added. e.g. the second event shown
below:

	$ perf record -vv -e intel_pt//u uname
	------------------------------------------------------------
Loading