
From: Karim Yaghmour <karim@opersys.com>

signed-off-by: Karim Yaghmour <karim@opersys.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/kernel/exit.c       |    5 +++++
 25-akpm/kernel/fork.c       |    3 +++
 25-akpm/kernel/irq/handle.c |    5 +++++
 25-akpm/kernel/itimer.c     |    5 +++++
 25-akpm/kernel/sched.c      |    4 ++++
 25-akpm/kernel/signal.c     |    4 ++++
 25-akpm/kernel/softirq.c    |    8 ++++++++
 25-akpm/kernel/timer.c      |    4 ++++
 kernel/Makefile             |    0 
 9 files changed, 38 insertions(+)

diff -puN kernel/exit.c~ltt-kernel-events kernel/exit.c
--- 25/kernel/exit.c~ltt-kernel-events	2005-01-23 19:05:46.094871976 -0800
+++ 25-akpm/kernel/exit.c	2005-01-23 19:05:46.111869392 -0800
@@ -24,6 +24,7 @@
 #include <linux/profile.h>
 #include <linux/mount.h>
 #include <linux/proc_fs.h>
+#include <linux/ltt-events.h>
 #include <linux/mempolicy.h>
 #include <linux/syscalls.h>
 
@@ -815,6 +816,8 @@ fastcall NORET_TYPE void do_exit(long co
 	}
 	exit_mm(tsk);
 
+	ltt_ev_process_exit(0, 0);
+
 	exit_sem(tsk);
 	__exit_files(tsk);
 	__exit_fs(tsk);
