xref: /linux/include/trace/events/gpio.h (revision ef69f8d2ff09518657c3ecaf2db8408c16549829)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #undef TRACE_SYSTEM
3 #define TRACE_SYSTEM gpio
4 
5 #ifndef CONFIG_TRACING_EVENTS_GPIO
6 #define NOTRACE
7 #endif
8 
9 #if !defined(_TRACE_GPIO_H) || defined(TRACE_HEADER_MULTI_READ)
10 #define _TRACE_GPIO_H
11 
12 #include <linux/tracepoint.h>
13 
14 TRACE_EVENT(gpio_direction,
15 
16 	TP_PROTO(unsigned gpio, int in, int err),
17 
18 	TP_ARGS(gpio, in, err),
19 
20 	TP_STRUCT__entry(
21 		__field(unsigned, gpio)
22 		__field(int, in)
23 		__field(int, err)
24 	),
25 
26 	TP_fast_assign(
27 		__entry->gpio = gpio;
28 		__entry->in = in;
29 		__entry->err = err;
30 	),
31 
32 	TP_printk("%u %3s (%d)", __entry->gpio,
33 		__entry->in ? "in" : "out", __entry->err)
34 );
35 
36 TRACE_EVENT(gpio_value,
37 
38 	TP_PROTO(unsigned gpio, int get, int value),
39 
40 	TP_ARGS(gpio, get, value),
41 
42 	TP_STRUCT__entry(
43 		__field(unsigned, gpio)
44 		__field(int, get)
45 		__field(int, value)
46 	),
47 
48 	TP_fast_assign(
49 		__entry->gpio = gpio;
50 		__entry->get = get;
51 		__entry->value = value;
52 	),
53 
54 	TP_printk("%u %3s %d", __entry->gpio,
55 		__entry->get ? "get" : "set", __entry->value)
56 );
57 
58 #endif /* if !defined(_TRACE_GPIO_H) || defined(TRACE_HEADER_MULTI_READ) */
59 
60 /* This part must be outside protection */
61 #include <trace/define_trace.h>
62