spi: expose spi_master and spi_device statistics via sysfs
authorMartin Sperl <kernel@martin.sperl.org>
Mon, 22 Jun 2015 13:00:36 +0000 (13:00 +0000)
committerMark Brown <broonie@kernel.org>
Tue, 7 Jul 2015 12:33:23 +0000 (13:33 +0100)
commiteca2ebc7e007c9e2b8f5ecfcfc74b53fbe68e42b
tree0e38bce3f30bb7dcad9777f9724fd92ffcbb34a8
parentd770e558e21961ad6cfdf0ff7df0eb5d7d4f0754
spi: expose spi_master and spi_device statistics via sysfs

per spi-master statistics accessible as:
  /sys/class/spi_master/spi*/statistics/*

per spi-device statistics accessible via:
  /sys/class/spi_master/spi*/spi*.*/statistics/*

The following statistics are exposed as separate "files" inside
these directories:
* messages              number of spi_messages
* transfers             number of spi_transfers
* bytes                 number of bytes transferred
* bytes_rx              number of bytes transmitted
* bytes_tx              number of bytes received
* errors                number of errors encounterd
* timedout              number of messages that have timed out
* spi_async             number of spi_messages submitted using spi_async
* spi_sync              number of spi_messages submitted using spi_sync
* spi_sync_immediate    number of spi_messages submitted using spi_sync,
                        that are handled immediately without a context switch
                        to the spi_pump worker-thread

Signed-off-by: Martin Sperl <kernel@martin.sperl.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi.c
include/linux/spi/spi.h