platform/chrome: sensorhub: Add trace events for sample
authorGwendal Grignou <gwendal@chromium.org>
Fri, 14 May 2021 00:57:33 +0000 (17:57 -0700)
committerEnric Balletbo i Serra <enric.balletbo@collabora.com>
Mon, 26 Jul 2021 11:24:46 +0000 (13:24 +0200)
commitd453ceb6549af8798913de6a20444cb7200fdb69
treed888b84021b0feb343caf692fd45a20b4a820d27
parente73f0f0ee7541171d89f2e2491130c7771ba58d3
platform/chrome: sensorhub: Add trace events for sample

Add trace event to report samples and their timestamp coming from the
EC. It allows to check if the timestamps are correct and the filter is
working correctly without introducing too much latency.

To enable these events:

cd /sys/kernel/debug/tracing/
echo 1 > events/cros_ec/enable
echo 0 > events/cros_ec/cros_ec_request_start/enable
echo 0 > events/cros_ec/cros_ec_request_done/enable
echo 1 > tracing_on
cat trace_pipe
Observe event flowing:
irq/105-chromeo-95      [000] ....   613.659758: cros_ec_sensorhub_timestamp: ...
irq/105-chromeo-95      [000] ....   613.665219: cros_ec_sensorhub_filter: dx: ...

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
drivers/platform/chrome/Makefile
drivers/platform/chrome/cros_ec_sensorhub_ring.c
drivers/platform/chrome/cros_ec_trace.h