public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC Patch v5 Resend 0/1] i2c counters as sysfs attributes
@ 2022-08-10  7:20 Sui Chen
  2022-08-10  7:20 ` [RFC Patch v5 Resend 1/1] i2c debug " Sui Chen
  0 siblings, 1 reply; 2+ messages in thread
From: Sui Chen @ 2022-08-10  7:20 UTC (permalink / raw)
  To: linux-kernel, linux-i2c, wsa, openbmc, tali.perry1
  Cc: joel, andrew, benjaminfair, krellan, Sui Chen

Hello, linux-i2c,

We would like to ping in a friendly way and see if there are any
comments on the i2c counters as sysfs attributes.

This change renames the I2C debug counters as previously, and makes them
available to i2c_adapter's and i2c_client's:

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

This patchset is the same as the last one, except that we are using a
new method to verify the results in the counter for i2c_adapters:

We use the Perfetto profiler+visualizer to grab the I2C kernel
tracing events on a BMC with many I2C devices, and compared
the I2C counters before and after the tracing process.

We needed to add a change for Perfetto in order to view the I2C
events in the UI. The Perfetto change is located in
https://android-review.googlesource.com/c/platform/external/perfetto/+/2145699
and it currently shows the outermost I2C ID that appears in an I2C
transaction.

We inspected the counts in the Perfetto trace by executing
the "SELECT count(name), name FROM slices WHERE name LIKE "%i2c%" GROUP
BY name;" SQLite query.

It turns out the increment in the counters in the counters in sysfs and in
the Perfetto trace very closely match each other; the differences were
caused by the time differences between the moments the tracing
started/ended and the I2C counters are obtained.

We would greatly appreciate any comments on this change.

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.37.1.559.g78731f0fdb-goog


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

end of thread, other threads:[~2022-08-10  7:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-10  7:20 [RFC Patch v5 Resend 0/1] i2c counters as sysfs attributes Sui Chen
2022-08-10  7:20 ` [RFC Patch v5 Resend 1/1] i2c debug " Sui Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox