aboutsummaryrefslogtreecommitdiff
path: root/hw/watchdog/watchdog.c
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2022-12-16 07:57:47 -0500
committerMichael S. Tsirkin <mst@redhat.com>2022-12-21 06:35:28 -0500
commit6f10a29e760afa42775ce4c016f33b95e9128bd0 (patch)
tree21dde00c610143717cdd8f86951ccc3b6cde8ec7 /hw/watchdog/watchdog.c
parentc8c7c406db49a8bdf6b9e0962c4ec66a25ca1e5d (diff)
downloadqemu-6f10a29e760afa42775ce4c016f33b95e9128bd0.zip
qemu-6f10a29e760afa42775ce4c016f33b95e9128bd0.tar.gz
qemu-6f10a29e760afa42775ce4c016f33b95e9128bd0.tar.bz2
hw/watchdog: add trace events for watchdog action handling
The tracepoints aid in debugging the triggering of watchdog devices. Reviewed-by: Richard W.M. Jones <rjones@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20221216125749.596075-4-berrange@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/watchdog/watchdog.c')
-rw-r--r--hw/watchdog/watchdog.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/watchdog/watchdog.c b/hw/watchdog/watchdog.c
index 6c082a3..9550461 100644
--- a/hw/watchdog/watchdog.c
+++ b/hw/watchdog/watchdog.c
@@ -30,6 +30,7 @@
#include "sysemu/watchdog.h"
#include "hw/nmi.h"
#include "qemu/help_option.h"
+#include "trace.h"
static WatchdogAction watchdog_action = WATCHDOG_ACTION_RESET;
@@ -43,6 +44,8 @@ WatchdogAction get_watchdog_action(void)
*/
void watchdog_perform_action(void)
{
+ trace_watchdog_perform_action(watchdog_action);
+
switch (watchdog_action) {
case WATCHDOG_ACTION_RESET: /* same as 'system_reset' in monitor */
qapi_event_send_watchdog(WATCHDOG_ACTION_RESET);
@@ -89,4 +92,5 @@ void watchdog_perform_action(void)
void qmp_watchdog_set_action(WatchdogAction action, Error **errp)
{
watchdog_action = action;
+ trace_watchdog_set_action(watchdog_action);
}