diff options
author | Jerome Marchand <jmarchan@redhat.com> | 2008-02-08 05:04:56 -0500 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2008-02-08 06:42:00 -0500 |
commit | 28f39d553ee242000e62f6c589ee3dc6de3f9aaa (patch) | |
tree | c677fc2ec4a97c59e2e8eb3ba3080fce5a963784 /block/genhd.c | |
parent | 34e8beac92c27d292938065f8375842d2840767c (diff) |
Enhanced partition statistics: procfs
Reports enhanced partition statistics in /proc/diskstats.
Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Diffstat (limited to 'block/genhd.c')
-rw-r--r-- | block/genhd.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/block/genhd.c b/block/genhd.c index de2ebb2fab43..53f2238e69c8 100644 --- a/block/genhd.c +++ b/block/genhd.c | |||
@@ -584,12 +584,28 @@ static int diskstats_show(struct seq_file *s, void *v) | |||
584 | for (n = 0; n < gp->minors - 1; n++) { | 584 | for (n = 0; n < gp->minors - 1; n++) { |
585 | struct hd_struct *hd = gp->part[n]; | 585 | struct hd_struct *hd = gp->part[n]; |
586 | 586 | ||
587 | if (hd && hd->nr_sects) | 587 | if (!hd || !hd->nr_sects) |
588 | seq_printf(s, "%4d %4d %s %u %u %u %u\n", | 588 | continue; |
589 | gp->major, n + gp->first_minor + 1, | 589 | |
590 | disk_name(gp, n + 1, buf), | 590 | preempt_disable(); |
591 | hd->ios[0], hd->sectors[0], | 591 | part_round_stats(hd); |
592 | hd->ios[1], hd->sectors[1]); | 592 | preempt_enable(); |
593 | seq_printf(s, "%4d %4d %s %lu %lu %llu " | ||
594 | "%u %lu %lu %llu %u %u %u %u\n", | ||
595 | gp->major, n + gp->first_minor + 1, | ||
596 | disk_name(gp, n + 1, buf), | ||
597 | part_stat_read(hd, ios[0]), | ||
598 | part_stat_read(hd, merges[0]), | ||
599 | (unsigned long long)part_stat_read(hd, sectors[0]), | ||
600 | jiffies_to_msecs(part_stat_read(hd, ticks[0])), | ||
601 | part_stat_read(hd, ios[1]), | ||
602 | part_stat_read(hd, merges[1]), | ||
603 | (unsigned long long)part_stat_read(hd, sectors[1]), | ||
604 | jiffies_to_msecs(part_stat_read(hd, ticks[1])), | ||
605 | hd->in_flight, | ||
606 | jiffies_to_msecs(part_stat_read(hd, io_ticks)), | ||
607 | jiffies_to_msecs(part_stat_read(hd, time_in_queue)) | ||
608 | ); | ||
593 | } | 609 | } |
594 | 610 | ||
595 | return 0; | 611 | return 0; |