diff options
| author | Martin Sperl <kernel@martin.sperl.org> | 2015-06-22 09:02:04 -0400 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2015-09-19 14:12:56 -0400 |
| commit | 6b7bc0618ff1a333d2265131b124e966335d5dee (patch) | |
| tree | dcbbfd8154c62a3bb02c23d071f57cba08294371 /include/linux/spi | |
| parent | 6ff33f3902c3b1c5d0db6b1e2c70b6d76fba357f (diff) | |
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')
| -rw-r--r-- | include/linux/spi/spi.h | 4 |
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; | |||
| 51 | * @bytes_tx: number of bytes sent to device | 51 | * @bytes_tx: number of bytes sent to device |
| 52 | * @bytes_rx: number of bytes received from device | 52 | * @bytes_rx: number of bytes received from device |
| 53 | * | 53 | * |
| 54 | * @transfer_bytes_histo: | ||
| 55 | * transfer bytes histogramm | ||
| 54 | */ | 56 | */ |
| 55 | struct spi_statistics { | 57 | struct spi_statistics { |
| 56 | spinlock_t lock; /* lock for the whole structure */ | 58 | spinlock_t lock; /* lock for the whole structure */ |
| @@ -68,6 +70,8 @@ struct spi_statistics { | |||
| 68 | unsigned long long bytes_rx; | 70 | unsigned long long bytes_rx; |
| 69 | unsigned long long bytes_tx; | 71 | unsigned long long bytes_tx; |
| 70 | 72 | ||
| 73 | #define SPI_STATISTICS_HISTO_SIZE 17 | ||
| 74 | unsigned long transfer_bytes_histo[SPI_STATISTICS_HISTO_SIZE]; | ||
| 71 | }; | 75 | }; |
| 72 | 76 | ||
| 73 | void spi_statistics_add_transfer_stats(struct spi_statistics *stats, | 77 | void spi_statistics_add_transfer_stats(struct spi_statistics *stats, |
