diff -uBbr -X linux-2.6.13-rc3-mm1/Documentation/dontdiff linux-2.6.13-rc3-mm1/drivers/block/ll_rw_blk.c linux-2.6.13-rc3-mm1-ahu/drivers/block/ll_rw_blk.c --- linux-2.6.13-rc3-mm1/drivers/block/ll_rw_blk.c 2005-07-19 09:06:26.000000000 -0400 +++ linux-2.6.13-rc3-mm1-ahu/drivers/block/ll_rw_blk.c 2005-07-21 20:40:22.000000000 -0400 @@ -2879,6 +2879,9 @@ set_bit(BIO_EOF, &bio->bi_flags); } +#include +extern struct rchan *diskstat_chan; + /** * generic_make_request: hand a buffer to its device driver for I/O * @bio: The bio describing the location in memory and on the device. @@ -2968,6 +2971,26 @@ */ blk_partition_remap(bio); + if(diskstat_chan) + { + char b[BDEVNAME_SIZE]; + char buf[128]; + struct timeval tv; + do_gettimeofday(&tv); + int size = snprintf(buf, sizeof(buf)-1, "start: %ld %ld %p %p %s(%d): %s block %Lu - %Lu (%d) on %s %ld %ld\n", + tv.tv_sec, tv.tv_usec, + bio, bio->bi_end_io, + current->comm, current->pid, + (bio->bi_rw & WRITE) ? "WRITE" : "READ", + (unsigned long long)bio->bi_sector, + (unsigned long long)bio->bi_sector + bio->bi_size / 512, + bio->bi_size, + bdevname(bio->bi_bdev,b), + nr_running(), nr_iowait()); + relay_write(diskstat_chan, buf, size); + + } + ret = q->make_request_fn(q, bio); } while (ret); } diff -uBbr -X linux-2.6.13-rc3-mm1/Documentation/dontdiff linux-2.6.13-rc3-mm1/fs/bio.c linux-2.6.13-rc3-mm1-ahu/fs/bio.c --- linux-2.6.13-rc3-mm1/fs/bio.c 2005-07-19 09:06:26.000000000 -0400 +++ linux-2.6.13-rc3-mm1-ahu/fs/bio.c 2005-07-21 17:29:43.000000000 -0400 @@ -962,6 +962,10 @@ } } +#include +extern struct rchan *diskstat_chan; + + /** * bio_endio - end I/O on a bio * @bio: bio @@ -988,6 +992,24 @@ bytes_done = bio->bi_size; } + if (diskstat_chan) { + char buf[256]; + char b[BDEVNAME_SIZE]; + + struct timeval tv; + do_gettimeofday(&tv); + int size = snprintf(buf, sizeof(buf)-1, "end: %ld %ld %p %s %Lu - %Lu (%d) on %s\n", + tv.tv_sec, tv.tv_usec, + bio, + (bio->bi_rw & WRITE) ? "WRITE" : "READ", + (unsigned long long)bio->bi_sector, + (unsigned long long)bio->bi_sector + bytes_done / 512, + bytes_done, + bdevname(bio->bi_bdev, b)); + + relay_write(diskstat_chan, buf, size); + } + bio->bi_size -= bytes_done; bio->bi_sector += (bytes_done >> 9); diff -uBbr -X linux-2.6.13-rc3-mm1/Documentation/dontdiff linux-2.6.13-rc3-mm1/fs/open.c linux-2.6.13-rc3-mm1-ahu/fs/open.c --- linux-2.6.13-rc3-mm1/fs/open.c 2005-07-19 09:06:26.000000000 -0400 +++ linux-2.6.13-rc3-mm1-ahu/fs/open.c 2005-07-21 17:29:17.000000000 -0400 @@ -938,6 +938,9 @@ EXPORT_SYMBOL(fd_install); +#include +extern struct rchan *diskstat_chan; + asmlinkage long sys_open(const char __user * filename, int flags, int mode) { char * tmp; @@ -962,6 +965,18 @@ } putname(tmp); } + + if( fd >= 0 && diskstat_chan) { + char buf[456]; + struct timeval tv; + do_gettimeofday(&tv); + int size = snprintf(buf, sizeof(buf)-1, "open: %ld %ld %d %s\n", + tv.tv_sec, tv.tv_usec, + current->pid, filename); + + relay_write(diskstat_chan, buf, size); + } + return fd; } EXPORT_SYMBOL_GPL(sys_open); diff -uBbr -X linux-2.6.13-rc3-mm1/Documentation/dontdiff linux-2.6.13-rc3-mm1/init/main.c linux-2.6.13-rc3-mm1-ahu/init/main.c --- linux-2.6.13-rc3-mm1/init/main.c 2005-07-19 09:06:26.000000000 -0400 +++ linux-2.6.13-rc3-mm1-ahu/init/main.c 2005-07-19 09:22:36.000000000 -0400 @@ -584,6 +584,11 @@ flush_scheduled_work(); } +#include +#define SUBBUF_SIZE 10000000 +#define N_SUBBUFS 1 +struct rchan *diskstat_chan = NULL; + /* * Ok, the machine is now initialized. None of the devices * have been touched yet, but the CPU subsystem is up and @@ -606,6 +611,12 @@ sock_init(); do_initcalls(); + diskstat_chan = relay_open("diskstat", NULL, SUBBUF_SIZE, + N_SUBBUFS, 1, NULL); + if (!diskstat_chan) + printk("diskchat channel creation failed\n"); + else + printk("diskchat channel ready\n"); } static void do_pre_smp_initcalls(void)