Re: Logging disk access in block level?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I apologize for the hasty of posting. I post the patch again.
I confirmed that the contents of the log is same with the 
contents of blktrace. I hope this helps somebody-newbie-like me.

--- linux-2.6.20/block/ll_rw_blk.c.sx   2007-02-05 03:44:54.000000000 +0900
+++ linux-2.6.20/block/ll_rw_blk.c      2007-02-12 22:35:34.000000000 +0900
@@ -3150,6 +3150,8 @@
        old_sector = -1;
        old_dev = 0;
        do {
+               struct bio *pb;
+               int r;
                char b[BDEVNAME_SIZE];

                q = bdev_get_queue(bio->bi_bdev);
@@ -3209,6 +3211,14 @@
                        }
                }

+               pb = bio;
+               printk(KERN_INFO "device:[%s:%d] sector:[%8ld/%8ld] [%5s] %3d\n",
+                               pb->bi_bdev->bd_disk->disk_name,
+                               pb->bi_bdev->bd_disk->major,
+                               pb->bi_sector, pb->bi_bdev->bd_disk->capacity,
+                               (pb->bi_rw << (sizeof(unsigned long) - 1)) ? "write" : "read",
+                               r);
+
                ret = q->make_request_fn(q, bio);
        } while (ret);
 }

-- 
Seongsu's blog - http://www.senux.com/
linux: because a PC is a terrible thing to waste
(ksh@xxxxxxxxxxx put this on Tshirts in '93)

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux