|
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 */ |
@@ -157,10 +159,13 @@ static int __watchdog_ping(struct watchdog_device *wdd) |
157 | 159 |
|
158 | 160 | wd_data->last_hw_keepalive = now; |
159 | 161 |
|
160 | | - if (wdd->ops->ping) |
| 162 | + if (wdd->ops->ping) { |
161 | 163 | err = wdd->ops->ping(wdd); /* ping the watchdog */ |
162 | | - else |
| 164 | + trace_watchdog_ping(wdd, err); |
| 165 | + } else { |
163 | 166 | err = wdd->ops->start(wdd); /* restart watchdog */ |
| 167 | + trace_watchdog_start(wdd, err); |
| 168 | + } |
164 | 169 |
|
165 | 170 | if (err == 0) |
166 | 171 | watchdog_hrtimer_pretimeout_start(wdd); |
@@ -259,6 +264,7 @@ static int watchdog_start(struct watchdog_device *wdd) |
259 | 264 | } |
260 | 265 | } else { |
261 | 266 | err = wdd->ops->start(wdd); |
| 267 | + trace_watchdog_start(wdd, err); |
262 | 268 | if (err == 0) { |
263 | 269 | set_bit(WDOG_ACTIVE, &wdd->status); |
264 | 270 | wd_data->last_keepalive = started_at; |
@@ -297,6 +303,7 @@ static int watchdog_stop(struct watchdog_device *wdd) |
297 | 303 | if (wdd->ops->stop) { |
298 | 304 | clear_bit(WDOG_HW_RUNNING, &wdd->status); |
299 | 305 | err = wdd->ops->stop(wdd); |
| 306 | + trace_watchdog_stop(wdd, err); |
300 | 307 | } else { |
301 | 308 | set_bit(WDOG_HW_RUNNING, &wdd->status); |
302 | 309 | } |
@@ -369,6 +376,7 @@ static int watchdog_set_timeout(struct watchdog_device *wdd, |
369 | 376 |
|
370 | 377 | if (wdd->ops->set_timeout) { |
371 | 378 | err = wdd->ops->set_timeout(wdd, timeout); |
| 379 | + trace_watchdog_set_timeout(wdd, timeout, err); |
372 | 380 | } else { |
373 | 381 | wdd->timeout = timeout; |
374 | 382 | /* Disable pretimeout if it doesn't fit the new timeout */ |
|
0 commit comments