diff options
| author | Andrew Vagin <avagin@openvz.org> | 2012-07-11 10:14:58 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2012-07-31 11:02:05 -0400 |
| commit | e6dab5ffab59e910ec0e3355f4a6f29f7a7be474 (patch) | |
| tree | 87acf0fb071b8d09794ac7d834cb256de030cceb /include/linux | |
| parent | d07bdfd322d307789f15b427dbcc39257665356f (diff) | |
perf/trace: Add ability to set a target task for events
A few events are interesting not only for a current task.
For example, sched_stat_* events are interesting for a task
which wakes up. For this reason, it will be good if such
events will be delivered to a target task too.
Now a target task can be set by using __perf_task().
The original idea and a draft patch belongs to Peter Zijlstra.
I need these events for profiling sleep times. sched_switch is used for
getting callchains and sched_stat_* is used for getting time periods.
These events are combined in user space, then it can be analyzed by
perf tools.
Inspired-by: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Arun Sharma <asharma@fb.com>
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1342016098-213063-1-git-send-email-avagin@openvz.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/ftrace_event.h | 5 | ||||
| -rw-r--r-- | include/linux/perf_event.h | 3 |
2 files changed, 5 insertions, 3 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 |
