aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-02-09 18:43:55 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-02-09 18:43:55 -0500
commita4cbbf549a9be10b7583c44249efccd64839533d (patch)
tree4b4862e4513b629723b8853e379cd38fee08b095 /include/linux
parent8308756f45a12e2ff4f7749c2694fc83cdef0be9 (diff)
parent2fde4f94e0a9531251e706fa57131b51b0df042e (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.h2
-rw-r--r--include/linux/perf_event.h30
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);
596extern void ftrace_profile_free_filter(struct perf_event *event); 596extern void ftrace_profile_free_filter(struct perf_event *event);
597extern void *perf_trace_buf_prepare(int size, unsigned short type, 597extern 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
600static inline void 600static inline void
601perf_trace_buf_submit(void *raw_data, int size, int rctx, u64 addr, 601perf_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
660extern struct static_key perf_swevent_enabled[PERF_COUNT_SW_MAX]; 660extern struct static_key perf_swevent_enabled[PERF_COUNT_SW_MAX];
661 661
662extern void ___perf_sw_event(u32, u64, struct pt_regs *, u64);
662extern void __perf_sw_event(u32, u64, struct pt_regs *, u64); 663extern 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)
683static __always_inline void 684static __always_inline void
684perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr) 685perf_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
691DECLARE_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 */
698static __always_inline void
699perf_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,
706static inline void perf_event_task_sched_out(struct task_struct *prev, 718static 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)
817static inline void 829static inline void
818perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr) { } 830perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr) { }
819static inline void 831static inline void
832perf_sw_event_sched(u32 event_id, u64 nr, u64 addr) { }
833static inline void
820perf_bp_event(struct perf_event *event, void *data) { } 834perf_bp_event(struct perf_event *event, void *data) { }
821 835
822static inline int perf_register_guest_info_callbacks 836static inline int perf_register_guest_info_callbacks