summaryrefslogtreecommitdiffstats
path: root/include/linux/spi/spi.h
diff options
context:
space:
mode:
authorMartin Sperl2015-06-22 15:02:04 +0200
committerMark Brown2015-09-19 20:12:56 +0200
commit6b7bc0618ff1a333d2265131b124e966335d5dee (patch)
treedcbbfd8154c62a3bb02c23d071f57cba08294371 /include/linux/spi/spi.h
parentLinux 4.3-rc1 (diff)
downloadkernel-qcow2-linux-6b7bc0618ff1a333d2265131b124e966335d5dee.tar.gz
kernel-qcow2-linux-6b7bc0618ff1a333d2265131b124e966335d5dee.tar.xz
kernel-qcow2-linux-6b7bc0618ff1a333d2265131b124e966335d5dee.zip
spi: add transfer histogram statistics via sysfs
report transfer sizes as a histogram via the following files: /sys/class/spi_master/spi*/statistics/transfer_bytes_histo_* /sys/class/spi_master/spi*/spi*.*/statistics/transfer_bytes_histo_* Signed-off-by: Martin Sperl <kernel@martin.sperl.org> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/linux/spi/spi.h')
-rw-r--r--include/linux/spi/spi.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 269e8afd3e2a..5b6fdc48eba7 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -51,6 +51,8 @@ extern struct bus_type spi_bus_type;
* @bytes_tx: number of bytes sent to device
* @bytes_rx: number of bytes received from device
*
+ * @transfer_bytes_histo:
+ * transfer bytes histogramm
*/
struct spi_statistics {
spinlock_t lock; /* lock for the whole structure */
@@ -68,6 +70,8 @@ struct spi_statistics {
unsigned long long bytes_rx;
unsigned long long bytes_tx;
+#define SPI_STATISTICS_HISTO_SIZE 17
+ unsigned long transfer_bytes_histo[SPI_STATISTICS_HISTO_SIZE];
};
void spi_statistics_add_transfer_stats(struct spi_statistics *stats,