1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* 3 * Trace events for the ChromeOS Embedded Controller 4 * 5 * Copyright 2019 Google LLC. 6 */ 7 8 #undef TRACE_SYSTEM 9 #define TRACE_SYSTEM cros_ec 10 11 #if !defined(_CROS_EC_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ) 12 #define _CROS_EC_TRACE_H_ 13 14 #include <linux/types.h> 15 #include <linux/mfd/cros_ec.h> 16 17 #include <linux/tracepoint.h> 18 19 DECLARE_EVENT_CLASS(cros_ec_cmd_class, 20 TP_PROTO(struct cros_ec_command *cmd), 21 TP_ARGS(cmd), 22 TP_STRUCT__entry( 23 __field(uint32_t, version) 24 __field(uint32_t, command) 25 ), 26 TP_fast_assign( 27 __entry->version = cmd->version; 28 __entry->command = cmd->command; 29 ), 30 TP_printk("version: %u, command: %s", __entry->version, 31 __print_symbolic(__entry->command, EC_CMDS)) 32 ); 33 34 35 DEFINE_EVENT(cros_ec_cmd_class, cros_ec_cmd, 36 TP_PROTO(struct cros_ec_command *cmd), 37 TP_ARGS(cmd) 38 ); 39 40 41 #endif /* _CROS_EC_TRACE_H_ */ 42 43 /* this part must be outside header guard */ 44 45 #undef TRACE_INCLUDE_PATH 46 #define TRACE_INCLUDE_PATH . 47 48 #undef TRACE_INCLUDE_FILE 49 #define TRACE_INCLUDE_FILE cros_ec_trace 50 51 #include <trace/define_trace.h> 52