All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC Patch v5 0/1] i2c: core: Adapter and client stats as sysfs attributes
@ 2022-05-17 10:05 ` Sui Chen
  0 siblings, 0 replies; 6+ messages in thread
From: Sui Chen @ 2022-05-17 10:05 UTC (permalink / raw)
  To: linux-kernel, linux-i2c, wsa, openbmc, tali.perry1
  Cc: joel, andrew, benjaminfair, krellan, Sui Chen

This change adds statistics to the i2c_adapter structure as Wolfram
previously suggested
(https://lore.kernel.org/linux-i2c/YgEYEk355t8C4J1x@shikoro/).
It also adds relevant statistics to the per-address i2c_clients where
applicable.

The list of statistics are:

- bus_errors
- nacks
- recovery_successes / recovery_failures (only applicable to
  i2c_adapter)
- timeouts
- messages (only applicable to i2c_client)
- transfers (only applicable to i2c_adapter)

The statistics are located in /sys/class/i2c-adapter/i2c-x/stats and
/sys/class/i2c-adapter/i2c-x/x-xxxx/stats respectively.

Since the counting is done in __i2c_transfer, where the number of
messages transferred is not known upon error, the error counters are
attributed to all unique addresses that appear in the message list
passed into __i2c_transfer.

Currently an rbtree is used to find the i2c_client located at a certain
address. Would be happy to know if there is a better way of doing this.

Thanks!

Sui Chen (1):
  i2c debug counters as sysfs attributes

 drivers/i2c/i2c-core-base.c | 240 +++++++++++++++++++++++++++++++++++-
 drivers/i2c/i2c-dev.c       |  94 ++++++++++++++
 include/linux/i2c.h         |  41 ++++++
 3 files changed, 374 insertions(+), 1 deletion(-)

-- 
2.36.0.550.gb090851708-goog


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-05-17 22:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-17 10:05 [RFC Patch v5 0/1] i2c: core: Adapter and client stats as sysfs attributes Sui Chen
2022-05-17 10:05 ` Sui Chen
2022-05-17 10:05 ` [RFC Patch v5 1/1] i2c debug counters " Sui Chen
2022-05-17 10:05   ` Sui Chen
2022-05-17 22:09   ` kernel test robot
2022-05-17 22:09   ` kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.