From nobody Sat Apr 20 10:30:51 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1507816827757784.6917490479568; Thu, 12 Oct 2017 07:00:27 -0700 (PDT) Received: from localhost ([::1]:45721 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2e2A-0004oN-UL for importer@patchew.org; Thu, 12 Oct 2017 10:00:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60081) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2dwI-0008Vn-KH for qemu-devel@nongnu.org; Thu, 12 Oct 2017 09:54:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2dwE-0005Mg-KE for qemu-devel@nongnu.org; Thu, 12 Oct 2017 09:54:18 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:34180) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e2dwE-0005M1-Cn for qemu-devel@nongnu.org; Thu, 12 Oct 2017 09:54:14 -0400 Received: by mail-wm0-x244.google.com with SMTP id l10so4042458wmg.1 for ; Thu, 12 Oct 2017 06:54:14 -0700 (PDT) Received: from 640k.lan (94-36-246-2.adsl-ull.clienti.tiscali.it. [94.36.246.2]) by smtp.gmail.com with ESMTPSA id s196sm333449wmb.26.2017.10.12.06.54.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Oct 2017 06:54:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id; bh=fNzg09VUMGyeXbZqBp84BCyxWg/Qh9SmnOlkCaB/Gv8=; b=Kww7JrL/KvKvIhTIXUUZAxpqCY0PHFwuL4vTVX9nNT3JX7B4uoKKFQPCsmkdHKEr+O TkXGzyc0Z9aWzL3mBkSIW+nm0XMdYBSbfPqLuMA/IGYEnF3bpD38JnCNya/4cun7Tav9 nlYjNfDaZLx4aFh8lOpiNd1AYvTDwN5CRRfGtGHXE3PYqdgFMIT/Np0ayIB6zPx7RHKq Cdkl4OoRfO9CJFds0DjhKtC+qtZPe9itSvYFVleCFcP3VUnGXEIrmqxmH1msS1CIoe0t Ls5ivICgCUYQb/bWJSGRp7hszywSOCyxGTbai7X2LU8MmqoxMlKSfpItMtPwvXxU1XF0 yyMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id; bh=fNzg09VUMGyeXbZqBp84BCyxWg/Qh9SmnOlkCaB/Gv8=; b=NWsEUb1PgGgZNtYQ/04XqTJ0jX66/HQn4Rk8gmLgHcwi8WkLGdRms00pWJKudo5Obe RnPu0AJKI4hdlBz3Ys/ckzqQlJqtns3HUzqCXM9CGPemFj0FeVEYgjRFaFxWR/A1snVk nBzmpkBCJCXbeFLCpF7qgbxk560DfQlZ8zvTG+Cg0Mpy8DplaS6fYP6L7AkJ51Z/AIlB bm5gEIt+0zbkprvieibGe5Wa3XuIkHvR+iUTlbpEofXadphCGiTFOtVpWPbpcRQ036Pj POeVjn3voPeArxv4hANNGFFBWGNpNB9l7Ua9NYyugCqJAg7tFRNCmXd1EmbF9sYXkkyx X95w== X-Gm-Message-State: AMCzsaWGTS1eEYP2j5yXw5NHiSWQwdXoY4m+3EBTy0fgLZpDz9Lhda7Y RRyNxZtEQFDbWPDA/KLGRiX19Cqj X-Google-Smtp-Source: AOwi7QCc70Tr41X1EPQ4XnIWKsV60JoApEiFslyAoIkXfV3HMtZuPBEhDXTE9fnev9MY8cmymPAYoA== X-Received: by 10.223.154.74 with SMTP id z68mr2122877wrb.36.1507816452836; Thu, 12 Oct 2017 06:54:12 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 12 Oct 2017 15:54:08 +0200 Message-Id: <1507816448-86665-1-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PATCH] tco: add trace events X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/acpi/tco.c | 11 +++++++++-- hw/acpi/trace-events | 4 ++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/hw/acpi/tco.c b/hw/acpi/tco.c index 05b9d7b..0032db4 100644 --- a/hw/acpi/tco.c +++ b/hw/acpi/tco.c @@ -12,6 +12,7 @@ #include "hw/i386/ich9.h" =20 #include "hw/acpi/tco.h" +#include "trace.h" =20 //#define DEBUG =20 @@ -41,8 +42,11 @@ enum { =20 static inline void tco_timer_reload(TCOIORegs *tr) { - tr->expire_time =3D qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + - ((int64_t)(tr->tco.tmr & TCO_TMR_MASK) * TCO_TICK_NSEC); + int ticks =3D tr->tco.tmr & TCO_TMR_MASK; + int64_t nsec =3D (int64_t)ticks * TCO_TICK_NSEC; + + trace_tco_timer_reload(ticks, nsec / 1000000); + tr->expire_time =3D qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + nsec; timer_mod(tr->tco_timer, tr->expire_time); } =20 @@ -59,6 +63,9 @@ static void tco_timer_expired(void *opaque) ICH9LPCState *lpc =3D container_of(pm, ICH9LPCState, pm); uint32_t gcs =3D pci_get_long(lpc->chip_config + ICH9_CC_GCS); =20 + trace_tco_timer_expired(tr->timeouts_no, + lpc->pin_strap.spkr_hi, + !!(gcs & ICH9_CC_GCS_NO_REBOOT)); tr->tco.rld =3D 0; tr->tco.sts1 |=3D TCO_TIMEOUT; if (++tr->timeouts_no =3D=3D 2) { diff --git a/hw/acpi/trace-events b/hw/acpi/trace-events index e3b41e9..df0024f 100644 --- a/hw/acpi/trace-events +++ b/hw/acpi/trace-events @@ -30,3 +30,7 @@ cpuhp_acpi_ejecting_invalid_cpu(uint32_t idx) "0x%"PRIx32 cpuhp_acpi_ejecting_cpu(uint32_t idx) "0x%"PRIx32 cpuhp_acpi_write_ost_ev(uint32_t slot, uint32_t ev) "idx[0x%"PRIx32"] OST = EVENT: 0x%"PRIx32 cpuhp_acpi_write_ost_status(uint32_t slot, uint32_t st) "idx[0x%"PRIx32"] = OST STATUS: 0x%"PRIx32 + +# hw/acpi/tco.c +tco_timer_reload(int ticks, int msec) "ticks=3D%d (%d ms)" +tco_timer_expired(int timeouts_no, bool strap, bool no_reboot) "timeouts_n= o=3D%d no_reboot=3D%d/%d" --=20 1.8.3.1