@@ -1320,6 +1323,8 @@ static long do_wait(pid_t pid, int optio
 	struct task_struct *tsk;
 	int flag, retval;
 
+	ltt_ev_process(LTT_EV_PROCESS_WAIT, pid, 0);
+
 	add_wait_queue(&current->signal->wait_chldexit,&wait);
 repeat:
 	/*
diff -puN kernel/fork.c~ltt-kernel-events kernel/fork.c
--- 25/kernel/fork.c~ltt-kernel-events	2005-01-23 19:05:46.095871824 -0800
+++ 25-akpm/kernel/fork.c	2005-01-23 19:05:46.113869088 -0800
@@ -40,6 +40,7 @@
 #include <linux/profile.h>
 #include <linux/rmap.h>
 #include <linux/acct.h>
+#include <linux/ltt-events.h>
 
 #include <asm/pgtable.h>
 #include <asm/pgalloc.h>
@@ -1208,6 +1209,8 @@ long do_fork(unsigned long clone_flags,
 			ptrace_notify ((trace << 8) | SIGTRAP);
 		}
 
+		ltt_ev_process(LTT_EV_PROCESS_FORK, p->pid, 0);
+
 		if (clone_flags & CLONE_VFORK) {
 			wait_for_completion(&vfork);
 			if (unlikely (current->ptrace & PT_TRACE_VFORK_DONE))
diff -puN kernel/irq/handle.c~ltt-kernel-events kernel/irq/handle.c
--- 25/kernel/irq/handle.c~ltt-kernel-events	2005-01-23 19:05:46.097871520 -0800
+++ 25-akpm/kernel/irq/handle.c	2005-01-23 19:05:46.113869088 -0800
@@ -11,6 +11,7 @@
 #include <linux/random.h>
 #include <linux/interrupt.h>
 #include <linux/kernel_stat.h>
+#include <linux/ltt-events.h>
 
 #include "internals.h"
 
@@ -80,6 +81,8 @@ fastcall int handle_IRQ_event(unsigned i
 {
 	int ret, retval = 0, status = 0;
 
+	ltt_ev_irq_entry(irq, !(user_mode(regs)));
+
 	if (!(action->flags & SA_INTERRUPT))
 		local_irq_enable();
 
@@ -95,6 +98,8 @@ fastcall int handle_IRQ_event(unsigned i
 		add_interrupt_randomness(irq);
 	local_irq_disable();
 
+	ltt_ev_irq_exit();
+
 	return retval;
 }
 
diff -puN kernel/itimer.c~ltt-kernel-events kernel/itimer.c
--- 25/kernel/itimer.c~ltt-kernel-events	2005-01-23 19:05:46.098871368 -0800
+++ 25-akpm/kernel/itimer.c	2005-01-23 19:08:01.658263208 -0800
@@ -12,6 +12,7 @@
 #include <linux/syscalls.h>
 #include <linux/time.h>
 #include <linux/posix-timers.h>
+#include <linux/ltt-events.h>
 
 #include <asm/uaccess.h>
 
@@ -131,6 +132,8 @@ void it_real_fn(unsigned long __data)
 {
 	struct task_struct * p = (struct task_struct *) __data;
 
+	ltt_ev_timer(LTT_EV_TIMER_EXPIRED, 0, 0, 0);
+
 	send_group_sig_info(SIGALRM, SEND_SIG_PRIV, p);
 
 	/*
@@ -147,6 +150,8 @@ int do_setitimer(int which, struct itime
  	unsigned long val, interval;
 	cputime_t cval, cinterval, nval, ninterval;
 
+	ltt_ev_timer(LTT_EV_TIMER_SETITIMER, which,
+		value->it_interval, value->it_value);
 	switch (which) {
 	case ITIMER_REAL:
 		spin_lock_irq(&tsk->sighand->siglock);
diff -puN kernel/Makefile~ltt-kernel-events kernel/Makefile
diff -puN kernel/sched.c~ltt-kernel-events kernel/sched.c
--- 25/kernel/sched.c~ltt-kernel-events	2005-01-23 19:05:46.102870760 -0800
+++ 25-akpm/kernel/sched.c	2005-01-23 19:05:46.118868328 -0800
@@ -45,6 +45,7 @@
 #include <linux/seq_file.h>
 #include <linux/syscalls.h>
 #include <linux/times.h>
+#include <linux/ltt-events.h>
 #include <asm/tlb.h>
 
 #include <asm/unistd.h>
@@ -307,6 +308,8 @@ static runqueue_t *task_rq_lock(task_t *
 {
 	struct runqueue *rq;
 
+	ltt_ev_process(LTT_EV_PROCESS_WAKEUP, p->pid, p->state);
+
 repeat_lock_task:
 	local_irq_save(*flags);
 	rq = task_rq(p);
@@ -2762,6 +2765,7 @@ switch_tasks:
 		++*switch_count;
 
 		prepare_arch_switch(rq, next);
+		ltt_ev_schedchange(prev, next);
 		prev = context_switch(rq, prev, next);
 		barrier();
 
diff -puN kernel/signal.c~ltt-kernel-events kernel/signal.c
--- 25/kernel/signal.c~ltt-kernel-events	2005-01-23 19:05:46.103870608 -0800
+++ 25-akpm/kernel/signal.c	2005-01-23 19:08:20.339423240 -0800
@@ -23,6 +23,8 @@
 #include <linux/syscalls.h>
 #include <linux/ptrace.h>
 #include <linux/posix-timers.h>
+#include <linux/ltt-events.h>
+
 #include <asm/param.h>
 #include <asm/uaccess.h>
 #include <asm/unistd.h>
@@ -874,6 +876,8 @@ specific_send_sig_info(int sig, struct s
 	if (sig_ignored(t, sig))
 		goto out;
 
+	ltt_ev_process(LTT_EV_PROCESS_SIGNAL, sig, t->pid);
+
 	/* Support queueing exactly one non-rt signal, so that we
 	   can get more detailed information about the cause of
 	   the signal. */
diff -puN kernel/softirq.c~ltt-kernel-events kernel/softirq.c
--- 25/kernel/softirq.c~ltt-kernel-events	2005-01-23 19:05:46.105870304 -0800
+++ 25-akpm/kernel/softirq.c	2005-01-23 19:05:46.122867720 -0800
@@ -16,6 +16,7 @@
 #include <linux/cpu.h>
 #include <linux/kthread.h>
 #include <linux/rcupdate.h>
+#include <linux/ltt-events.h>
 
 #include <asm/irq.h>
 /*
@@ -92,6 +93,7 @@ restart:
 
 	do {
 		if (pending & 1) {
+			ltt_ev_soft_irq(LTT_EV_SOFT_IRQ_SOFT_IRQ, (h - softirq_vec));
 			h->action(h);
 			rcu_bh_qsctr_inc(cpu);
 		}
@@ -264,6 +266,9 @@ static void tasklet_action(struct softir
 			if (!atomic_read(&t->count)) {
 				if (!test_and_clear_bit(TASKLET_STATE_SCHED, &t->state))
 					BUG();
+
+				ltt_ev_soft_irq(LTT_EV_SOFT_IRQ_TASKLET_ACTION, (unsigned long) (t->func));
+
 				t->func(t->data);
 				tasklet_unlock(t);
 				continue;
@@ -297,6 +302,9 @@ static void tasklet_hi_action(struct sof
 			if (!atomic_read(&t->count)) {
 				if (!test_and_clear_bit(TASKLET_STATE_SCHED, &t->state))
 					BUG();
+
+				ltt_ev_soft_irq(LTT_EV_SOFT_IRQ_TASKLET_HI_ACTION, (unsigned long) (t->func));
+
 				t->func(t->data);
 				tasklet_unlock(t);
 				continue;
diff -puN kernel/timer.c~ltt-kernel-events kernel/timer.c
--- 25/kernel/timer.c~ltt-kernel-events	2005-01-23 19:05:46.106870152 -0800
+++ 25-akpm/kernel/timer.c	2005-01-23 19:05:46.124867416 -0800
@@ -33,6 +33,7 @@
 #include <linux/posix-timers.h>
 #include <linux/cpu.h>
 #include <linux/syscalls.h>
+#include <linux/ltt-events.h>
 
 #include <asm/uaccess.h>
 #include <asm/unistd.h>
@@ -885,6 +886,8 @@ static void run_timer_softirq(struct sof
 {
 	tvec_base_t *base = &__get_cpu_var(tvec_bases);
 
+	ltt_ev(LTT_EV_KERNEL_TIMER, NULL);
+
 	if (time_after_eq(jiffies, base->timer_jiffies))
 		__run_timers(base);
 }
@@ -1043,6 +1046,7 @@ asmlinkage long sys_getegid(void)
 
 static void process_timeout(unsigned long __data)
 {
+	ltt_ev_timer(LTT_EV_TIMER_EXPIRED, 0, 0, 0);
 	wake_up_process((task_t *)__data);
 }
 
_
