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/bits.h>
15 #include <linux/types.h>
16 #include <linux/platform_data/cros_ec_commands.h>
17 #include <linux/platform_data/cros_ec_proto.h>
18 
19 #include <linux/tracepoint.h>
20 
21 DECLARE_EVENT_CLASS(cros_ec_cmd_class,
22 	TP_PROTO(struct cros_ec_command *cmd),
23 	TP_ARGS(cmd),
24 	TP_STRUCT__entry(
25 		__field(uint32_t, version)
26 		__field(uint32_t, command)
27 	),
28 	TP_fast_assign(
29 		__entry->version = cmd->version;
30 		__entry->command = cmd->command;
31 	),
32 	TP_printk("version: %u, command: %s", __entry->version,
33 		  __print_symbolic(__entry->command, EC_CMDS))
34 );
35 
36 
37 DEFINE_EVENT(cros_ec_cmd_class, cros_ec_cmd,
38 	TP_PROTO(struct cros_ec_command *cmd),
39 	TP_ARGS(cmd)
40 );
41 
42 
43 #endif /* _CROS_EC_TRACE_H_ */
44 
45 /* this part must be outside header guard */
46 
47 #undef TRACE_INCLUDE_PATH
48 #define TRACE_INCLUDE_PATH .
49 
50 #undef TRACE_INCLUDE_FILE
51 #define TRACE_INCLUDE_FILE cros_ec_trace
52 
53 #include <trace/define_trace.h>
54