Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 163762
b: refs/heads/master
c: f977bb4
h: refs/heads/master
v: v3
  • Loading branch information
Ingo Molnar committed Sep 13, 2009
1 parent d00751e commit 9c38da9
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c13f0d3c8165e9592102687fa999da0a0d9c3724
refs/heads/master: f977bb4937857994312fff4f9c2cad336a36a932
33 changes: 33 additions & 0 deletions trunk/include/trace/events/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,39 @@ TRACE_EVENT(sched_stat_wait,
(unsigned long long)__entry->delay)
);

/*
* 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).
Expand Down
1 change: 1 addition & 0 deletions trunk/kernel/sched_fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ static void update_curr(struct cfs_rq *cfs_rq)
if (entity_is_task(curr)) {
struct task_struct *curtask = task_of(curr);

trace_sched_stat_runtime(curtask, delta_exec, curr->vruntime);
cpuacct_charge(curtask, delta_exec);
account_group_exec_runtime(curtask, delta_exec);
}
Expand Down

0 comments on commit 9c38da9

Please sign in to comment.