Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'linux-watchdog-6.1-rc2' of git://www.linux-watchdog.org/linux-watchdog

Pull watchdog updates from Wim Van Sebroeck:

- Add tracing events for the most common watchdog events

* tag 'linux-watchdog-6.1-rc2' of git://www.linux-watchdog.org/linux-watchdog:
watchdog: Add tracing events for the most usual watchdog events

+81 -2
+1
MAINTAINERS
··· 22124 22124 F: drivers/watchdog/ 22125 22125 F: include/linux/watchdog.h 22126 22126 F: include/uapi/linux/watchdog.h 22127 + F: include/trace/events/watchdog.h 22127 22128 22128 22129 WHISKEYCOVE PMIC GPIO DRIVER 22129 22130 M: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
+4
drivers/watchdog/watchdog_core.c
··· 38 38 39 39 #include "watchdog_core.h" /* For watchdog_dev_register/... */ 40 40 41 + #define CREATE_TRACE_POINTS 42 + #include <trace/events/watchdog.h> 43 + 41 44 static DEFINE_IDA(watchdog_ida); 42 45 43 46 static int stop_on_reboot = -1; ··· 166 163 int ret; 167 164 168 165 ret = wdd->ops->stop(wdd); 166 + trace_watchdog_stop(wdd, ret); 169 167 if (ret) 170 168 return NOTIFY_BAD; 171 169 }
+10 -2
drivers/watchdog/watchdog_dev.c
··· 47 47 #include "watchdog_core.h" 48 48 #include "watchdog_pretimeout.h" 49 49 50 + #include <trace/events/watchdog.h> 51 + 50 52 /* the dev_t structure to store the dynamically allocated watchdog devices */ 51 53 static dev_t watchdog_devt; 52 54 /* Reference to watchdog device behind /dev/watchdog */ ··· 159 157 160 158 wd_data->last_hw_keepalive = now; 161 159 162 - if (wdd->ops->ping) 160 + if (wdd->ops->ping) { 163 161 err = wdd->ops->ping(wdd); /* ping the watchdog */ 164 - else 162 + trace_watchdog_ping(wdd, err); 163 + } else { 165 164 err = wdd->ops->start(wdd); /* restart watchdog */ 165 + trace_watchdog_start(wdd, err); 166 + } 166 167 167 168 if (err == 0) 168 169 watchdog_hrtimer_pretimeout_start(wdd); ··· 264 259 } 265 260 } else { 266 261 err = wdd->ops->start(wdd); 262 + trace_watchdog_start(wdd, err); 267 263 if (err == 0) { 268 264 set_bit(WDOG_ACTIVE, &wdd->status); 269 265 wd_data->last_keepalive = started_at; ··· 303 297 if (wdd->ops->stop) { 304 298 clear_bit(WDOG_HW_RUNNING, &wdd->status); 305 299 err = wdd->ops->stop(wdd); 300 + trace_watchdog_stop(wdd, err); 306 301 } else { 307 302 set_bit(WDOG_HW_RUNNING, &wdd->status); 308 303 } ··· 376 369 377 370 if (wdd->ops->set_timeout) { 378 371 err = wdd->ops->set_timeout(wdd, timeout); 372 + trace_watchdog_set_timeout(wdd, timeout, err); 379 373 } else { 380 374 wdd->timeout = timeout; 381 375 /* Disable pretimeout if it doesn't fit the new timeout */
+66
include/trace/events/watchdog.h
··· 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>