[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 03/41] hw/watchdog: add trace events for watchdog action handling
From: |
Michael S. Tsirkin |
Subject: |
[PULL 03/41] hw/watchdog: add trace events for watchdog action handling |
Date: |
Wed, 21 Dec 2022 08:04:21 -0500 |
From: Daniel P. Berrangé <berrange@redhat.com>
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>
---
hw/watchdog/watchdog.c | 4 ++++
hw/watchdog/trace-events | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/hw/watchdog/watchdog.c b/hw/watchdog/watchdog.c
index 6c082a3263..955046161b 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);
}
diff --git a/hw/watchdog/trace-events b/hw/watchdog/trace-events
index 89ccbcfdfd..54371ae075 100644
--- a/hw/watchdog/trace-events
+++ b/hw/watchdog/trace-events
@@ -16,3 +16,7 @@ spapr_watchdog_stop(uint64_t num, uint64_t ret) "num=%"
PRIu64 " ret=%" PRId64
spapr_watchdog_query(uint64_t caps) "caps=0x%" PRIx64
spapr_watchdog_query_lpm(uint64_t caps) "caps=0x%" PRIx64
spapr_watchdog_expired(uint64_t num, unsigned action) "num=%" PRIu64 "
action=%u"
+
+# watchdog.c
+watchdog_perform_action(unsigned int action) "action=%u"
+watchdog_set_action(unsigned int action) "action=%u"
--
MST
- [PULL 00/41] virtio,pc,pci: features, cleanups, fixes, Michael S. Tsirkin, 2022/12/21
- [PULL 01/41] hw/acpi: add trace events for TCO watchdog register access, Michael S. Tsirkin, 2022/12/21
- [PULL 02/41] hw/isa: add trace events for ICH9 LPC chip config access, Michael S. Tsirkin, 2022/12/21
- [PULL 03/41] hw/watchdog: add trace events for watchdog action handling,
Michael S. Tsirkin <=
- [PULL 04/41] hw: Add compat machines for 8.0, Michael S. Tsirkin, 2022/12/21
- [PULL 05/41] pc: clean up compat machines, Michael S. Tsirkin, 2022/12/21
- [PULL 06/41] hw/isa: enable TCO watchdog reboot pin strap by default, Michael S. Tsirkin, 2022/12/21
- [PULL 07/41] ich9: honour 'enable_tco' property, Michael S. Tsirkin, 2022/12/21
- [PULL 08/41] virtio: get class_id and pci device id by the virtio id, Michael S. Tsirkin, 2022/12/21
- [PULL 09/41] vdpa: add vdpa-dev support, Michael S. Tsirkin, 2022/12/21
- [PULL 12/41] vdpa: use v->shadow_vqs_enabled in vhost_vdpa_svqs_start & stop, Michael S. Tsirkin, 2022/12/21
- [PULL 11/41] vdpa-dev: mark the device as unmigratable, Michael S. Tsirkin, 2022/12/21
- [PULL 13/41] vhost: set SVQ device call handler at SVQ start, Michael S. Tsirkin, 2022/12/21
- [PULL 14/41] vhost: allocate SVQ device file descriptors at device start, Michael S. Tsirkin, 2022/12/21