perf changes for v3.11
Subsystems (7)
Linus,
Please pull the latest perf-core-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git perf-core-for-linus
HEAD: 983433b5812c5cf33a9008fa38c6f9b407fedb76 perf/x86: Disable PEBS-LL in intel_pmu_pebs_disable()
The main changes:
Kernel improvements:
* watchdog driver improvements by Li Zefan
* Power7 CPI stack events related improvements by Sukadev Bhattiprolu
* event multiplexing via hrtimers and other improvements by Stephane Eranian
* kernel stack use optimization by Andrew Hunter
* AMD IOMMU uncore PMU support by Suravee Suthikulpanit
* NMI handling rate-limits by Dave Hansen
* various hw_breakpoint fixes by Oleg Nesterov
* hw_breakpoint overflow period sampling and related signal handling fixes by Jiri Olsa
* Intel Haswell PMU support by Andi Kleen
Tooling improvements:
* Reset SIGTERM handler in workload child process, fix from David Ahern.
* Makefile reorganization, prep work for Kconfig patches, from Jiri Olsa.
* Add automated make test suite, from Jiri Olsa.
* Add --percent-limit option to 'top' and 'report', from Namhyung Kim.
* Sorting improvements, from Namhyung Kim.
* Expand definition of sysfs format attribute, from Michael Ellerman.
Tooling fixes:
* 'perf tests' fixes from Jiri Olsa.
* Make Power7 CPI stack events available in sysfs, from Sukadev Bhattiprolu.
* Handle death by SIGTERM in 'perf record', fix from David Ahern.
* Fix printing of perf_event_paranoid message, from David Ahern.
* Handle realloc failures in 'perf kvm', from David Ahern.
* Fix divide by 0 in variance, from David Ahern.
* Save parent pid in thread struct, from David Ahern.
* Handle JITed code in shared memory, from Andi Kleen.
* Fixes for 'perf diff', from Jiri Olsa.
* Remove some unused struct members, from Jiri Olsa.
* Add missing liblk.a dependency for python/perf.so, fix from Jiri Olsa.
* Respect CROSS_COMPILE in liblk.a, from Rabin Vincent.
* No need to do locking when adding hists in perf report, only 'top' needs that, from Namhyung Kim.
* Fix alignment of symbol column in in the hists browser (top, report) when -v is given, from NAmhyung Kim.
* Fix 'perf top' -E option behavior, from Namhyung Kim.
* Fix bug in isupper() and islower(), from Sukadev Bhattiprolu.
* Fix compile errors in bp_signal 'perf test', from Sukadev Bhattiprolu.
... and more things.
Thanks,
Ingo
------------------>
Andi Kleen (8):
perf tools: Handle JITed code in shared memory perf/x86/intel: Add Haswell PEBS record support perf/x86/intel: Add simple Haswell PMU support perf/x86/intel: Add Haswell PEBS support perf/x86/intel: Move NMI clearing to end of PMI handler perf/x86/intel: Support Haswell/v4 LBR format perf/x86/intel: Add mem-loads/stores support for Haswell perf/x86/intel: Support full width counting
Andrew Hunter (1):
perf/x86: Reduce stack usage of x86_schedule_events()
Arnaldo Carvalho de Melo (3):
perf archive: Fix typo on Documentation
perf hists browser: Use sort__has_sym
perf test: Fix typo
Dan Carpenter (1):
perf/x86/intel: Prevent some shift wrapping bugs in the Intel uncore driver
Dave Hansen (4):
perf/x86: Only print PMU state when also WARN()'ing
x86: Warn when NMI handlers take large amounts of time
perf: Drop sample rate when sampling is too slow
x86: Add NMI duration tracepoints
David Ahern (6):
perf record: handle death by SIGTERM
perf evsel: Fix printing of perf_event_paranoid message perf kvm: Handle realloc failures
perf stats: Fix divide by 0 in variance
perf tools: Save parent pid in thread struct perf evlist: Reset SIGTERM handler in workload child process
Jiri Olsa (36):
x86/signals: Propagate RF EFLAGS bit through the signal restore call x86/signals: Clear RF EFLAGS bit for signal handler x86/signals: Merge EFLAGS bit clearing into a single statement
perf: Fix hw breakpoints overflow period sampling
perf tools: Fix tab vs spaces issue in Makefile ifdef/endif perf diff: Use internal rb tree for hists__precompute perf hists: Rename hist_entry__add_pair arguments
perf tools: Add automated make test suite
perf tools: Move arch check into config/Makefile
perf tools: Move programs check into config/Makefile
perf tools: Move compiler and linker flags check into config/Makefile perf tools: Move libelf check config into config/Makefile perf tools: Move libdw check config into config/Makefile perf tools: Move libunwind check config into config/Makefile perf tools: Move libaudit check config into config/Makefile perf tools: Move slang check config into config/Makefile perf tools: Move gtk2 check config into config/Makefile perf tools: Move libperl check config into config/Makefile perf tools: Move libpython check config into config/Makefile perf tools: Move libbfd check config into config/Makefile perf tools: Move stdlib check config into config/Makefile perf tools: Move libnuma check config into config/Makefile perf tools: Move paths config into config/Makefile
perf tools: Final touches for CHK config move
perf tests: Fix attr test for record -d option
perf tests: Fix exclude_guest|exclude_host checking for attr tests perf tools: Remove frozen from perf_header struct
perf tools: Remove cwdlen from struct perf_session
perf tools: Merge all *CFLAGS* make variable into CFLAGS perf tools: Merge all *LDFLAGS* make variable into LDFLAGS perf tools: Switch to full path C include directories perf tools: Add NO_BIONIC variable to confiure bionic setup perf tools: Replace tabs with spaces for all non-commands statements perf tools: Replace multiple line assignment with multiple statements perf tools: Remove '?=' Makefile STRIP assignment
perf tools: Add missing liblk.a dependency for python/perf.so
Li Zefan (3):
watchdog: Disallow setting watchdog_thresh to -1
watchdog: Document watchdog_thresh sysctl
watchdog: Remove softlockup_thresh from Documentation
Michael Ellerman (1):
perf: Expand definition of sysfs format attribute
Mischa Jonker (1):
perf: Add const qualifier to perf_pmu_register's 'name' arg
Namhyung Kim (18):
perf hists: Fix an invalid memory free on he->branch_info perf hists: Free unused mem info of a matched hist entry perf report: Fix alignment of symbol column when -v is given perf sort: Introduce sort__mode variable
perf sort: Factor out common code in sort_dimension__add() perf sort: Separate out memory-specific sort keys perf sort: Consolidate sort_entry__setup_elide() perf sort: Reorder HISTC_SRCLINE index
perf sort: Cleanup sort__has_sym setting
perf top: Use sort__has_sym
perf top: Fix -E option behavior
perf top: Fix percent output when no samples collected perf top: Get rid of *_threaded() functions
perf hists: Move locking to its call-sites
perf report: Don't bother locking when adding hist entries perf report: Add --percent-limit option
perf top: Add --percent-limit option
perf report: Add report.percent-limit config variable
Oleg Nesterov (5):
hw_breakpoint: Simplify list/idx mess in toggle_bp_slot() paths
hw_breakpoint: Simplify the "weight" usage in toggle_bp_slot() paths
hw_breakpoint: Introduce cpumask_of_bp()
hw_breakpoint: Simplify *register_wide_hw_breakpoint()
hw_breakpoint: Introduce "struct bp_cpuinfo"
Peter Zijlstra (1):
perf/x86/amd: Rework AMD PMU init code
Rabin Vincent (1):
tools lib lk: Respect CROSS_COMPILE
Stephane Eranian (6):
perf: Use hrtimers for event multiplexing
perf: Add sysfs entry to adjust multiplexing interval per PMU perf/x86: Check branch sampling priv level in generic code
perf: Fix hypervisor branch sampling permission check perf/x86: Fix shared register mutual exclusion enforcement perf/x86: Disable PEBS-LL in intel_pmu_pebs_disable()
Steven L Kinney (1):
perf/x86/amd: Add IOMMU Performance Counter resource management
Sukadev Bhattiprolu (4):
perf tools: Fix bug in isupper() and islower() perf tests: Fix compile errors in bp_signal files
perf: Power7: Make CPI stack events available in sysfs
perf: Power7 Update testing ABI to list CPI-stack events
Suravee Suthikulpanit (1):
perf/x86/amd: AMD IOMMU Performance Counter PERF uncore PMU implementation
Yan, Zheng (1):
perf/x86/intel: Fix sparse warning
.../testing/sysfs-bus-event_source-devices-events | 32 +- .../testing/sysfs-bus-event_source-devices-format | 6 + Documentation/sysctl/kernel.txt | 50 +- Documentation/trace/events-nmi.txt | 43 ++ arch/metag/kernel/perf/perf_event.c | 2 +- arch/powerpc/perf/power7-pmu.c | 73 +++ arch/x86/ia32/ia32_signal.c | 2 - arch/x86/include/asm/perf_event.h | 3 + arch/x86/include/asm/sighandling.h | 4 +- arch/x86/include/uapi/asm/msr-index.h | 3 + arch/x86/kernel/cpu/Makefile | 4 + arch/x86/kernel/cpu/perf_event.c | 69 ++- arch/x86/kernel/cpu/perf_event.h | 24 +- arch/x86/kernel/cpu/perf_event_amd.c | 34 +- arch/x86/kernel/cpu/perf_event_amd_iommu.c | 504 +++++++++++++++++ arch/x86/kernel/cpu/perf_event_amd_iommu.h | 40 ++ arch/x86/kernel/cpu/perf_event_intel.c | 136 ++++- arch/x86/kernel/cpu/perf_event_intel_ds.c | 178 +++++- arch/x86/kernel/cpu/perf_event_intel_lbr.c | 69 ++- arch/x86/kernel/cpu/perf_event_intel_uncore.c | 16 +- arch/x86/kernel/cpu/perf_event_intel_uncore.h | 4 +- arch/x86/kernel/nmi.c | 36 +- arch/x86/kernel/signal.c | 16 +- drivers/iommu/amd_iommu_init.c | 140 ++++- drivers/iommu/amd_iommu_proto.h | 7 + drivers/iommu/amd_iommu_types.h | 15 +- include/linux/perf_event.h | 28 +- include/trace/events/nmi.h | 37 ++ include/uapi/linux/perf_event.h | 5 +- init/main.c | 2 +- kernel/events/core.c | 278 ++++++++- kernel/events/hw_breakpoint.c | 191 +++---- kernel/sysctl.c | 12 +- tools/lib/lk/Makefile | 3 + tools/perf/Documentation/perf-archive.txt | 2 +- tools/perf/Documentation/perf-report.txt | 4 + tools/perf/Documentation/perf-top.txt | 4 + tools/perf/Makefile | 630 ++++----------------- tools/perf/builtin-diff.c | 19 +- tools/perf/builtin-kvm.c | 3 + tools/perf/builtin-record.c | 2 +- tools/perf/builtin-report.c | 102 ++-- tools/perf/builtin-top.c | 74 +-- tools/perf/config/Makefile | 477 ++++++++++++++++ tools/perf/tests/attr/base-record | 4 +- tools/perf/tests/attr/base-stat | 4 +- tools/perf/tests/attr/test-record-data | 5 +- tools/perf/tests/bp_signal.c | 6 + tools/perf/tests/bp_signal_overflow.c | 6 + tools/perf/tests/builtin-test.c | 2 +- tools/perf/tests/make | 138 +++++ tools/perf/ui/browsers/hists.c | 106 +++- tools/perf/ui/gtk/hists.c | 13 +- tools/perf/ui/stdio/hist.c | 7 +- tools/perf/util/evlist.c | 2 + tools/perf/util/evsel.c | 2 +- tools/perf/util/header.c | 2 - tools/perf/util/header.h | 1 - tools/perf/util/hist.c | 96 ++-- tools/perf/util/hist.h | 16 +- tools/perf/util/map.c | 1 + tools/perf/util/session.h | 1 - tools/perf/util/setup.py | 5 +- tools/perf/util/sort.c | 128 +++-- tools/perf/util/sort.h | 36 +- tools/perf/util/stat.c | 2 +- tools/perf/util/thread.c | 4 + tools/perf/util/thread.h | 1 + tools/perf/util/top.c | 23 +- tools/perf/util/top.h | 2 +- tools/perf/util/util.h | 4 +- 71 files changed, 2947 insertions(+), 1053 deletions(-) create mode 100644 Documentation/trace/events-nmi.txt create mode 100644 arch/x86/kernel/cpu/perf_event_amd_iommu.c create mode 100644 arch/x86/kernel/cpu/perf_event_amd_iommu.h create mode 100644 include/trace/events/nmi.h create mode 100644 tools/perf/config/Makefile create mode 100644 tools/perf/tests/make
Documentation/ABI/testing/sysfs-bus-event_source-devices-events +27 -5
@@ -27,14 +27,36 @@ Description: Generic performance monitoring events "basename". -What: /sys/devices/cpu/events/PM_LD_MISS_L1 - /sys/devices/cpu/events/PM_LD_REF_L1 - /sys/devices/cpu/events/PM_CYC +What: /sys/devices/cpu/events/PM_1PLUS_PPC_CMPL /sys/devices/cpu/events/PM_BRU_FIN - /sys/devices/cpu/events/PM_GCT_NOSLOT_CYC /sys/devices/cpu/events/PM_BRU_MPRED - /sys/devices/cpu/events/PM_INST_CMPL /sys/devices/cpu/events/PM_CMPLU_STALL + /sys/devices/cpu/events/PM_CMPLU_STALL_BRU + /sys/devices/cpu/events/PM_CMPLU_STALL_DCACHE_MISS + /sys/devices/cpu/events/PM_CMPLU_STALL_DFU + /sys/devices/cpu/events/PM_CMPLU_STALL_DIV + /sys/devices/cpu/events/PM_CMPLU_STALL_ERAT_MISS + /sys/devices/cpu/events/PM_CMPLU_STALL_FXU + /sys/devices/cpu/events/PM_CMPLU_STALL_IFU + /sys/devices/cpu/events/PM_CMPLU_STALL_LSU + /sys/devices/cpu/events/PM_CMPLU_STALL_REJECT + /sys/devices/cpu/events/PM_CMPLU_STALL_SCALAR + /sys/devices/cpu/events/PM_CMPLU_STALL_SCALAR_LONG + /sys/devices/cpu/events/PM_CMPLU_STALL_STORE + /sys/devices/cpu/events/PM_CMPLU_STALL_THRD + /sys/devices/cpu/events/PM_CMPLU_STALL_VECTOR + /sys/devices/cpu/events/PM_CMPLU_STALL_VECTOR_LONG + /sys/devices/cpu/events/PM_CYC + /sys/devices/cpu/events/PM_GCT_NOSLOT_BR_MPRED + /sys/devices/cpu/events/PM_GCT_NOSLOT_BR_MPRED_IC_MISS + /sys/devices/cpu/events/PM_GCT_NOSLOT_CYC + /sys/devices/cpu/events/PM_GCT_NOSLOT_IC_MISS + /sys/devices/cpu/events/PM_GRP_CMPL + /sys/devices/cpu/events/PM_INST_CMPL + /sys/devices/cpu/events/PM_LD_MISS_L1 + /sys/devices/cpu/events/PM_LD_REF_L1 + /sys/devices/cpu/events/PM_RUN_CYC + /sys/devices/cpu/events/PM_RUN_INST_CMPL Date: 2013/01/08
Documentation/ABI/testing/sysfs-bus-event_source-devices-format +6 -0
@@ -9,6 +9,12 @@ Description: we want to export, so that userspace can deal with sane name/value pairs. + Userspace must be prepared for the possibility that attributes + define overlapping bit ranges. For example: + attr1 = 'config:0-23' + attr2 = 'config:0-7' + attr3 = 'config:12-35' + Example: 'config1:1,6-10,44' Defines contents of attribute that occupies bits 1,6-10,44 of perf_event_attr::config1.
Documentation/sysctl/kernel.txt +40 -10
76 lines not on this page · raw message
Documentation/trace/events-nmi.txt new file +43 -0
43 lines not on this page · raw message
arch/metag/kernel/perf/perf_event.c +1 -1
@@ -882,7 +882,7 @@ static int __init init_hw_perf_events(void) }register_cpu_notifier (&metag_pmu_notifier); - ret =perf_pmu_register (&pmu, (char *)metag_pmu->name,PERF_TYPE_RAW ); + ret =perf_pmu_register (&pmu, metag_pmu->name,PERF_TYPE_RAW ); out:return ret; }
arch/powerpc/perf/power7-pmu.c +73 -0
91 lines not on this page · raw message
arch/x86/ia32/ia32_signal.c +0 -2
@@ -34,8 +34,6 @@#include <asm/sys_ia32.h> #include <asm/smap.h> -#define FIX_EFLAGS __FIX_EFLAGS -int copy_siginfo_to_user32 (compat_siginfo_t __user *to,siginfo_t *from) {int err =0 ;
arch/x86/include/asm/perf_event.h +3 -0
@@ -29,6 +29,9 @@#define ARCH_PERFMON_EVENTSEL_INV (1ULL << 23)#define ARCH_PERFMON_EVENTSEL_CMASK 0xFF000000ULL +#define HSW_IN_TX (1ULL << 32) +#define HSW_IN_TX_CHECKPOINTED (1ULL << 33) +#define AMD64_EVENTSEL_INT_CORE_ENABLE (1ULL << 36)#define AMD64_EVENTSEL_GUESTONLY (1ULL << 40)#define AMD64_EVENTSEL_HOSTONLY (1ULL << 41)
arch/x86/include/asm/sighandling.h +2 -2
@@ -7,10 +7,10 @@#include <asm/processor-flags.h> -#define __FIX_EFLAGS (X86_EFLAGS_AC | X86_EFLAGS_OF | \ +#define FIX_EFLAGS (X86_EFLAGS_AC | X86_EFLAGS_OF | \ X86_EFLAGS_DF | X86_EFLAGS_TF | X86_EFLAGS_SF | \ X86_EFLAGS_ZF | X86_EFLAGS_AF | X86_EFLAGS_PF | \ - X86_EFLAGS_CF) + X86_EFLAGS_CF | X86_EFLAGS_RF)void signal_fault (struct pt_regs *regs,void __user *frame,char *where);
arch/x86/include/uapi/asm/msr-index.h +3 -0
@@ -170,6 +170,9 @@#define MSR_KNC_EVNTSEL0 0x00000028#define MSR_KNC_EVNTSEL1 0x00000029 +/* Alternative perfctr range with full access. */ +#define MSR_IA32_PMC0 0x000004c1 +/* AMD64 MSRs. Not complete. See the architecture manual for a more complete list. */
arch/x86/kernel/cpu/Makefile +4 -0
@@ -31,11 +31,15 @@ obj-$(CONFIG_PERF_EVENTS) += perf_event.o ifdef CONFIG_PERF_EVENTS obj-$(CONFIG_CPU_SUP_AMD) += perf_event_amd.o perf_event_amd_uncore.o +ifdef CONFIG_AMD_IOMMU +obj-$(CONFIG_CPU_SUP_AMD) += perf_event_amd_iommu.o +endif obj-$(CONFIG_CPU_SUP_INTEL) += perf_event_p6.o perf_event_knc.o perf_event_p4.o obj-$(CONFIG_CPU_SUP_INTEL) += perf_event_intel_lbr.o perf_event_intel_ds.o perf_event_intel.o obj-$(CONFIG_CPU_SUP_INTEL) += perf_event_intel_uncore.o endif + obj-$(CONFIG_X86_MCE) += mcheck/ obj-$(CONFIG_MTRR) += mtrr/
arch/x86/kernel/cpu/perf_event.c +53 -16
166 lines not on this page · raw message
arch/x86/kernel/cpu/perf_event.h +21 -3
@@ -63,10 +63,12 @@ struct event_constraint {int flags; };/* -* struct event_constraint flags +* struct hw_perf_event.flags flags */ #define PERF_X86_EVENT_PEBS_LDLAT 0x1/* ld+ldlat data address sampling */ #define PERF_X86_EVENT_PEBS_ST 0x2/* st data address sampling */ +#define PERF_X86_EVENT_PEBS_ST_HSW 0x4/* haswell style st data sampling */ +#define PERF_X86_EVENT_COMMITTED 0x8/* event passed commit_txn */ struct amd_nb {int nb_id;/* NorthBridge id */
@@ -227,11 +229,14 @@ struct cpu_hw_events {* - inv * - edge * - cnt-mask +* - in_tx +* - in_tx_checkpointed * The other filters are supported by fixed counters. * The any-thread option is supported starting with v3. */ +#define FIXED_EVENT_FLAGS (X86_RAW_EVENT_MASK|HSW_IN_TX|HSW_IN_TX_CHECKPOINTED)#define FIXED_EVENT_CONSTRAINT (c, n) \ - EVENT_CONSTRAINT(c, (1ULL << (32+n)), X86_RAW_EVENT_MASK) + EVENT_CONSTRAINT(c, (1ULL << (32+n)), FIXED_EVENT_FLAGS)/* * Constraint on the Event code + UMask
@@ -247,6 +252,11 @@ struct cpu_hw_events {__EVENT_CONSTRAINT (c, n,INTEL_ARCH_EVENT_MASK , \HWEIGHT (n),0 ,PERF_X86_EVENT_PEBS_ST ) +/* DataLA version of store sampling without extra enable bit. */ +#define INTEL_PST_HSW_CONSTRAINT (c, n) \ + __EVENT_CONSTRAINT(c, n, INTEL_ARCH_EVENT_MASK, \ + HWEIGHT(n), 0, PERF_X86_EVENT_PEBS_ST_HSW) +#define EVENT_CONSTRAINT_END \ EVENT_CONSTRAINT(0, 0, 0)
@@ -301,6 +311,11 @@ union perf_capabilities { u64 pebs_arch_reg:1; u64 pebs_format:4; u64 smm_freeze:1; +/* +* PMU supports separate counter range for writing +* values > 32bit. +*/ + u64 full_width_write:1; };u64 capabilities; };
@@ -375,6 +390,7 @@ struct x86_pmu {struct event_constraint *event_constraints;struct x86_pmu_quirk *quirks;int perfctr_second_write; +bool late_ack;/* * sysfs attrs
@@ -528,7 +544,7 @@ static inline void __x86_pmu_enable_event(struct hw_perf_event *hwc,void x86_pmu_enable_all (int added); -int perf_assign_events (struct event_constraint **constraints,int n, +int perf_assign_events (struct perf_event **events,int n,int wmin,int wmax,int *assign);int x86_schedule_events (struct cpu_hw_events *cpuc,int n,int *assign);
@@ -633,6 +649,8 @@ extern struct event_constraint intel_snb_pebs_event_constraints[];extern struct event_constraint intel_ivb_pebs_event_constraints[]; +extern struct event_constraint intel_hsw_pebs_event_constraints[]; +struct event_constraint *intel_pebs_constraints (struct perf_event *event);void intel_pmu_pebs_enable (struct perf_event *event);
arch/x86/kernel/cpu/perf_event_amd.c +17 -17
@@ -648,48 +648,48 @@ static __initconst const struct x86_pmu amd_pmu = { .cpu_dead = amd_pmu_cpu_dead, }; -static int setup_event_constraints (void ) +static int __init amd_core_pmu_init (void ) { -if (boot_cpu_data.x86 ==0x15 ) +if (!cpu_has_perfctr_core) +return 0 ; + +switch (boot_cpu_data.x86) { +case 0x15 : +pr_cont ("Fam15h " ); x86_pmu.get_event_constraints = amd_get_event_constraints_f15h; -return 0 ; -} +break ; -static int setup_perfctr_core (void ) -{ -if (!cpu_has_perfctr_core) { -WARN (x86_pmu.get_event_constraints == amd_get_event_constraints_f15h, -KERN_ERR "Odd, counter constraints enabled but no core perfctrs detected!" ); +default : +pr_err ("core perfctr but no constraints; unknown hardware!\n" );return -ENODEV ; } -WARN (x86_pmu.get_event_constraints == amd_get_event_constraints, -KERN_ERR "hw perf events core counters need constraints handler!" ); -/* * If core performance counter extensions exists, we must use * MSR_F15H_PERF_CTL/MSR_F15H_PERF_CTR msrs. See also -* x86_pmu_addr_offset(). +* amd_pmu_addr_offset(). */ x86_pmu.eventsel =MSR_F15H_PERF_CTL ; x86_pmu.perfctr =MSR_F15H_PERF_CTR ; x86_pmu.num_counters =AMD64_NUM_COUNTERS_CORE ; -printk (KERN_INFO "perf: AMD core performance counters detected\n" ); - +pr_cont ("core perfctr, " );return 0 ; }__init int amd_pmu_init (void ) { +int ret; +/* Performance-monitoring supported from K7 and later: */ if (boot_cpu_data.x86 <6 )return -ENODEV ; x86_pmu = amd_pmu; -setup_event_constraints (); -setup_perfctr_core (); + ret =amd_core_pmu_init (); +if (ret) +return ret;/* Events are common for all AMDs */ memcpy(hw_cache_event_ids, amd_hw_cache_event_ids,
arch/x86/kernel/cpu/perf_event_amd_iommu.c new file +504 -0
504 lines not on this page · raw message
arch/x86/kernel/cpu/perf_event_amd_iommu.h new file +40 -0
@@ -0,0 +1,40 @@ +/* +* Copyright (C) 2013 Advanced Micro Devices, Inc. +* +* Author: Steven Kinney <[email protected]> +* Author: Suravee Suthikulpanit <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _PERF_EVENT_AMD_IOMMU_H_ +#define _PERF_EVENT_AMD_IOMMU_H_ + +/* iommu pc mmio region register indexes */ +#define IOMMU_PC_COUNTER_REG 0x00 +#define IOMMU_PC_COUNTER_SRC_REG 0x08 +#define IOMMU_PC_PASID_MATCH_REG 0x10 +#define IOMMU_PC_DOMID_MATCH_REG 0x18 +#define IOMMU_PC_DEVID_MATCH_REG 0x20 +#define IOMMU_PC_COUNTER_REPORT_REG 0x28 + +/* maximun specified bank/counters */ +#define PC_MAX_SPEC_BNKS 64 +#define PC_MAX_SPEC_CNTRS 16 + +/* iommu pc reg masks*/ +#define IOMMU_BASE_DEVID 0x0000 + +/* amd_iommu_init.c external support functions */ +extern bool amd_iommu_pc_supported (void ); + +extern u8 amd_iommu_pc_get_max_banks (u16 devid); + +extern u8 amd_iommu_pc_get_max_counters (u16 devid); + +extern int amd_iommu_pc_get_set_reg_val (u16 devid,u8 bank,u8 cntr, +u8 fxn,u64 *value,bool is_write); + +#endif /*_PERF_EVENT_AMD_IOMMU_H_*/
arch/x86/kernel/cpu/perf_event_intel.c +122 -14
226 lines not on this page · raw message
arch/x86/kernel/cpu/perf_event_intel_ds.c +153 -25
263 lines not on this page · raw message
arch/x86/kernel/cpu/perf_event_intel_lbr.c +54 -15
162 lines not on this page · raw message
arch/x86/kernel/cpu/perf_event_intel_uncore.c +9 -7
@@ -536,7 +536,7 @@ __snbep_cbox_get_constraint(struct intel_uncore_box *box, struct perf_event *eveif (!uncore_box_is_fake (box)) reg1->alloc |= alloc; -return 0 ; +return NULL ; fail:for (; i >=0 ; i--) {if (alloc & (0x1 << i))
@@ -644,7 +644,7 @@ snbep_pcu_get_constraint(struct intel_uncore_box *box, struct perf_event *event) (!uncore_box_is_fake(box) && reg1->alloc))return NULL ; again: - mask =0xff << (idx *8 ); + mask =0xffULL << (idx *8 );raw_spin_lock_irqsave (&er->lock, flags);if (!__BITS_VALUE (atomic_read (&er->ref), idx,8 ) || !((config1 ^ er->config) & mask)) {
@@ -1923,7 +1923,7 @@ static u64 nhmex_mbox_alter_er(struct perf_event *event, int new_idx, bool modif {struct hw_perf_event *hwc = &event->hw;struct hw_perf_event_extra *reg1 = &hwc->extra_reg; -int idx, orig_idx =__BITS_VALUE (reg1->idx,0 ,8 ); +u64 idx, orig_idx =__BITS_VALUE (reg1->idx,0 ,8 );u64 config = reg1->config;/* get the non-shared control bits and shift them */
@@ -2723,15 +2723,16 @@ static void uncore_put_event_constraint(struct intel_uncore_box *box, struct perstatic int uncore_assign_events (struct intel_uncore_box *box,int assign[],int n) {unsigned long used_mask[BITS_TO_LONGS (UNCORE_PMC_IDX_MAX )]; -struct event_constraint *c, *constraints[UNCORE_PMC_IDX_MAX ]; +struct event_constraint *c;int i, wmin, wmax, ret =0 ;struct hw_perf_event *hwc;bitmap_zero (used_mask,UNCORE_PMC_IDX_MAX );for (i =0 , wmin =UNCORE_PMC_IDX_MAX , wmax =0 ; i < n; i++) { + hwc = &box->event_list[i]->hw; c =uncore_get_event_constraint (box, box->event_list[i]); - constraints[i] = c; + hwc->constraint = c; wmin =min (wmin, c->weight); wmax =max (wmax, c->weight); }
@@ -2739,7 +2740,7 @@ static int uncore_assign_events(struct intel_uncore_box *box, int assign[], int/* fastpath, try to reuse previous register */ for (i =0 ; i < n; i++) { hwc = &box->event_list[i]->hw; - c = constraints[i]; + c = hwc->constraint;/* never assigned */ if (hwc->idx ==-1 )
@@ -2759,7 +2760,8 @@ static int uncore_assign_events(struct intel_uncore_box *box, int assign[], int }/* slow path */ if (i != n) - ret =perf_assign_events (constraints, n, wmin, wmax, assign); + ret =perf_assign_events (box->event_list, n, + wmin, wmax, assign);if (!assign || ret) {for (i =0 ; i < n; i++)
arch/x86/kernel/cpu/perf_event_intel_uncore.h +2 -2
@@ -337,10 +337,10 @@ NHMEX_M_PMON_CTL_SET_FLAG_SEL_MASK)#define NHMEX_M_PMON_ZDP_CTL_FVC_MASK (((1 << 11) - 1) | (1 << 23)) -#define NHMEX_M_PMON_ZDP_CTL_FVC_EVENT_MASK (n) (0x7 << (11 + 3 * (n))) +#define NHMEX_M_PMON_ZDP_CTL_FVC_EVENT_MASK (n) (0x7ULL << (11 + 3 * (n)))#define WSMEX_M_PMON_ZDP_CTL_FVC_MASK (((1 << 12) - 1) | (1 << 24)) -#define WSMEX_M_PMON_ZDP_CTL_FVC_EVENT_MASK (n) (0x7 << (12 + 3 * (n))) +#define WSMEX_M_PMON_ZDP_CTL_FVC_EVENT_MASK (n) (0x7ULL << (12 + 3 * (n)))/* * use the 9~13 bits to select event If the 7th bit is not set,
arch/x86/kernel/nmi.c +34 -2
@@ -14,6 +14,7 @@#include <linux/kprobes.h> #include <linux/kdebug.h> #include <linux/nmi.h> +#include <linux/debugfs.h> #include <linux/delay.h> #include <linux/hardirq.h> #include <linux/slab.h>
@@ -29,6 +30,9 @@#include <asm/nmi.h> #include <asm/x86_init.h> +#define CREATE_TRACE_POINTS +#include <trace/events/nmi.h> +struct nmi_desc {spinlock_t lock;struct list_head head;
@@ -82,6 +86,15 @@ __setup("unknown_nmi_panic", setup_unknown_nmi_panic);#define nmi_to_desc (type) (&nmi_desc[type]) +static u64 nmi_longest_ns =1 *NSEC_PER_MSEC ; +static int __init nmi_warning_debugfs (void ) +{ +debugfs_create_u64 ("nmi_longest_ns" ,0644 , + arch_debugfs_dir, &nmi_longest_ns); +return 0 ; +} +fs_initcall (nmi_warning_debugfs); +static int __kprobes nmi_handle (unsigned int type,struct pt_regs *regs,bool b2b) {struct nmi_desc *desc =nmi_to_desc (type);
@@ -96,8 +109,27 @@ static int __kprobes nmi_handle(unsigned int type, struct pt_regs *regs, bool b2* can be latched at any given time. Walk the whole list * to handle those situations. */ -list_for_each_entry_rcu (a, &desc->head, list) - handled += a->handler (type, regs); +list_for_each_entry_rcu (a, &desc->head, list) { +u64 before, delta, whole_msecs; +int decimal_msecs, thishandled; + + before =local_clock (); + thishandled = a->handler (type, regs); + handled += thishandled; + delta =local_clock () - before; +trace_nmi_handler (a->handler, (int )delta, thishandled); + +if (delta < nmi_longest_ns) +continue ; + + nmi_longest_ns = delta; + whole_msecs =do_div (delta, (1000 *1000 )); + decimal_msecs =do_div (delta,1000 ) %1000 ; +printk_ratelimited (KERN_INFO +"INFO: NMI handler (%ps) took too long to run: " +"%lld.%03d msecs\n" , a->handler, whole_msecs, + decimal_msecs); + }rcu_read_unlock ();
arch/x86/kernel/signal.c +6 -10
@@ -43,12 +43,6 @@#include <asm/sigframe.h> -#ifdef CONFIG_X86_32 -# define FIX_EFLAGS (__FIX_EFLAGS | X86_EFLAGS_RF) -#else -# define FIX_EFLAGS __FIX_EFLAGS -#endif -#define COPY (x) do { \ get_user_ex(regs->x, &sc->x); \ } while (0)
@@ -668,15 +662,17 @@ handle_signal(struct ksignal *ksig, struct pt_regs *regs)if (!failed) {/* * Clear the direction flag as per the ABI for function entry. -*/ - regs->flags &= ~X86_EFLAGS_DF ; -/* +* +* Clear RF when entering the signal handler, because +* it might disable possible debug exception from the +* signal handler. +* * Clear TF when entering the signal handler, but * notify any tracer that was single-stepping it. * The tracer may want to single-step inside the * handler too. */ - regs->flags &= ~X86_EFLAGS_TF ; + regs->flags &= ~(X86_EFLAGS_DF |X86_EFLAGS_RF |X86_EFLAGS_TF ); }signal_setup_done (failed, ksig,test_thread_flag (TIF_SINGLESTEP )); }
drivers/iommu/amd_iommu_init.c +131 -9
196 lines not on this page · raw message
drivers/iommu/amd_iommu_proto.h +7 -0
@@ -56,6 +56,13 @@ extern int amd_iommu_domain_set_gcr3(struct iommu_domain *dom, int pasid,extern int amd_iommu_domain_clear_gcr3 (struct iommu_domain *dom,int pasid);extern struct iommu_domain *amd_iommu_get_v2_domain (struct pci_dev *pdev); +/* IOMMU Performance Counter functions */ +extern bool amd_iommu_pc_supported (void ); +extern u8 amd_iommu_pc_get_max_banks (u16 devid); +extern u8 amd_iommu_pc_get_max_counters (u16 devid); +extern int amd_iommu_pc_get_set_reg_val (u16 devid,u8 bank,u8 cntr,u8 fxn, +u64 *value,bool is_write); +#define PPR_SUCCESS 0x0#define PPR_INVALID 0x1#define PPR_FAILURE 0xf
drivers/iommu/amd_iommu_types.h +12 -3
@@ -38,9 +38,6 @@#define ALIAS_TABLE_ENTRY_SIZE 2#define RLOOKUP_TABLE_ENTRY_SIZE (sizeof(void *)) -/* Length of the MMIO region for the AMD IOMMU */ -#define MMIO_REGION_LENGTH 0x4000 -/* Capability offsets used by the driver */ #define MMIO_CAP_HDR_OFFSET 0x00#define MMIO_RANGE_OFFSET 0x0c
@@ -78,6 +75,10 @@#define MMIO_STATUS_OFFSET 0x2020#define MMIO_PPR_HEAD_OFFSET 0x2030#define MMIO_PPR_TAIL_OFFSET 0x2038 +#define MMIO_CNTR_CONF_OFFSET 0x4000 +#define MMIO_CNTR_REG_OFFSET 0x40000 +#define MMIO_REG_END_OFFSET 0x80000 +/* Extended Feature Bits */
@@ -507,6 +508,10 @@ struct amd_iommu {/* physical address of MMIO space */ u64 mmio_phys; + +/* physical end address of MMIO space */ +u64 mmio_phys_end; +/* virtual address of MMIO space */ u8 __iomem *mmio_base;
@@ -584,6 +589,10 @@ struct amd_iommu {/* The l2 indirect registers */ u32 stored_l2[0x83 ]; + +/* The maximum PC banks and counters/bank (PCSup=1) */ +u8 max_banks; +u8 max_counters; };struct devid_map {
include/linux/perf_event.h +24 -4
@@ -73,13 +73,18 @@ struct perf_raw_record {* * support for mispred, predicted is optional. In case it * is not supported mispred = predicted = 0. +* +* in_tx: running in a hardware transaction +* abort: aborting a hardware transaction */ struct perf_branch_entry {__u64 from;__u64 to;__u64 mispred:1 ,/* target mispredicted */ predicted:1 ,/* target predicted */ - reserved:62 ; + in_tx:1 ,/* in transaction */ + abort:1 ,/* transaction abort */ + reserved:60 ; };/*
@@ -113,6 +118,8 @@ struct hw_perf_event_extra {int idx;/* index in shared_regs->regs[] */ }; +struct event_constraint ; +/** * struct hw_perf_event - performance event hardware details: */
@@ -131,6 +138,8 @@ struct hw_perf_event {struct hw_perf_event_extra extra_reg;struct hw_perf_event_extra branch_reg; + +struct event_constraint *constraint; };struct {/* software */ struct hrtimer hrtimer;
@@ -188,12 +197,13 @@ struct pmu {struct device *dev;const struct attribute_group **attr_groups; -char *name; +const char *name;int type;int *__percpu pmu_disable_count;struct perf_cpu_context *__percpu pmu_cpu_context;int task_ctx_nr; +int hrtimer_interval_ms;/* * Fully disable/enable this PMU, can be used to protect from the PMI
@@ -500,8 +510,9 @@ struct perf_cpu_context {struct perf_event_context *task_ctx;int active_oncpu;int exclusive; +struct hrtimer hrtimer; +ktime_t hrtimer_interval;struct list_head rotation_list; -int jiffies_interval;struct pmu *unique_pmu;struct perf_cgroup *cgrp; };
@@ -517,7 +528,7 @@ struct perf_output_handle {#ifdef CONFIG_PERF_EVENTS -extern int perf_pmu_register (struct pmu *pmu,char *name,int type); +extern int perf_pmu_register (struct pmu *pmu,const char *name,int type);extern void perf_pmu_unregister (struct pmu *pmu);extern int perf_num_counters (void );
@@ -695,10 +706,17 @@ static inline void perf_callchain_store(struct perf_callchain_entry *entry, u64extern int sysctl_perf_event_paranoid;extern int sysctl_perf_event_mlock;extern int sysctl_perf_event_sample_rate; +extern int sysctl_perf_cpu_time_max_percent; + +extern void perf_sample_event_took (u64 sample_len_ns);extern int perf_proc_update_handler (struct ctl_table *table,int write,void __user *buffer,size_t *lenp,loff_t *ppos); +extern int perf_cpu_time_max_percent_handler (struct ctl_table *table,int write, +void __user *buffer,size_t *lenp, +loff_t *ppos); +static inline bool perf_paranoid_tracepoint_raw (void ) {
@@ -742,6 +760,7 @@ extern unsigned int perf_output_skip(struct perf_output_handle *handle, unsigned int len);extern int perf_swevent_get_recursion_context (void );extern void perf_swevent_put_recursion_context (int rctx); +extern u64 perf_swevent_set_period (struct perf_event *event);extern void perf_event_enable (struct perf_event *event);extern void perf_event_disable (struct perf_event *event);extern int __perf_event_disable (void *info);
@@ -781,6 +800,7 @@ static inline void perf_event_fork(struct task_struct *tsk) { }static inline void perf_event_init (void ) { }static inline int perf_swevent_get_recursion_context (void ) {return -1 ; }static inline void perf_swevent_put_recursion_context (int rctx) { } +static inline u64 perf_swevent_set_period (struct perf_event *event) {return 0 ; }static inline void perf_event_enable (struct perf_event *event) { }static inline void perf_event_disable (struct perf_event *event) { }static inline int __perf_event_disable (void *info) {return -1 ; }
include/trace/events/nmi.h new file +37 -0
@@ -0,0 +1,37 @@ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM nmi + +#if !defined(_TRACE_NMI_H) || defined(TRACE_HEADER_MULTI_READ ) +#define _TRACE_NMI_H + +#include <linux/ktime.h> +#include <linux/tracepoint.h> + +TRACE_EVENT (nmi_handler, + + TP_PROTO(void *handler, s64 delta_ns, int handled), + +TP_ARGS (handler, delta_ns, handled), + +TP_STRUCT__entry ( + __field( void *, handler ) + __field( s64, delta_ns) +__field ( int, handled ) + ), + +TP_fast_assign ( + __entry->handler = handler; + __entry->delta_ns = delta_ns; + __entry->handled = handled; + ), + +TP_printk ("%ps() delta_ns: %lld handled: %d" , + __entry->handler, + __entry->delta_ns, + __entry->handled) +); + +#endif /* _TRACE_NMI_H */ + +/* This part ust be outside protection */ +#include <trace/define_trace.h>
include/uapi/linux/perf_event.h +4 -1
@@ -157,8 +157,11 @@ enum perf_branch_sample_type {PERF_SAMPLE_BRANCH_ANY_CALL =1U <<4 ,/* any call branch */ PERF_SAMPLE_BRANCH_ANY_RETURN =1U <<5 ,/* any return branch */ PERF_SAMPLE_BRANCH_IND_CALL =1U <<6 ,/* indirect calls */ +PERF_SAMPLE_BRANCH_ABORT_TX =1U <<7 ,/* transaction aborts */ +PERF_SAMPLE_BRANCH_IN_TX =1U <<8 ,/* in transaction */ +PERF_SAMPLE_BRANCH_NO_TX =1U <<9 ,/* not in transaction */ - PERF_SAMPLE_BRANCH_MAX = 1U << 7, /* non-ABI */ + PERF_SAMPLE_BRANCH_MAX = 1U << 10, /* non-ABI */ };#define PERF_SAMPLE_BRANCH_PLM_ALL \
init/main.c +1 -1
@@ -542,7 +542,6 @@ asmlinkage void __init start_kernel(void)if (WARN (!irqs_disabled (),"Interrupts were enabled *very* early, fixing it\n" ))local_irq_disable ();idr_init_cache (); -perf_event_init ();rcu_init ();tick_nohz_init ();radix_tree_init ();
@@ -555,6 +554,7 @@ asmlinkage void __init start_kernel(void)softirq_init ();timekeeping_init ();time_init (); +perf_event_init ();profile_init ();call_function_init ();WARN (!irqs_disabled (),"Interrupts were enabled early\n" );
kernel/events/core.c +257 -21
380 lines not on this page · raw message
kernel/events/hw_breakpoint.c +83 -108
224 lines not on this page · raw message
tools/perf/Documentation/perf-archive.txt +1 -1
Lines of this file are not shown. View the raw message.
tools/perf/Documentation/perf-report.txt +4 -0
Lines of this file are not shown. View the raw message.
tools/perf/Makefile +110 -520
630 lines not on this page · raw message
tools/perf/builtin-report.c +54 -48
102 lines not on this page · raw message
tools/perf/builtin-top.c +39 -35
74 lines not on this page · raw message
tools/perf/config/Makefile new file +477 -0
477 lines not on this page · raw message
tools/perf/tests/make new file +138 -0
138 lines not on this page · raw message
tools/perf/ui/browsers/hists.c +85 -21
106 lines not on this page · raw message
tools/perf/util/hist.c +42 -54
96 lines not on this page · raw message
tools/perf/util/sort.c +91 -37
128 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
Quoted 6 lines · Ingo Molnar
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.gitperf-core-for-linusKernel improvements:
* AMD IOMMU uncore PMU support by Suravee Suthikulpanit001a
This one prints a really annoying error message if you're not on an AMD platform:
+ if (!amd_iommu_pc_supported()) {
+ pr_err("perf: amd_iommu PMU not installed. No support!\n");
+ return -ENODEV;
+ }
and you know what? That's not acceptable. It damn well is *not* an error to not have an AMD IOMMU.
It should - at most - be a pr_info(). Maybe nothing at all. "pr_err()" is just totally out of line.
Linus
Peter Zijlstra
maintainerQuoted 16 lines · Linus Torvalds
Quoted 6 lines · Ingo Molnar
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.gitperf-core-for-linusKernel improvements:
* AMD IOMMU uncore PMU support by Suravee Suthikulpanit001a
This one prints a really annoying error message if you're not on an AMD platform:
(quoted diff) +4
-0+ if (!amd_iommu_pc_supported()) { + pr_err("perf: amd_iommu PMU not installed. No support!\n"); + return -ENODEV; + }
Quoted 5 lines
and you know what? That's not acceptable. It damn well is *not* an error to not have an AMD IOMMU.
It should - at most - be a
pr_info(). Maybe nothing at all. "pr_err()" is just totally out of line.
Quite; it prints enough stuff when it does find one so I'm all for scrapping that one print when it doesn't find it.
Sorry for not seeing that; when I initially read that code I thought it was for the case where the hardware was expected to have the device but we couldn't find it for some weird reason.
---
Subject: perf, amd: Do not print an error when the device is not present
As Linus said its not an error to not have an AMD IOMMU; esp. when you're not even running on an AMD platform.
--- arch/x86/kernel/cpu/perf_event_amd_iommu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
arch/x86/kernel/cpu/perf_event_amd_iommu.c +1 -3
@@ -491,10 +491,8 @@ static struct perf_amd_iommu __perf_iommu = {static __init int amd_iommu_pc_init (void ) {/* Make sure the IOMMU PC resource is available */ -if (!amd_iommu_pc_supported ()) { -pr_err ("perf: amd_iommu PMU not installed. No support!\n" ); +if (!amd_iommu_pc_supported ())return -ENODEV ; - }_init_perf_amd_iommu (&__perf_iommu,"amd_iommu" );
Quoted 45 lines · Peter Zijlstra
Quoted 14 lines · Linus Torvalds
Quoted 5 lines · Ingo Molnar
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.gitperf-core-for-linusKernel improvements:
* AMD IOMMU uncore PMU support by Suravee Suthikulpanit001a
This one prints a really annoying error message if you're not on an AMD platform:
(quoted diff) +4
-0+ if (!amd_iommu_pc_supported()) { + pr_err("perf: amd_iommu PMU not installed. No support!\n"); + return -ENODEV; + }Quoted 5 lines
and you know what? That's not acceptable. It damn well is *not* an error to not have an AMD IOMMU.
It should - at most - be a
pr_info(). Maybe nothing at all. "pr_err()" is just totally out of line.Quite; it prints enough stuff when it does find one so I'm all for scrapping that one print when it doesn't find it.
Sorry for not seeing that; when I initially read that code I thought it was for the case where the hardware was expected to have the device but we couldn't find it for some weird reason.
---
Subject: perf, amd: Do not print an error when the device is not presentAs Linus said its not an error to not have an AMD IOMMU; esp. when you're not even running on an AMD platform.
Requested-by Linus Torvalds <[email protected]>Signed-off-by Peter Zijlstra <[email protected]>--- arch/x86/kernel/cpu/perf_event_amd_iommu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)arch/x86/kernel/cpu/perf_event_amd_iommu.c +0
-0@@ -491,10 +491,8 @@ static struct perf_amd_iommu __perf_iommu = {static __init int amd_iommu_pc_init (void )
arch/x86/kernel/cpu/perf_event_amd_iommu.c static struct perf_amd_iommu __perf_iommu = { · line 498
Quoted 10 lines
arch/x86/kernel/cpu/perf_event_amd_iommu.c +1
-3{/* Make sure the IOMMU PC resource is available */ -if (!amd_iommu_pc_supported ()) { -pr_err ("perf: amd_iommu PMU not installed. No support!\n" ); +if (!amd_iommu_pc_supported ())return -ENODEV ; - }_init_perf_amd_iommu (&__perf_iommu,"amd_iommu" );
Linus, sorry for inconvenience. This is a mistake in my part.
Peter, thank you for sending out the patch quickly. I have checked the patch and this is okay.
Suravee
Ingo Molnar
AppliedQuoted 30 lines · Peter Zijlstra
Quoted 16 lines · Linus Torvalds
Quoted 6 lines · Ingo Molnar
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.gitperf-core-for-linusKernel improvements:
* AMD IOMMU uncore PMU support by Suravee Suthikulpanit001a
This one prints a really annoying error message if you're not on an AMD platform:
(quoted diff) +4
-0+ if (!amd_iommu_pc_supported()) { + pr_err("perf: amd_iommu PMU not installed. No support!\n"); + return -ENODEV; + }Quoted 5 lines
and you know what? That's not acceptable. It damn well is *not* an error to not have an AMD IOMMU.
It should - at most - be a
pr_info(). Maybe nothing at all. "pr_err()" is just totally out of line.Quite; it prints enough stuff when it does find one so I'm all for scrapping that one print when it doesn't find it.
Sorry for not seeing that; when I initially read that code I thought it was for the case where the hardware was expected to have the device but we couldn't find it for some weird reason.
Quoted 7 lines
---
Subject: perf, amd: Do not print an error when the device is not presentAs Linus said its not an error to not have an AMD IOMMU; esp. when you're not even running on an AMD platform.
Requested-by Linus Torvalds <[email protected]>
Applied to perf/urgent, thanks!
( The pedantic in me changed that tag to Reported-by as we treat console
spam as bugs. )
Thanks,
Ingo
tip-bot for Peter Zijlstra
merge bot[tip:perf/urgent] perf/x86/amd: Do not print an error when the device is not present
In reply to Peter Zijlstraperf/x86/amd: Do not print an error when the device is not present
Commit-ID: 100ac5331519866afa9b000b10642b00cb6d03dd Gitweb: http://git.kernel.org/tip/100ac5331519866afa9b000b10642b00cb6d03dd Author: Peter Zijlstra <[email protected]> AuthorDate: Wed, 3 Jul 2013 09:55:42 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Fri, 5 Jul 2013 08:27:15 +0200
perf/x86/amd: Do not print an error when the device is not present
As Linus said its not an error to not have an AMD IOMMU; esp. when you're not even running on an AMD platform.
--- arch/x86/kernel/cpu/perf_event_amd_iommu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
arch/x86/kernel/cpu/perf_event_amd_iommu.c +1 -3
@@ -491,10 +491,8 @@ static struct perf_amd_iommu __perf_iommu = {static __init int amd_iommu_pc_init (void ) {/* Make sure the IOMMU PC resource is available */ -if (!amd_iommu_pc_supported ()) { -pr_err ("perf: amd_iommu PMU not installed. No support!\n" ); +if (!amd_iommu_pc_supported ())return -ENODEV ; - }_init_perf_amd_iommu (&__perf_iommu,"amd_iommu" );