#ifdef CONFIG_DASD_PROFILE staticint dasd_stats_all_block_on(void)
{ int i, rc; struct dasd_device *device;
rc = 0; for (i = 0; i < dasd_max_devindex; ++i) {
device = dasd_device_from_devindex(i); if (IS_ERR(device)) continue; if (device->block)
rc = dasd_profile_on(&device->block->profile);
dasd_put_device(device); if (rc) return rc;
} return 0;
}
staticvoid dasd_stats_all_block_off(void)
{ int i; struct dasd_device *device;
for (i = 0; i < dasd_max_devindex; ++i) {
device = dasd_device_from_devindex(i); if (IS_ERR(device)) continue; if (device->block)
dasd_profile_off(&device->block->profile);
dasd_put_device(device);
}
}
staticvoid dasd_stats_all_block_reset(void)
{ int i; struct dasd_device *device;
for (i = 0; i < dasd_max_devindex; ++i) {
device = dasd_device_from_devindex(i); if (IS_ERR(device)) continue; if (device->block)
dasd_profile_reset(&device->block->profile);
dasd_put_device(device);
}
}
staticvoid dasd_statistics_array(struct seq_file *m, unsignedint *array, int factor)
{ int i;
for (i = 0; i < 32; i++) {
seq_printf(m, "%7d ", array[i] / factor); if (i == 15)
seq_putc(m, '\n');
}
seq_putc(m, '\n');
} #endif/* CONFIG_DASD_PROFILE */
spin_lock_bh(&dasd_global_profile.lock);
prof = dasd_global_profile.data; if (!prof) {
spin_unlock_bh(&dasd_global_profile.lock);
seq_printf(m, "Statistics are off - they might be " "switched on using 'echo set on > " "/proc/dasd/statistics'\n"); return 0;
}
/* prevent counter 'overflow' on output */ for (factor = 1; (prof->dasd_io_reqs / factor) > 9999999;
factor *= 10);
seq_printf(m, "Histogram of sizes (512B secs)\n");
dasd_statistics_array(m, prof->dasd_io_secs, factor);
seq_printf(m, "Histogram of I/O times (microseconds)\n");
dasd_statistics_array(m, prof->dasd_io_times, factor);
seq_printf(m, "Histogram of I/O times per sector\n");
dasd_statistics_array(m, prof->dasd_io_timps, factor);
seq_printf(m, "Histogram of I/O time till ssch\n");
dasd_statistics_array(m, prof->dasd_io_time1, factor);
seq_printf(m, "Histogram of I/O time between ssch and irq\n");
dasd_statistics_array(m, prof->dasd_io_time2, factor);
seq_printf(m, "Histogram of I/O time between ssch " "and irq per sector\n");
dasd_statistics_array(m, prof->dasd_io_time2ps, factor);
seq_printf(m, "Histogram of I/O time between irq and end\n");
dasd_statistics_array(m, prof->dasd_io_time3, factor);
seq_printf(m, "# of req in chanq at enqueuing (1..32) \n");
dasd_statistics_array(m, prof->dasd_io_nr_req, factor);
spin_unlock_bh(&dasd_global_profile.lock); #else
seq_printf(m, "Statistics are not activated in this kernel\n"); #endif return 0;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.