mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-22 23:04:43 +00:00
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>
This commit is contained in:
parent
6ff33f3902
commit
6b7bc0618f
2 changed files with 65 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue