Skip to contentSkip to conversation

KMON - kmon scheduler instrumentation ...

PATCH In review Davide Libenzi 1 participant 1 message May 6, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 3/4 KMON - kmon scheduler instrumentation ...

Hooks the kmon interface to the scheduler operations.

- Davide

kernel/sched.c +6 -0
Index: linux-2.6.21.scdev/kernel/sched.c
===================================================================
@@ -52,6 +52,7 @@
 #include <linux/tsacct_kern.h>
 #include <linux/kprobes.h>
 #include <linux/delayacct.h>
+#include <linux/kmon-stats.h>
 #include <asm/tlb.h>
 
 #include <asm/unistd.h>
@@ -691,10 +692,12 @@
 	list_del(&p->run_list);
 	if (list_empty(array->queue + p->prio))
 		__clear_bit(p->prio, array->bitmap);
+	kmon_st_task_dequeue(p);
 }
 
 static void enqueue_task(struct task_struct *p, struct prio_array *array)
 {
+	kmon_st_task_enqueue(p);
 	sched_info_queued(p);
 	list_add_tail(&p->run_list, array->queue + p->prio);
 	__set_bit(p->prio, array->bitmap);
@@ -1417,6 +1420,8 @@
 	int new_cpu;
 #endif
 
+	kmon_st_task_wakeup(in_interrupt() ? NULL: current, p);
+
 	rq = task_rq_lock(p, &flags);
 	old_state = p->state;
 	if (!(old_state & state))
@@ -3412,6 +3417,7 @@
 	prev->timestamp = prev->last_ran = now;
 
 	sched_info_switch(prev, next);
+	kmon_st_task_switch(prev, next);
 	if (likely(prev != next)) {
 		next->timestamp = next->last_ran = now;
 		rq->nr_switches++;