diff options
author | Raul E Rangel <rrangel@chromium.org> | 2019-11-25 10:45:39 -0700 |
---|---|---|
committer | Enric Balletbo i Serra <enric.balletbo@collabora.com> | 2019-12-10 10:14:02 +0100 |
commit | 205c9326fd86659fadbfd4da66ab35eb2770a331 (patch) | |
tree | 1818c86e445a884e4195a48433b9aa10acf40338 /drivers/platform/chrome/cros_ec_trace.h | |
parent | 086338df1d6c3d717eb41f975a480571bb2d2973 (diff) | |
download | linux-stable-205c9326fd86659fadbfd4da66ab35eb2770a331.tar.gz linux-stable-205c9326fd86659fadbfd4da66ab35eb2770a331.tar.bz2 linux-stable-205c9326fd86659fadbfd4da66ab35eb2770a331.zip |
platform/chrome: cros_ec_proto: Add response tracing
Add the ability to view response codes as well.
I dropped the EVENT_CLASS since there is only one event per class.
cros_ec_cmd has now been renamed to cros_ec_request_start.
Example:
$ echo 1 > /sys/kernel/debug/tracing/events/cros_ec/enable
$ cat /sys/kernel/debug/tracing/trace
369.416372: cros_ec_request_start: version: 0, command: EC_CMD_USB_PD_POWER_INFO
369.420528: cros_ec_request_done: version: 0, command: EC_CMD_USB_PD_POWER_INFO, ec result: EC_RES_SUCCESS, retval: 16
369.420529: cros_ec_request_start: version: 0, command: EC_CMD_USB_PD_DISCOVERY
369.421383: cros_ec_request_done: version: 0, command: EC_CMD_USB_PD_DISCOVERY, ec result: EC_RES_SUCCESS, retval: 5
Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Diffstat (limited to 'drivers/platform/chrome/cros_ec_trace.h')
-rw-r--r-- | drivers/platform/chrome/cros_ec_trace.h | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/drivers/platform/chrome/cros_ec_trace.h b/drivers/platform/chrome/cros_ec_trace.h index 0dd4df30fa89..e9fb05f89ef0 100644 --- a/drivers/platform/chrome/cros_ec_trace.h +++ b/drivers/platform/chrome/cros_ec_trace.h @@ -18,7 +18,7 @@ #include <linux/tracepoint.h> -DECLARE_EVENT_CLASS(cros_ec_cmd_class, +TRACE_EVENT(cros_ec_request_start, TP_PROTO(struct cros_ec_command *cmd), TP_ARGS(cmd), TP_STRUCT__entry( @@ -33,10 +33,26 @@ DECLARE_EVENT_CLASS(cros_ec_cmd_class, __print_symbolic(__entry->command, EC_CMDS)) ); - -DEFINE_EVENT(cros_ec_cmd_class, cros_ec_cmd, - TP_PROTO(struct cros_ec_command *cmd), - TP_ARGS(cmd) +TRACE_EVENT(cros_ec_request_done, + TP_PROTO(struct cros_ec_command *cmd, int retval), + TP_ARGS(cmd, retval), + TP_STRUCT__entry( + __field(uint32_t, version) + __field(uint32_t, command) + __field(uint32_t, result) + __field(int, retval) + ), + TP_fast_assign( + __entry->version = cmd->version; + __entry->command = cmd->command; + __entry->result = cmd->result; + __entry->retval = retval; + ), + TP_printk("version: %u, command: %s, ec result: %s, retval: %d", + __entry->version, + __print_symbolic(__entry->command, EC_CMDS), + __print_symbolic(__entry->result, EC_RESULT), + __entry->retval) ); |