blob: 3bdfde88bcdef63c944cbc3fbd6cef23fc5cd459 [file] [log] [blame]
From e95c36b00d47bb9f0b11527fb22fbdbb7eeaff5f Mon Sep 17 00:00:00 2001
From: Thomas Gleixner <tglx@linutronix.de>
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 <tglx@linutronix.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
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 07bc2d2..c19ddb3 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -6089,6 +6089,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.1.1