Skip to contentSkip to conversation

platform: chrome: Split trace include file

PATCH Applied Gwendal Grignou 2 participants 2 messages Jan 22, 2022 – Feb 18, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 platform: chrome: Split trace include file

cros_ec_trace.h defined 5 tracing events, 2 for cros_ec_proto and 3 for cros_ec_sensorhub_ring.
These 2 files are in different kernel modules, the traces are defined twice in the kernel which leads to problem enabling only some traces.

Move sensorhub traces from cros_ec_trace.h to cros_ec_sensorhub_trace.h and enable them only in cros_ec_sensorhub kernel module.

Check we can now enable any single traces: without this patch, we can only enable all sensorhub traces or none.

Fixes d453ceb65 ("platform/chrome: sensorhub: Add trace events for sample")

---
Changes since v1: CC to stable, define the bug scope.

 drivers/platform/chrome/Makefile              |   3 +-
 .../platform/chrome/cros_ec_sensorhub_ring.c  |   3 +-
 .../platform/chrome/cros_ec_sensorhub_trace.h | 123 ++++++++++++++++++
 drivers/platform/chrome/cros_ec_trace.h       |  95 --------------
 4 files changed, 127 insertions(+), 97 deletions(-)
 create mode 100644 drivers/platform/chrome/cros_ec_sensorhub_trace.h
drivers/platform/chrome/Makefile +2 -1
index f901d2e43166c3..88cbc434c06b22 100644
@@ -2,6 +2,7 @@
 
 # tell define_trace.h where to find the cros ec trace header
 CFLAGS_cros_ec_trace.o:=		-I$(src)
+CFLAGS_cros_ec_sensorhub_ring.o:=	-I$(src)
 
 obj-$(CONFIG_CHROMEOS_LAPTOP)		+= chromeos_laptop.o
 obj-$(CONFIG_CHROMEOS_PSTORE)		+= chromeos_pstore.o
@@ -20,7 +21,7 @@ obj-$(CONFIG_CROS_EC_CHARDEV)		+= cros_ec_chardev.o
 obj-$(CONFIG_CROS_EC_LIGHTBAR)		+= cros_ec_lightbar.o
 obj-$(CONFIG_CROS_EC_VBC)		+= cros_ec_vbc.o
 obj-$(CONFIG_CROS_EC_DEBUGFS)		+= cros_ec_debugfs.o
-cros-ec-sensorhub-objs			:= cros_ec_sensorhub.o cros_ec_sensorhub_ring.o cros_ec_trace.o
+cros-ec-sensorhub-objs			:= cros_ec_sensorhub.o cros_ec_sensorhub_ring.o
 obj-$(CONFIG_CROS_EC_SENSORHUB)		+= cros-ec-sensorhub.o
 obj-$(CONFIG_CROS_EC_SYSFS)		+= cros_ec_sysfs.o
 obj-$(CONFIG_CROS_USBPD_LOGGER)		+= cros_usbpd_logger.o
drivers/platform/chrome/cros_ec_sensorhub_ring.c +2 -1
index 98e37080f76091..71948dade0e2ae 100644
@@ -17,7 +17,8 @@
 #include <linux/sort.h>
 #include <linux/slab.h>
 
-#include "cros_ec_trace.h"
+#define CREATE_TRACE_POINTS
+#include "cros_ec_sensorhub_trace.h"
 
 /* Precision of fixed point for the m values from the filter */
 #define M_PRECISION BIT(23)
drivers/platform/chrome/cros_ec_sensorhub_trace.h new file +123 -0

123 lines not on this page · raw message

drivers/platform/chrome/cros_ec_trace.h +0 -95

107 lines not on this page · raw message

Signature · 1 line
2.35.0.rc0.227.g00780c9af4-goog
Applied
#1 lore raw

Hi Gwendal,

Quoted 9 lines · Gwendal Grignou

cros_ec_trace.h defined 5 tracing events, 2 for cros_ec_proto and 3 for cros_ec_sensorhub_ring.
These 2 files are in different kernel modules, the traces are defined twice in the kernel which leads to problem enabling only some traces.

Move sensorhub traces from cros_ec_trace.h to cros_ec_sensorhub_trace.h and enable them only in cros_ec_sensorhub kernel module.

[...]

Applied, thanks!

[1/1] platform: chrome: Split trace include file

      commit: 4c288c88d0169120a2de6041c81017585f7ee556

Best regards,

Signature · 7 lines
Benson Leung
Staff Software Engineer
Chrome OS Kernel
Google Inc.
[email protected]
Chromium OS Project
[email protected]