diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-08-03 13:57:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-08-03 13:57:20 -0400 |
commit | bd463a06064c4bc8497f6aa6dfb4437be8f07a3b (patch) | |
tree | 3499f105c565d977d0ae9486f0a4572cd5fcbd2e /include | |
parent | 148311d2ade909a79afb85a853c7979eb499563f (diff) | |
parent | e6dab5ffab59e910ec0e3355f4a6f29f7a7be474 (diff) |
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fixes from Ingo Molnar:
"Fix merge window fallout and fix sleep profiling (this was always
broken, so it's not a fix for the merge window - we can skip this one
from the head of the tree)."
* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
perf/trace: Add ability to set a target task for events
perf/x86: Fix USER/KERNEL tagging of samples properly
perf/x86/intel/uncore: Make UNCORE_PMU_HRTIMER_INTERVAL 64-bit
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/ftrace_event.h | 5 | ||||
-rw-r--r-- | include/linux/perf_event.h | 3 | ||||
-rw-r--r-- | include/trace/events/sched.h | 4 | ||||
-rw-r--r-- | include/trace/ftrace.h | 6 |
4 files changed, 14 insertions, 4 deletions
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index af961d6f7ab1..642928cf57b4 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
@@ -306,9 +306,10 @@ extern void *perf_trace_buf_prepare(int size, unsigned short type, | |||
306 | 306 | ||
307 | static inline void | 307 | static inline void |
308 | perf_trace_buf_submit(void *raw_data, int size, int rctx, u64 addr, | 308 | perf_trace_buf_submit(void *raw_data, int size, int rctx, u64 addr, |
309 | u64 count, struct pt_regs *regs, void *head) | 309 | u64 count, struct pt_regs *regs, void *head, |
310 | struct task_struct *task) | ||
310 | { | 311 | { |
311 | perf_tp_event(addr, count, raw_data, size, regs, head, rctx); | 312 | perf_tp_event(addr, count, raw_data, size, regs, head, rctx, task); |
312 | } | 313 | } |
313 | #endif | 314 | #endif |
314 | 315 | ||
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 76c5c8b724a7..7602ccb3f40e 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -1272,7 +1272,8 @@ static inline bool perf_paranoid_kernel(void) | |||
1272 | extern void perf_event_init(void); | 1272 | extern void perf_event_init(void); |
1273 | extern void perf_tp_event(u64 addr, u64 count, void *record, | 1273 | extern void perf_tp_event(u64 addr, u64 count, void *record, |
1274 | int entry_size, struct pt_regs *regs, | 1274 | int entry_size, struct pt_regs *regs, |
1275 | struct hlist_head *head, int rctx); | 1275 | struct hlist_head *head, int rctx, |
1276 | struct task_struct *task); | ||
1276 | extern void perf_bp_event(struct perf_event *event, void *data); | 1277 | extern void perf_bp_event(struct perf_event *event, void *data); |
1277 | 1278 | ||
1278 | #ifndef perf_misc_flags | 1279 | #ifndef perf_misc_flags |
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index ea7a2035456d..5a8671e8a67f 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h | |||
@@ -73,6 +73,9 @@ DECLARE_EVENT_CLASS(sched_wakeup_template, | |||
73 | __entry->prio = p->prio; | 73 | __entry->prio = p->prio; |
74 | __entry->success = success; | 74 | __entry->success = success; |
75 | __entry->target_cpu = task_cpu(p); | 75 | __entry->target_cpu = task_cpu(p); |
76 | ) | ||
77 | TP_perf_assign( | ||
78 | __perf_task(p); | ||
76 | ), | 79 | ), |
77 | 80 | ||
78 | TP_printk("comm=%s pid=%d prio=%d success=%d target_cpu=%03d", | 81 | TP_printk("comm=%s pid=%d prio=%d success=%d target_cpu=%03d", |
@@ -325,6 +328,7 @@ DECLARE_EVENT_CLASS(sched_stat_template, | |||
325 | ) | 328 | ) |
326 | TP_perf_assign( | 329 | TP_perf_assign( |
327 | __perf_count(delay); | 330 | __perf_count(delay); |
331 | __perf_task(tsk); | ||
328 | ), | 332 | ), |
329 | 333 | ||
330 | TP_printk("comm=%s pid=%d delay=%Lu [ns]", | 334 | TP_printk("comm=%s pid=%d delay=%Lu [ns]", |
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index c6bc2faaf261..a763888a36f9 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -712,6 +712,9 @@ __attribute__((section("_ftrace_events"))) *__event_##call = &event_##call | |||
712 | #undef __perf_count | 712 | #undef __perf_count |
713 | #define __perf_count(c) __count = (c) | 713 | #define __perf_count(c) __count = (c) |
714 | 714 | ||
715 | #undef __perf_task | ||
716 | #define __perf_task(t) __task = (t) | ||
717 | |||
715 | #undef TP_perf_assign | 718 | #undef TP_perf_assign |
716 | #define TP_perf_assign(args...) args | 719 | #define TP_perf_assign(args...) args |
717 | 720 | ||
@@ -725,6 +728,7 @@ perf_trace_##call(void *__data, proto) \ | |||
725 | struct ftrace_raw_##call *entry; \ | 728 | struct ftrace_raw_##call *entry; \ |
726 | struct pt_regs __regs; \ | 729 | struct pt_regs __regs; \ |
727 | u64 __addr = 0, __count = 1; \ | 730 | u64 __addr = 0, __count = 1; \ |
731 | struct task_struct *__task = NULL; \ | ||
728 | struct hlist_head *head; \ | 732 | struct hlist_head *head; \ |
729 | int __entry_size; \ | 733 | int __entry_size; \ |
730 | int __data_size; \ | 734 | int __data_size; \ |
@@ -752,7 +756,7 @@ perf_trace_##call(void *__data, proto) \ | |||
752 | \ | 756 | \ |
753 | head = this_cpu_ptr(event_call->perf_events); \ | 757 | head = this_cpu_ptr(event_call->perf_events); \ |
754 | perf_trace_buf_submit(entry, __entry_size, rctx, __addr, \ | 758 | perf_trace_buf_submit(entry, __entry_size, rctx, __addr, \ |
755 | __count, &__regs, head); \ | 759 | __count, &__regs, head, __task); \ |
756 | } | 760 | } |
757 | 761 | ||
758 | /* | 762 | /* |