xref: /openbmc/linux/include/trace/events/watchdog.h (revision 26b32974)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 #undef TRACE_SYSTEM
3 #define TRACE_SYSTEM watchdog
4 
5 #if !defined(_TRACE_WATCHDOG_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define _TRACE_WATCHDOG_H
7 
8 #include <linux/watchdog.h>
9 #include <linux/tracepoint.h>
10 
11 DECLARE_EVENT_CLASS(watchdog_template,
12 
13 	TP_PROTO(struct watchdog_device *wdd, int err),
14 
15 	TP_ARGS(wdd, err),
16 
17 	TP_STRUCT__entry(
18 		__field(int, id)
19 		__field(int, err)
20 	),
21 
22 	TP_fast_assign(
23 		__entry->id = wdd->id;
24 		__entry->err = err;
25 	),
26 
27 	TP_printk("watchdog%d err=%d", __entry->id, __entry->err)
28 );
29 
30 DEFINE_EVENT(watchdog_template, watchdog_start,
31 	TP_PROTO(struct watchdog_device *wdd, int err),
32 	TP_ARGS(wdd, err));
33 
34 DEFINE_EVENT(watchdog_template, watchdog_ping,
35 	TP_PROTO(struct watchdog_device *wdd, int err),
36 	TP_ARGS(wdd, err));
37 
38 DEFINE_EVENT(watchdog_template, watchdog_stop,
39 	TP_PROTO(struct watchdog_device *wdd, int err),
40 	TP_ARGS(wdd, err));
41 
42 TRACE_EVENT(watchdog_set_timeout,
43 
44 	TP_PROTO(struct watchdog_device *wdd, unsigned int timeout, int err),
45 
46 	TP_ARGS(wdd, timeout, err),
47 
48 	TP_STRUCT__entry(
49 		__field(int, id)
50 		__field(unsigned int, timeout)
51 		__field(int, err)
52 	),
53 
54 	TP_fast_assign(
55 		__entry->id = wdd->id;
56 		__entry->timeout = timeout;
57 		__entry->err = err;
58 	),
59 
60 	TP_printk("watchdog%d timeout=%u err=%d", __entry->id, __entry->timeout, __entry->err)
61 );
62 
63 #endif /* !defined(_TRACE_WATCHDOG_H) || defined(TRACE_HEADER_MULTI_READ) */
64 
65 /* This part must be outside protection */
66 #include <trace/define_trace.h>
67