summaryrefslogtreecommitdiffstats
path: root/cpukit/libblock/include/rtems/diskdevs.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2012-06-12 09:46:09 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2012-06-12 10:12:40 +0200
commit9f527308d7248d1ec1d63f0911757bb5faa7ea10 (patch)
tree27943302132f4b86a1ea3c6089407b45d23c66cb /cpukit/libblock/include/rtems/diskdevs.h
parentlibblock: Remove const qualifier (diff)
downloadrtems-9f527308d7248d1ec1d63f0911757bb5faa7ea10.tar.bz2
libblock: Add block device statistics
Diffstat (limited to 'cpukit/libblock/include/rtems/diskdevs.h')
-rw-r--r--cpukit/libblock/include/rtems/diskdevs.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/cpukit/libblock/include/rtems/diskdevs.h b/cpukit/libblock/include/rtems/diskdevs.h
index 6e6be5e9b7..3a9967ecb2 100644
--- a/cpukit/libblock/include/rtems/diskdevs.h
+++ b/cpukit/libblock/include/rtems/diskdevs.h
@@ -87,6 +87,68 @@ typedef struct {
} rtems_blkdev_read_ahead;
/**
+ * @brief Block device statistics.
+ *
+ * Integer overflows in the statistic counters may happen.
+ */
+typedef struct {
+ /**
+ * @brief Read hit count.
+ *
+ * A read hit occurs in the rtems_bdbuf_read() function in case the block is
+ * in the cached or modified state.
+ */
+ uint32_t read_hits;
+
+ /**
+ * @brief Read miss count.
+ *
+ * A read miss occurs in the rtems_bdbuf_read() function in case the block is
+ * in the empty state and a read transfer must be initiated to read the data
+ * from the device.
+ */
+ uint32_t read_misses;
+
+ /**
+ * @brief Read-ahead transfer count.
+ *
+ * Each read-ahead transfer may read multiple blocks.
+ */
+ uint32_t read_ahead_transfers;
+
+ /**
+ * @brief Count of blocks transfered from the device.
+ */
+ uint32_t read_blocks;
+
+ /**
+ * @brief Read error count.
+ *
+ * Error count of transfers issued by the read or read-ahead requests.
+ */
+ uint32_t read_errors;
+
+ /**
+ * @brief Write transfer count.
+ *
+ * Each write transfer may write multiple blocks.
+ */
+ uint32_t write_transfers;
+
+ /**
+ * @brief Count of blocks transfered to the device.
+ */
+ uint32_t write_blocks;
+
+ /**
+ * @brief Write error count.
+ *
+ * Error count of transfers issued by write requests.
+ */
+ uint32_t write_errors;
+} rtems_blkdev_stats;
+
+/**
* @brief Description of a disk device (logical and physical disks).
*
* An array of pointer tables to rtems_disk_device structures is maintained.
@@ -202,6 +264,11 @@ struct rtems_disk_device {
bool deleted;
/**
+ * @brief Device statistics for this disk.
+ */
+ rtems_blkdev_stats stats;
+
+ /**
* @brief Read-ahead control for this disk.
*/
rtems_blkdev_read_ahead read_ahead;