diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-07-03 15:40:46 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-07-03 15:40:46 -0400 |
| commit | 7447d56217e215e50317f308aee1ed293ac4f749 (patch) | |
| tree | 903832ecb206ae83160992c6aec40c624821941f | |
| parent | 892ad5acca0b2ddb514fae63fa4686bf726d2471 (diff) | |
| parent | 23acd3e1a0a377cf3730ccb753aa1fdc50378396 (diff) | |
Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf updates from Ingo Molnar:
"Most of the changes are for tooling, the main changes in this cycle were:
- Improve Intel-PT hardware tracing support, both on the kernel and
on the tooling side: PTWRITE instruction support, power events for
C-state tracing, etc. (Adrian Hunter)
- Add support to measure SMI cost to the x86 architecture, with
tooling support in 'perf stat' (Kan Liang)
- Support function filtering in 'perf ftrace', plus related
improvements (Namhyung Kim)
- Allow adding and removing fields to the default 'perf script'
columns, using + or - as field prefixes to do so (Andi Kleen)
- Allow resolving the DSO name with 'perf script -F brstack{sym,off},dso'
(Mark Santaniello)
- Add perf tooling unwind support for PowerPC (Paolo Bonzini)
- ... and various other improvements as well"
* 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (84 commits)
perf auxtrace: Add CPU filter support
perf intel-pt: Do not use TSC packets for calculating CPU cycles to TSC
perf intel-pt: Update documentation to include new ptwrite and power events
perf intel-pt: Add example script for power events and PTWRITE
perf intel-pt: Synthesize new power and "ptwrite" events
perf intel-pt: Move code in intel_pt_synth_events() to simplify attr setting
perf intel-pt: Factor out intel_pt_set_event_name()
perf intel-pt: Tidy messages into called function intel_pt_synth_event()
perf intel-pt: Tidy Intel PT evsel lookup into separate function
perf intel-pt: Join needlessly wrapped lines
perf intel-pt: Remove unused instructions_sample_period
perf intel-pt: Factor out common code synthesizing event samples
perf script: Add synthesized Intel PT power and ptwrite events
perf/x86/intel: Constify the 'lbr_desc[]' array and make a function static
perf script: Add 'synth' field for synthesized event payloads
perf auxtrace: Add itrace option to output power events
perf auxtrace: Add itrace option to output ptwrite events
tools include: Add byte-swapping macros to kernel.h
perf script: Add 'synth' event type for synthesized events
x86/insn: perf tools: Add new ptwrite instruction
...
92 files changed, 2524 insertions, 625 deletions
diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c index 580b60f5ac83..e6f5e4b163ac 100644 --- a/arch/x86/events/core.c +++ b/arch/x86/events/core.c | |||
| @@ -1750,6 +1750,8 @@ ssize_t x86_event_sysfs_show(char *page, u64 config, u64 event) | |||
| 1750 | return ret; | 1750 | return ret; |
| 1751 | } | 1751 | } |
| 1752 | 1752 | ||
| 1753 | static struct attribute_group x86_pmu_attr_group; | ||
| 1754 | |||
| 1753 | static int __init init_hw_perf_events(void) | 1755 | static int __init init_hw_perf_events(void) |
| 1754 | { | 1756 | { |
| 1755 | struct x86_pmu_quirk *quirk; | 1757 | struct x86_pmu_quirk *quirk; |
| @@ -1813,6 +1815,14 @@ static int __init init_hw_perf_events(void) | |||
| 1813 | x86_pmu_events_group.attrs = tmp; | 1815 | x86_pmu_events_group.attrs = tmp; |
| 1814 | } | 1816 | } |
| 1815 | 1817 | ||
| 1818 | if (x86_pmu.attrs) { | ||
| 1819 | struct attribute **tmp; | ||
| 1820 | |||
| 1821 | tmp = merge_attr(x86_pmu_attr_group.attrs, x86_pmu.attrs); | ||
| 1822 | if (!WARN_ON(!tmp)) | ||
| 1823 | x86_pmu_attr_group.attrs = tmp; | ||
| 1824 | } | ||
| 1825 | |||
| 1816 | pr_info("... version: %d\n", x86_pmu.version); | 1826 | pr_info("... version: %d\n", x86_pmu.version); |
| 1817 | pr_info("... bit width: %d\n", x86_pmu.cntval_bits); | 1827 | pr_info("... bit width: %d\n", x86_pmu.cntval_bits); |
| 1818 | pr_info("... generic registers: %d\n", x86_pmu.num_counters); | 1828 | pr_info("... generic registers: %d\n", x86_pmu.num_counters); |
diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c index 110ce8238466..31acf2a98394 100644 --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c | |||
| @@ -3160,6 +3160,19 @@ err: | |||
| 3160 | return -ENOMEM; | 3160 | return -ENOMEM; |
| 3161 | } | 3161 | } |
| 3162 | 3162 | ||
| 3163 | static void flip_smm_bit(void *data) | ||
| 3164 | { | ||
| 3165 | unsigned long set = *(unsigned long *)data; | ||
| 3166 | |||
| 3167 | if (set > 0) { | ||
| 3168 | msr_set_bit(MSR_IA32_DEBUGCTLMSR, | ||
| 3169 | DEBUGCTLMSR_FREEZE_IN_SMM_BIT); | ||
| 3170 | } else { | ||
| 3171 | msr_clear_bit(MSR_IA32_DEBUGCTLMSR, | ||
| 3172 | DEBUGCTLMSR_FREEZE_IN_SMM_BIT); | ||
| 3173 | } | ||
| 3174 | } | ||
| 3175 | |||
| 3163 | static void intel_pmu_cpu_starting(int cpu) | 3176 | static void intel_pmu_cpu_starting(int cpu) |
| 3164 | { | 3177 | { |
| 3165 | struc | ||
