Prev: [PATCH 09/12] perf: factor out perf_event_switch_clones()
Next: [RFC PATCHSET] sched,perf: unify tracers in sched and move perf on top of TP
From: Tejun Heo on 4 May 2010 08:50 Define and add sched_switch_in and sched_tick tracepoints. Both are colocated with perf event functions. These will be used to make perf use tracepoints. Signed-off-by: Tejun Heo <tj(a)kernel.org> --- include/trace/events/sched.h | 14 ++++++++++++++ kernel/sched.c | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index cfceb0b..2bed8de 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h @@ -220,6 +220,20 @@ DECLARE_EVENT_CLASS(sched_process_template, ); /* + * Tracepoint for task switch in: + */ +DEFINE_EVENT(sched_process_template, sched_switch_in, + TP_PROTO(struct task_struct *p), + TP_ARGS(p)); + +/* + * Tracepoint for scheduler tick: + */ +DEFINE_EVENT(sched_process_template, sched_tick, + TP_PROTO(struct task_struct *p), + TP_ARGS(p)); + +/* * Tracepoint for freeing a task: */ DEFINE_EVENT(sched_process_template, sched_process_free, diff --git a/kernel/sched.c b/kernel/sched.c index 1acec30..f70f9d7 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -2827,7 +2827,7 @@ static void finish_task_switch(struct rq *rq, struct task_struct *prev) finish_arch_switch(prev); finish_lock_switch(rq, prev); - SCHED_EVENT(NONE, sched_in, in, SE_ARGS(current)); + SCHED_EVENT(switch_in, sched_in, in, SE_ARGS(current)); if (mm) mmdrop(mm); if (unlikely(prev_state == TASK_DEAD)) { @@ -3529,7 +3529,7 @@ void scheduler_tick(void) curr->sched_class->task_tick(rq, curr, 0); raw_spin_unlock(&rq->lock); - SCHED_EVENT(NONE, tick, NONE, SE_ARGS(curr)); + SCHED_EVENT(tick, tick, NONE, SE_ARGS(curr)); #ifdef CONFIG_SMP rq->idle_at_tick = idle_cpu(cpu); -- 1.6.4.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |