diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-09 18:43:55 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-09 18:43:55 -0500 |
| commit | a4cbbf549a9be10b7583c44249efccd64839533d (patch) | |
| tree | 4b4862e4513b629723b8853e379cd38fee08b095 /include/linux | |
| parent | 8308756f45a12e2ff4f7749c2694fc83cdef0be9 (diff) | |
| parent | 2fde4f94e0a9531251e706fa57131b51b0df042e (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 side changes:
- AMD range breakpoints support:
Extend breakpoint tools and core to support address range through
perf event with initial backend support for AMD extended
breakpoints.
The syntax is:
perf record -e mem:addr/len:type
For example set write breakpoint from 0x1000 to 0x1200 (0x1000 + 512)
perf record -e mem:0x1000/512:w
- event throttling/rotating fixes
- various event group handling fixes, cleanups and general paranoia
code to be more robust against bugs in the future.
- kernel stack overhead fixes
User-visible tooling side changes:
- Show precise number of samples in at the end of a 'record' session,
if processing build ids, since we will then traverse the whole
perf.data file and see all the PERF_RECORD_SAMPLE records,
otherwise stop showing the previous off-base heuristicly counted
number of "samples" (Namhyung Kim).
- Support to read compressed module from build-id cache (Namhyung
Kim)
- Enable sampling loads and stores simultaneously in 'perf mem'
(Stephane Eranian)
- 'perf diff' output improvements (Namhyung Kim)
- Fix error reporting for evsel pgfault constructor (Arnaldo Carvalho
de Melo)
Tooling side infrastructure changes:
- Cache eh/debug frame offset for dwarf unwind (Namhyung Kim)
- Support parsing parameterized events (Cody P Schafer)
- Add support for IP address formats in libtraceevent (David Ahern)
Plus other misc fixes"
* 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (48 commits)
perf: Decouple unthrottling and rotating
perf: Drop module reference on event init failure
perf: Use POLLIN instead of POLL_IN for perf poll data in flag
perf: Fix put_event() ctx lock
perf: Fix move_group() order
perf: Fix event->ctx locking
perf: Add a bit of paranoia
perf symbols: Convert lseek + read to pread
perf tools: Use perf_data_file__fd() consistently
perf symbols: Support to read compressed module from build-id cache
perf evsel: Set attr.task bit for a tracking event
perf header: Set header version correctly
perf record: Show precise number of samples
perf tools: Do not use __perf_session__process_events() directly
perf callchain: Cache eh/debug frame offset for dwarf unwind
perf tools: Provide stub for missing pthread_attr_setaffinity_np
perf evsel: Don't rely on malloc working for sz 0
tools lib traceevent: Add support for IP address formats
perf ui/tui: Show fatal error message only if exists
perf tests: Fix typo in sample-parsing.c
...
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/ftrace_event.h | 2 | ||||
| -rw-r--r-- | include/linux/perf_event.h | 30 |
2 files changed, 23 insertions, 9 deletions
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 0bebb5c348b8..d36f68b08acc 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
| @@ -595,7 +595,7 @@ extern int ftrace_profile_set_filter(struct perf_event *event, int event_id, | |||
| 595 | char *filter_str); | 595 | char *filter_str); |
| 596 | extern void ftrace_profile_free_filter(struct perf_event *event); | 596 | extern void ftrace_profile_free_filter(struct perf_event *event); |
| 597 | extern void *perf_trace_buf_prepare(int size, unsigned short type, | 597 | extern void *perf_trace_buf_prepare(int size, unsigned short type, |
| 598 | struct pt_regs *regs, int *rctxp); | 598 | struct pt_regs **regs, int *rctxp); |
| 599 | 599 | ||
| 600 | static inline void | 600 | static inline void |
| 601 | perf_trace_buf_submit(void *raw_data, int size, int rctx, u64 addr, | 601 | perf_trace_buf_submit(void *raw_data, int size, int rctx, u64 addr, |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 664de5a4ec46..5cad0e6f3552 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
| @@ -469,6 +469,7 @@ struct perf_event_context { | |||
| 469 | */ | 469 | */ |
| 470 | struct mutex mutex; | 470 | struct mutex mutex; |
| 471 | 471 | ||
| 472 | struct list_head active_ctx_list; | ||
| 472 | struct list_head pinned_groups; | 473 | struct list_head pinned_groups; |
| 473 | struct list_head flexible_groups; | 474 | struct list_head flexible_groups; |
| 474 | struct list_head event_list; | 475 | struct list_head event_list; |
| @@ -519,7 +520,6 @@ struct perf_cpu_context { | |||
| 519 | int exclusive; | 520 | int exclusive; |
| 520 | struct hrtimer hrtimer; | 521 | struct hrtimer hrtimer; |
| 521 | ktime_t hrtimer_interval; | 522 | ktime_t hrtimer_interval; |
| 522 | struct list_head rotation_list; | ||
| 523 | struct pmu *unique_pmu; | 523 | struct pmu *unique_pmu; |
| 524 | struct perf_cgroup *cgrp; | 524 | struct perf_cgroup *cgrp; |
| 525 | }; | 525 | }; |
| @@ -659,6 +659,7 @@ static inline int is_software_event(struct perf_event *event) | |||
| 659 | 659 | ||
| 660 | extern struct static_key perf_swevent_enabled[PERF_COUNT_SW_MAX]; | 660 | extern struct static_key perf_swevent_enabled[PERF_COUNT_SW_MAX]; |
| 661 | 661 | ||
| 662 | extern void ___perf_sw_event(u32, u64, struct pt_regs *, u64); | ||
| 662 | extern void __perf_sw_event(u32, u64, struct pt_regs *, u64); | 663 | extern void __perf_sw_event(u32, u64, struct pt_regs *, u64); |
| 663 | 664 | ||
| 664 | #ifndef perf_arch_fetch_caller_regs | 665 | #ifndef perf_arch_fetch_caller_regs |
| @@ -683,14 +684,25 @@ static inline void perf_fetch_caller_regs(struct pt_regs *regs) | |||
| 683 | static __always_inline void | 684 | static __always_inline void |
| 684 | perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr) | 685 | perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr) |
| 685 | { | 686 | { |
| 686 | struct pt_regs hot_regs; | 687 | if (static_key_false(&perf_swevent_enabled[event_id])) |
| 688 | __perf_sw_event(event_id, nr, regs, addr); | ||
| 689 | } | ||
| 690 | |||
| 691 | DECLARE_PER_CPU(struct pt_regs, __perf_regs[4]); | ||
| 687 | 692 | ||
| 693 | /* | ||
| 694 | * 'Special' version for the scheduler, it hard assumes no recursion, | ||
| 695 | * which is guaranteed by us not actually scheduling inside other swevents | ||
| 696 | * because those disable preemption. | ||
| 697 | */ | ||
| 698 | static __always_inline void | ||
| 699 | perf_sw_event_sched(u32 event_id, u64 nr, u64 addr) | ||
| 700 | { | ||
| 688 | if (static_key_false(&perf_swevent_enabled[event_id])) { | 701 | if (static_key_false(&perf_swevent_enabled[event_id])) { |
| 689 | if (!regs) { | 702 | struct pt_regs *regs = this_cpu_ptr(&__perf_regs[0]); |
| 690 | perf_fetch_caller_regs(&hot_regs); | 703 | |
| 691 | regs = &hot_regs; | 704 | perf_fetch_caller_regs(regs); |
| 692 | } | 705 | ___perf_sw_event(event_id, nr, regs, addr); |
| 693 | __perf_sw_event(event_id, nr, regs, addr); | ||
| 694 | } | 706 | } |
| 695 | } | 707 | } |
| 696 | 708 | ||
| @@ -706,7 +718,7 @@ static inline void perf_event_task_sched_in(struct task_struct *prev, | |||
| 706 | static inline void perf_event_task_sched_out(struct task_struct *prev, | 718 | static inline void perf_event_task_sched_out(struct task_struct *prev, |
| 707 | struct task_struct *next) | 719 | struct task_struct *next) |
| 708 | { | 720 | { |
| 709 | perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, NULL, 0); | 721 | perf_sw_event_sched(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, 0); |
| 710 | 722 | ||
| 711 | if (static_key_false(&perf_sched_events.key)) | 723 | if (static_key_false(&perf_sched_events.key)) |
| 712 | __perf_event_task_sched_out(prev, next); | 724 | __perf_event_task_sched_out(prev, next); |
| @@ -817,6 +829,8 @@ static inline int perf_event_refresh(struct perf_event *event, int refresh) | |||
| 817 | static inline void | 829 | static inline void |
| 818 | perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr) { } | 830 | perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr) { } |
| 819 | static inline void | 831 | static inline void |
| 832 | perf_sw_event_sched(u32 event_id, u64 nr, u64 addr) { } | ||
| 833 | static inline void | ||
| 820 | perf_bp_event(struct perf_event *event, void *data) { } | 834 | perf_bp_event(struct perf_event *event, void *data) { } |
| 821 | 835 | ||
| 822 | static inline int perf_register_guest_info_callbacks | 836 | static inline int perf_register_guest_info_callbacks |
