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

Commit 750991f9 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull perf fixes from Thomas Gleixner:
 "A pile of perf related fixes:

  Kernel:
   - Fix SLOTS PEBS event constraints for Icelake CPUs

   - Add the missing mask bit to allow counting hardware generated
     prefetches on L3 for Icelake CPUs

   - Make the test for hypervisor platforms more accurate (as far as
     possible)

   - Handle PMUs correctly which override event->cpu

   - Yet another missing fallthrough annotation

  Tools:
     perf.data:
        - Fix loading of compressed data split across adjacent records
        - Fix buffer size setting for processing CPU topology perf.data
          header.

     perf stat:
        - Fix segfault for event group in repeat mode
        - Always separate "stalled cycles per insn" line, it was being
          appended to the "instructions" line.

     perf script:
        - Fix --max-blocks man page description.
        - Improve man page description of metrics.
        - Fix off by one in brstackinsn IPC computation.

     perf probe:
        - Avoid calling freeing routine multiple times for same pointer.

     perf build:
        - Do not use -Wshadow on gcc < 4.8, avoiding too strict warnings
          treated as errors, breaking the build"

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  perf/x86/intel: Mark expected switch fall-throughs
  perf/core: Fix creating kernel counters for PMUs that override event->cpu
  perf/x86: Apply more accurate check on hypervisor platform
  perf/x86/intel: Fix invalid Bit 13 for Icelake MSR_OFFCORE_RSP_x register
  perf/x86/intel: Fix SLOTS PEBS event constraint
  perf build: Do not use -Wshadow on gcc < 4.8
  perf probe: Avoid calling freeing routine multiple times for same pointer
  perf probe: Set pev->nargs to zero after freeing pev->args entries
  perf session: Fix loading of compressed data split across adjacent records
  perf stat: Always separate stalled cycles per insn
  perf stat: Fix segfault for event group in repeat mode
  perf tools: Fix proper buffer size for feature processing
  perf script: Fix off by one in brstackinsn IPC computation
  perf script: Improve man page description of metrics
  perf script: Fix --max-blocks man page description
parents 431f288e 289a2d22
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@
#include <asm/intel-family.h>
#include <asm/apic.h>
#include <asm/cpu_device_id.h>
#include <asm/hypervisor.h>

#include "../perf_event.h"

@@ -263,8 +262,8 @@ static struct event_constraint intel_icl_event_constraints[] = {
};

static struct extra_reg intel_icl_extra_regs[] __read_mostly = {
	INTEL_UEVENT_EXTRA_REG(0x01b7, MSR_OFFCORE_RSP_0, 0x3fffff9fffull, RSP_0),
	INTEL_UEVENT_EXTRA_REG(0x01bb, MSR_OFFCORE_RSP_1, 0x3fffff9fffull, RSP_1),
	INTEL_UEVENT_EXTRA_REG(0x01b7, MSR_OFFCORE_RSP_0, 0x3fffffbfffull, RSP_0),
	INTEL_UEVENT_EXTRA_REG(0x01bb, MSR_OFFCORE_RSP_1, 0x3fffffbfffull, RSP_1),
	INTEL_UEVENT_PEBS_LDLAT_EXTRA_REG(0x01cd),
	INTEL_UEVENT_EXTRA_REG(0x01c6, MSR_PEBS_FRONTEND, 0x7fff17, FE),
	EVENT_EXTRA_END
@@ -4053,7 +4052,7 @@ static bool check_msr(unsigned long msr, u64 mask)
	 * Disable the check for real HW, so we don't
	 * mess with potentionaly enabled registers:
	 */
	if (hypervisor_is_type(X86_HYPER_NATIVE))
	if (!boot_cpu_has(X86_FEATURE_HYPERVISOR))
		return true;

	/*
+1 −1
Original line number Diff line number Diff line
@@ -851,7 +851,7 @@ struct event_constraint intel_skl_pebs_event_constraints[] = {

struct event_constraint intel_icl_pebs_event_constraints[] = {
	INTEL_FLAGS_UEVENT_CONSTRAINT(0x1c0, 0x100000000ULL),	/* INST_RETIRED.PREC_DIST */
	INTEL_FLAGS_UEVENT_CONSTRAINT(0x0400, 0x400000000ULL),	/* SLOTS */
	INTEL_FLAGS_UEVENT_CONSTRAINT(0x0400, 0x800000000ULL),	/* SLOTS */

	INTEL_PLD_CONSTRAINT(0x1cd, 0xff),			/* MEM_TRANS_RETIRED.LOAD_LATENCY */
	INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_LD(0x1d0, 0xf),	/* MEM_INST_RETIRED.LOAD */
+1 −1
Original line number Diff line number Diff line
@@ -11274,7 +11274,7 @@ perf_event_create_kernel_counter(struct perf_event_attr *attr, int cpu,
		goto err_unlock;
	}

	perf_install_in_context(ctx, event, cpu);
	perf_install_in_context(ctx, event, event->cpu);
	perf_unpin_context(ctx);
	mutex_unlock(&ctx->mutex);

+4 −4
Original line number Diff line number Diff line
@@ -228,11 +228,11 @@ OPTIONS

	With the metric option perf script can compute metrics for
	sampling periods, similar to perf stat. This requires
	specifying a group with multiple metrics with the :S option
	specifying a group with multiple events defining metrics with the :S option
	for perf record. perf will sample on the first event, and
	compute metrics for all the events in the group. Please note
	print computed metrics for all the events in the group. Please note
	that the metric computed is averaged over the whole sampling
	period, not just for the sample point.
	period (since the last sample), not just for the sample point.

	For sample events it's possible to display misc field with -F +misc option,
	following letters are displayed for each bit:
@@ -384,7 +384,7 @@ include::itrace.txt[]
	perf script --time 0%-10%,30%-40%

--max-blocks::
	Set the maximum number of program blocks to print with brstackasm for
	Set the maximum number of program blocks to print with brstackinsn for
	each sample.

--reltime::
+10 −0
Original line number Diff line number Diff line
@@ -698,6 +698,16 @@ __cmd_probe(int argc, const char **argv)

		ret = perf_add_probe_events(params.events, params.nevents);
		if (ret < 0) {

			/*
			 * When perf_add_probe_events() fails it calls
			 * cleanup_perf_probe_events(pevs, npevs), i.e.
			 * cleanup_perf_probe_events(params.events, params.nevents), which
			 * will call clear_perf_probe_event(), so set nevents to zero
			 * to avoid cleanup_params() to call clear_perf_probe_event() again
			 * on the same pevs.
			 */
			params.nevents = 0;
			pr_err_with_code("  Error: Failed to add events.", ret);
			return ret;
		}
Loading