aboutsummaryrefslogtreecommitdiff
path: root/hw/acpi/tco.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2017-10-12 15:54:08 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2017-10-16 18:03:52 +0200
commit6a24f34e5c0bf83c5a31015242c94185c95c2554 (patch)
tree0565158883793eb0b8dd8c64f7f683e023216d5c /hw/acpi/tco.c
parentb7ecba0f6f6427683b2dc609f4830535b9a271dd (diff)
tco: add trace events
Add trace events to the PCH watchdog timer, it can be useful to see how the guest is using it. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <1507816448-86665-1-git-send-email-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/acpi/tco.c')
-rw-r--r--hw/acpi/tco.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/hw/acpi/tco.c b/hw/acpi/tco.c
index 05b9d7ba36..a9143963ab 100644
--- a/hw/acpi/tco.c
+++ b/hw/acpi/tco.c
@@ -12,6 +12,7 @@
#include "hw/i386/ich9.h"
#include "hw/acpi/tco.h"
+#include "trace.h"
//#define DEBUG
@@ -41,8 +42,11 @@ enum {
static inline void tco_timer_reload(TCOIORegs *tr)
{
- tr->expire_time = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) +
- ((int64_t)(tr->tco.tmr & TCO_TMR_MASK) * TCO_TICK_NSEC);
+ int ticks = tr->tco.tmr & TCO_TMR_MASK;
+ int64_t nsec = (int64_t)ticks * TCO_TICK_NSEC;
+
+ trace_tco_timer_reload(ticks, nsec / 1000000);
+ tr->expire_time = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + nsec;
timer_mod(tr->tco_timer, tr->expire_time);
}
@@ -59,6 +63,9 @@ static void tco_timer_expired(void *opaque)
ICH9LPCState *lpc = container_of(pm, ICH9LPCState, pm);
uint32_t gcs = pci_get_long(lpc->chip_config + ICH9_CC_GCS);
+ trace_tco_timer_expired(tr->timeouts_no,
+ lpc->pin_strap.spkr_hi,
+ !!(gcs & ICH9_CC_GCS_NO_REBOOT));
tr->tco.rld = 0;
tr->tco.sts1 |= TCO_TIMEOUT;
if (++tr->timeouts_no == 2) {