From 4c1c8df584a5a9acc7c75a71d40aca830b97d37b Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 3 Jul 2009 08:44:38 -0500 Subject: [PATCH] trace: add tracepoint to rtmutex_setprio() commit 189b7ee6374b0c1ff0a49c4de055aec5d8303dbd in tip. Signed-off-by: Thomas Gleixner Signed-off-by: Paul Gortmaker --- include/trace/events/sched.h | 31 +++++++++++++++++++++++++++++++ kernel/sched.c | 2 ++ 2 files changed, 33 insertions(+), 0 deletions(-) diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index cfceb0b..354e98f 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h @@ -235,6 +235,37 @@ DEFINE_EVENT(sched_process_template, sched_process_exit, TP_ARGS(p)); /* + * Tracepoint for priority boosting/deboosting of a task: + * + * (NOTE: the 'rq' argument is not used by generic trace events, + * but used by the latency tracer plugin. ) + */ +TRACE_EVENT(sched_task_setprio, + + TP_PROTO(struct rq *rq, struct task_struct *p, int oldprio), + + TP_ARGS(rq, p, oldprio), + + TP_STRUCT__entry( + __array( char, comm, TASK_COMM_LEN ) + __field( pid_t, pid ) + __field( int, prio ) + __field( int, oldprio ) + ), + + TP_fast_assign( + memcpy(__entry->comm, p->comm, TASK_COMM_LEN); + __entry->pid = p->pid; + __entry->prio = p->prio; + __entry->oldprio = oldprio; + ), + + TP_printk("task %s:%d [%d] oldprio=%d", + __entry->comm, __entry->pid, __entry->prio, + __entry->oldprio) +); + +/* * Tracepoint for a waiting task: */ TRACE_EVENT(sched_process_wait, diff --git a/kernel/sched.c b/kernel/sched.c index a2c158e..bb47604 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -4307,6 +4307,8 @@ void task_setprio(struct task_struct *p, int prio) p->prio = prio; + trace_sched_task_setprio(rq, p, oldprio); + if (running) p->sched_class->set_curr_task(rq); if (on_rq) { -- 1.7.0.4