diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-09-13 16:15:54 (GMT) |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-09-13 16:17:28 (GMT) |
commit | f977bb4937857994312fff4f9c2cad336a36a932 (patch) | |
tree | ce4736f585cfb9ecb3f959f6fe77997852dd00e3 /include/trace | |
parent | c13f0d3c8165e9592102687fa999da0a0d9c3724 (diff) | |
download | linux-fsl-qoriq-f977bb4937857994312fff4f9c2cad336a36a932.tar.xz |
perf_counter, sched: Add sched_stat_runtime tracepoint
This allows more precise tracking of how the scheduler accounts
(and acts upon) a task having spent N nanoseconds of CPU time.
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/sched.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index b48f1ad..4069c43 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h @@ -380,6 +380,39 @@ TRACE_EVENT(sched_stat_wait, ); /* + * Tracepoint for accounting runtime (time the task is executing + * on a CPU). + */ +TRACE_EVENT(sched_stat_runtime, + + TP_PROTO(struct task_struct *tsk, u64 runtime, u64 vruntime), + + TP_ARGS(tsk, runtime, vruntime), + + TP_STRUCT__entry( + __array( char, comm, TASK_COMM_LEN ) + __field( pid_t, pid ) + __field( u64, runtime ) + __field( u64, vruntime ) + ), + + TP_fast_assign( + memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN); + __entry->pid = tsk->pid; + __entry->runtime = runtime; + __entry->vruntime = vruntime; + ) + TP_perf_assign( + __perf_count(runtime); + ), + + TP_printk("task: %s:%d runtime: %Lu [ns], vruntime: %Lu [ns]", + __entry->comm, __entry->pid, + (unsigned long long)__entry->runtime, + (unsigned long long)__entry->vruntime) +); + +/* * Tracepoint for accounting sleep time (time the task is not runnable, * including iowait, see below). */ |