diff -burN -X dontdiff linux-2.4.20/Makefile linux-2.4.20-ins/Makefile --- linux-2.4.20/Makefile 2002-11-28 15:53:16.000000000 -0800 +++ linux-2.4.20-ins/Makefile 2005-07-25 12:48:50.000000000 -0700 @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 4 SUBLEVEL = 20 -EXTRAVERSION = +EXTRAVERSION = -ins KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) diff -burN -X dontdiff linux-2.4.20/finish linux-2.4.20-ins/finish --- linux-2.4.20/finish 1969-12-31 16:00:00.000000000 -0800 +++ linux-2.4.20-ins/finish 2005-07-25 16:50:02.000000000 -0700 @@ -0,0 +1 @@ +cp /root/noise_characterization/grub.conf /boot/grub/grub.conf diff -burN -X dontdiff linux-2.4.20/include/net/timing.h linux-2.4.20-ins/include/net/timing.h --- linux-2.4.20/include/net/timing.h 1969-12-31 16:00:00.000000000 -0800 +++ linux-2.4.20-ins/include/net/timing.h 2005-07-25 13:28:23.000000000 -0700 @@ -0,0 +1,14 @@ +#ifndef _TIMING_H +#define _TIMING_H + +#define tsc(hi,lo) __asm__ __volatile__ ("rdtsc" : "=A" (lo), "=D" (hi)) + +struct tsc_reg { + long hi; + long lo; +}; + +extern struct tsc_reg inst_start; +extern struct sk_buff* inst_curpkt; + +#endif /* _TIMING_H */ diff -burN -X dontdiff linux-2.4.20/net/core/dev.c linux-2.4.20-ins/net/core/dev.c --- linux-2.4.20/net/core/dev.c 2002-11-28 15:53:15.000000000 -0800 +++ linux-2.4.20-ins/net/core/dev.c 2005-07-25 16:53:06.000000000 -0700 @@ -108,6 +108,18 @@ extern int plip_init(void); #endif +/* Kernel Instrumentation */ +#ifndef TIMING +#define TIMING +#endif + +#ifdef TIMING +#include +struct sk_buff* inst_curpkt = NULL; /* Packet to be traced */ +int inst_reset = 0; /* Used to reset the tracing */ +struct tsc_reg inst_start; +struct tsc_reg prev_time; +#endif /* TIMING */ /* This define, if set, will randomly drop a packet when congestion * is more than moderate. It helps fairness in the multi-interface @@ -1234,6 +1246,20 @@ struct softnet_data *queue; unsigned long flags; +#ifdef TIMING + /* Packet Timing Instrumentation */ + struct tsc_reg cur_time; + + if (prev_time.hi == 0) { + tsc(prev_time.hi, prev_time.lo); + } else { + tsc(cur_time.hi, cur_time.lo); + __u32 diff = cur_time.lo - prev_time.lo; + printk(KERN_INFO "Diff=%u\n", diff); + prev_time = cur_time; + } +#endif /* TIMING */ + if (skb->stamp.tv_sec == 0) do_gettimeofday(&skb->stamp);