diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-02 19:15:23 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-02 19:15:23 -0400 |
| commit | f0bb4c0ab064a8aeeffbda1cee380151a594eaab (patch) | |
| tree | 14d55a89c5db455aa10ff9a96ca14c474a9c4d55 /include | |
| parent | a4883ef6af5e513a1e8c2ab9aab721604aa3a4f5 (diff) | |
| parent | 983433b5812c5cf33a9008fa38c6f9b407fedb76 (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:
"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"
* 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (102 commits)
perf/x86: Disable PEBS-LL in intel_pmu_pebs_disable()
perf/x86: Fix shared register mutual exclusion enforcement
perf/x86/intel: Support full width counting
x86: Add NMI duration tracepoints
perf: Drop sample rate when sampling is too slow
x86: Warn when NMI handlers take large amounts of time
hw_breakpoint: Introduce "struct bp_cpuinfo"
hw_breakpoint: Simplify *register_wide_hw_breakpoint()
hw_breakpoint: Introduce cpumask_of_bp()
hw_breakpoint: Simplify the "weight" usage in toggle_bp_slot() paths
hw_breakpoint: Simplify list/idx mess in toggle_bp_slot() paths
perf/x86/intel: Add mem-loads/stores support for Haswell
perf/x86/intel: Support Haswell/v4 LBR format
perf/x86/intel: Move NMI clearing to end of PMI handler
perf/x86/intel: Add Haswell PEBS support
perf/x86/intel: Add simple Haswell PMU support
perf/x86/intel: Add Haswell PEBS record support
perf/x86/intel: Fix sparse warning
perf/x86/amd: AMD IOMMU Performance Counter PERF uncore PMU implementation
perf/x86/amd: Add IOMMU Performance Counter resource management
...
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/perf_event.h | 28 | ||||
| -rw-r--r-- | include/trace/events/nmi.h | 37 | ||||
| -rw-r--r-- | include/uapi/linux/perf_event.h | 5 |
3 files changed, 65 insertions, 5 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index c5b6dbf9c2fc..50b3efd14d29 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
| @@ -73,13 +73,18 @@ struct perf_raw_record { | |||
| 73 | * | 73 | * |
| 74 | * support for mispred, predicted is optional. In case it | 74 | * support for mispred, predicted is optional. In case it |
| 75 | * is not supported mispred = predicted = 0. | 75 | * is not supported mispred = predicted = 0. |
| 76 | * | ||
| 77 | * in_tx: running in a hardware transaction | ||
| 78 | * abort: aborting a hardware transaction | ||
| 76 | */ | 79 | */ |
| 77 | struct perf_branch_entry { | 80 | struct perf_branch_entry { |
| 78 | __u64 from; | 81 | __u64 from; |
| 79 | __u64 to; | 82 | __u64 to; |
| 80 | __u64 mispred:1, /* target mispredicted */ | 83 | __u64 mispred:1, /* target mispredicted */ |
| 81 | predicted:1,/* target predicted */ | 84 | predicted:1,/* target predicted */ |
| 82 | reserved:62; | 85 | in_tx:1, /* in transaction */ |
| 86 | abort:1, /* transaction abort */ | ||
| 87 | reserved:60; | ||
| 83 | }; | 88 | }; |
| 84 | 89 | ||
| 85 | /* | 90 | /* |
| @@ -113,6 +118,8 @@ struct hw_perf_event_extra { | |||
| 113 | int idx; /* index in shared_regs->regs[] */ | 118 | int idx; /* index in shared_regs->regs[] */ |
| 114 | }; | 119 | }; |
| 115 | 120 | ||
| 121 | struct event_constraint; | ||
| 122 | |||
| 116 | /** | 123 | /** |
| 117 | * struct hw_perf_event - performance event hardware details: | 124 | * struct hw_perf_event - performance event hardware details: |
| 118 | */ | 125 | */ |
| @@ -131,6 +138,8 @@ struct hw_perf_event { | |||
| 131 | 138 | ||
| 132 | struct hw_perf_event_extra extra_reg; | 139 | struct hw_perf_event_extra extra_reg; |
| 133 | struct hw_perf_event_extra branch_reg; | 140 | struct hw_perf_event_extra branch_reg; |
| 141 | |||
| 142 | struct event_constraint *constraint; | ||
| 134 | }; | 143 | }; |
| 135 | struct { /* software */ | 144 | struct { /* software */ |
| 136 | struct hrtimer hrtimer; | 145 | struct hrtimer hrtimer; |
| @@ -188,12 +197,13 @@ struct pmu { | |||
| 188 | 197 | ||
| 189 | struct device *dev; | 198 | struct device *dev; |
| 190 | const struct attribute_group **attr_groups; | 199 | const struct attribute_group **attr_groups; |
| 191 | char *name; | 200 | const char *name; |
| 192 | int type; | 201 | int type; |
| 193 | 202 | ||
| 194 | int * __percpu pmu_disable_count; | 203 | int * __percpu pmu_disable_count; |
| 195 | struct perf_cpu_context * __percpu pmu_cpu_context; | 204 | struct perf_cpu_context * __percpu pmu_cpu_context; |
| 196 | int task_ctx_nr; | 205 | int task_ctx_nr; |
| 206 | int hrtimer_interval_ms; | ||
| 197 | 207 | ||
| 198 | /* | 208 | /* |
| 199 | * Fully disable/enable this PMU, can be used to protect from the PMI | 209 | * Fully disable/enable this PMU, can be used to protect from the PMI |
| @@ -500,8 +510,9 @@ struct perf_cpu_context { | |||
| 500 | struct perf_event_context *task_ctx; | 510 | struct perf_event_context *task_ctx; |
| 501 | int active_oncpu; | 511 | int active_oncpu; |
| 502 | int exclusive; | 512 | int exclusive; |
| 513 | struct hrtimer hrtimer; | ||
| 514 | ktime_t hrtimer_interval; | ||
| 503 | struct list_head rotation_list; | 515 | struct list_head rotation_list; |
| 504 | int jiffies_interval; | ||
| 505 | struct pmu *unique_pmu; | 516 | struct pmu *unique_pmu; |
| 506 | struct perf_cgroup *cgrp; | 517 | struct perf_cgroup *cgrp; |
| 507 | }; | 518 | }; |
| @@ -517,7 +528,7 @@ struct perf_output_handle { | |||
| 517 | 528 | ||
| 518 | #ifdef CONFIG_PERF_EVENTS | 529 | #ifdef CONFIG_PERF_EVENTS |
| 519 | 530 | ||
| 520 | extern int perf_pmu_register(struct pmu *pmu, char *name, int type); | 531 | extern int perf_pmu_register(struct pmu *pmu, const char *name, int type); |
| 521 | extern void perf_pmu_unregister(struct pmu *pmu); | 532 | extern void perf_pmu_unregister(struct pmu *pmu); |
| 522 | 533 | ||
| 523 | extern int perf_num_counters(void); | 534 | extern int perf_num_counters(void); |
| @@ -695,10 +706,17 @@ static inline void perf_callchain_store(struct perf_callchain_entry *entry, u64 | |||
| 695 | extern int sysctl_perf_event_paranoid; | 706 | extern int sysctl_perf_event_paranoid; |
| 696 | extern int sysctl_perf_event_mlock; | 707 | extern int sysctl_perf_event_mlock; |
| 697 | extern int sysctl_perf_event_sample_rate; | 708 | extern int sysctl_perf_event_sample_rate; |
| 709 | extern int sysctl_perf_cpu_time_max_percent; | ||
| 710 | |||
| 711 | extern void perf_sample_event_took(u64 sample_len_ns); | ||
| 698 | 712 | ||
| 699 | extern int perf_proc_update_handler(struct ctl_table *table, int write, | 713 | extern int perf_proc_update_handler(struct ctl_table *table, int write, |
| 700 | void __user *buffer, size_t *lenp, | 714 | void __user *buffer, size_t *lenp, |
| 701 | loff_t *ppos); | 715 | loff_t *ppos); |
| 716 | extern int perf_cpu_time_max_percent_handler(struct ctl_table *table, int write, | ||
| 717 | void __user *buffer, size_t *lenp, | ||
| 718 | loff_t *ppos); | ||
| 719 | |||
| 702 | 720 | ||
| 703 | static inline bool perf_paranoid_tracepoint_raw(void) | 721 | static inline bool perf_paranoid_tracepoint_raw(void) |
| 704 | { | 722 | { |
| @@ -742,6 +760,7 @@ extern unsigned int perf_output_skip(struct perf_output_handle *handle, | |||
| 742 | unsigned int len); | 760 | unsigned int len); |
| 743 | extern int perf_swevent_get_recursion_context(void); | 761 | extern int perf_swevent_get_recursion_context(void); |
| 744 | extern void perf_swevent_put_recursion_context(int rctx); | 762 | extern void perf_swevent_put_recursion_context(int rctx); |
| 763 | extern u64 perf_swevent_set_period(struct perf_event *event); | ||
| 745 | extern void perf_event_enable(struct perf_event *event); | 764 | extern void perf_event_enable(struct perf_event *event); |
| 746 | extern void perf_event_disable(struct perf_event *event); | 765 | extern void perf_event_disable(struct perf_event *event); |
| 747 | extern int __perf_event_disable(void *info); | 766 | extern int __perf_event_disable(void *info); |
| @@ -781,6 +800,7 @@ static inline void perf_event_fork(struct task_struct *tsk) { } | |||
| 781 | static inline void perf_event_init(void) { } | 800 | static inline void perf_event_init(void) { } |
| 782 | static inline int perf_swevent_get_recursion_context(void) { return -1; } | 801 | static inline int perf_swevent_get_recursion_context(void) { return -1; } |
| 783 | static inline void perf_swevent_put_recursion_context(int rctx) { } | 802 | static inline void perf_swevent_put_recursion_context(int rctx) { } |
| 803 | static inline u64 perf_swevent_set_period(struct perf_event *event) { return 0; } | ||
| 784 | static inline void perf_event_enable(struct perf_event *event) { } | 804 | static inline void perf_event_enable(struct perf_event *event) { } |
| 785 | static inline void perf_event_disable(struct perf_event *event) { } | 805 | static inline void perf_event_disable(struct perf_event *event) { } |
| 786 | static inline int __perf_event_disable(void *info) { return -1; } | 806 | static inline int __perf_event_disable(void *info) { return -1; } |
diff --git a/include/trace/events/nmi.h b/include/trace/events/nmi.h new file mode 100644 index 000000000000..da3ee96b8d03 --- /dev/null +++ b/include/trace/events/nmi.h | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | #undef TRACE_SYSTEM | ||
| 2 | #define TRACE_SYSTEM nmi | ||
| 3 | |||
| 4 | #if !defined(_TRACE_NMI_H) || defined(TRACE_HEADER_MULTI_READ) | ||
| 5 | #define _TRACE_NMI_H | ||
| 6 | |||
| 7 | #include <linux/ktime.h> | ||
| 8 | #include <linux/tracepoint.h> | ||
| 9 | |||
| 10 | TRACE_EVENT(nmi_handler, | ||
| 11 | |||
| 12 | TP_PROTO(void *handler, s64 delta_ns, int handled), | ||
| 13 | |||
| 14 | TP_ARGS(handler, delta_ns, handled), | ||
| 15 | |||
| 16 | TP_STRUCT__entry( | ||
| 17 | __field( void *, handler ) | ||
| 18 | __field( s64, delta_ns) | ||
| 19 | __field( int, handled ) | ||
| 20 | ), | ||
| 21 | |||
| 22 | TP_fast_assign( | ||
| 23 | __entry->handler = handler; | ||
| 24 | __entry->delta_ns = delta_ns; | ||
| 25 | __entry->handled = handled; | ||
| 26 | ), | ||
| 27 | |||
| 28 | TP_printk("%ps() delta_ns: %lld handled: %d", | ||
| 29 | __entry->handler, | ||
| 30 | __entry->delta_ns, | ||
| 31 | __entry->handled) | ||
| 32 | ); | ||
| 33 | |||
| 34 | #endif /* _TRACE_NMI_H */ | ||
| 35 | |||
| 36 | /* This part ust be outside protection */ | ||
| 37 | #include <trace/define_trace.h> | ||
diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h index fb104e51496e..0b1df41691e8 100644 --- a/include/uapi/linux/perf_event.h +++ b/include/uapi/linux/perf_event.h | |||
| @@ -157,8 +157,11 @@ enum perf_branch_sample_type { | |||
| 157 | PERF_SAMPLE_BRANCH_ANY_CALL = 1U << 4, /* any call branch */ | 157 | PERF_SAMPLE_BRANCH_ANY_CALL = 1U << 4, /* any call branch */ |
| 158 | PERF_SAMPLE_BRANCH_ANY_RETURN = 1U << 5, /* any return branch */ | 158 | PERF_SAMPLE_BRANCH_ANY_RETURN = 1U << 5, /* any return branch */ |
| 159 | PERF_SAMPLE_BRANCH_IND_CALL = 1U << 6, /* indirect calls */ | 159 | PERF_SAMPLE_BRANCH_IND_CALL = 1U << 6, /* indirect calls */ |
| 160 | PERF_SAMPLE_BRANCH_ABORT_TX = 1U << 7, /* transaction aborts */ | ||
| 161 | PERF_SAMPLE_BRANCH_IN_TX = 1U << 8, /* in transaction */ | ||
| 162 | PERF_SAMPLE_BRANCH_NO_TX = 1U << 9, /* not in transaction */ | ||
| 160 | 163 | ||
| 161 | PERF_SAMPLE_BRANCH_MAX = 1U << 7, /* non-ABI */ | 164 | PERF_SAMPLE_BRANCH_MAX = 1U << 10, /* non-ABI */ |
| 162 | }; | 165 | }; |
| 163 | 166 | ||
| 164 | #define PERF_SAMPLE_BRANCH_PLM_ALL \ | 167 | #define PERF_SAMPLE_BRANCH_PLM_ALL \ |
