From nobody Sun May 5 10:38:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1554222157148485.66624378092854; Tue, 2 Apr 2019 09:22:37 -0700 (PDT) Received: from localhost ([127.0.0.1]:49049 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hBMBA-0001UP-23 for importer@patchew.org; Tue, 02 Apr 2019 12:22:28 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34616) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hBM7x-0007dH-Kl for qemu-devel@nongnu.org; Tue, 02 Apr 2019 12:19:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hBM7w-0006Yp-It for qemu-devel@nongnu.org; Tue, 02 Apr 2019 12:19:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37508) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hBM7w-0006YU-Af for qemu-devel@nongnu.org; Tue, 02 Apr 2019 12:19:08 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A0E33308338F; Tue, 2 Apr 2019 16:19:07 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-116.ams2.redhat.com [10.36.116.116]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 68A2DBA4D; Tue, 2 Apr 2019 16:19:02 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id E0EA21132BB6; Tue, 2 Apr 2019 18:19:00 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 2 Apr 2019 18:18:58 +0200 Message-Id: <20190402161900.7374-2-armbru@redhat.com> In-Reply-To: <20190402161900.7374-1-armbru@redhat.com> References: <20190402161900.7374-1-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Tue, 02 Apr 2019 16:19:07 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 1/3] acpi/piix4: Convert debug printf()s to 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: , Cc: imammedo@redhat.com, mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Markus Armbruster Reviewed-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/acpi/piix4.c | 14 +++----------- hw/acpi/trace-events | 4 ++++ 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 9c079d6834..546ba036ed 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -39,14 +39,7 @@ #include "hw/acpi/acpi_dev_interface.h" #include "hw/xen/xen.h" #include "qom/cpu.h" - -//#define DEBUG - -#ifdef DEBUG -# define PIIX4_DPRINTF(format, ...) printf(format, ## __VA_ARGS__) -#else -# define PIIX4_DPRINTF(format, ...) do { } while (0) -#endif +#include "trace.h" =20 #define GPE_BASE 0xafe0 #define GPE_LEN 4 @@ -596,7 +589,7 @@ static uint64_t gpe_readb(void *opaque, hwaddr addr, un= signed width) PIIX4PMState *s =3D opaque; uint32_t val =3D acpi_gpe_ioport_readb(&s->ar, addr); =20 - PIIX4_DPRINTF("gpe read %" HWADDR_PRIx " =3D=3D %" PRIu32 "\n", addr, = val); + trace_piix4_gpe_readb(addr, width, val); return val; } =20 @@ -605,10 +598,9 @@ static void gpe_writeb(void *opaque, hwaddr addr, uint= 64_t val, { PIIX4PMState *s =3D opaque; =20 + trace_piix4_gpe_writeb(addr, width, val); acpi_gpe_ioport_writeb(&s->ar, addr, val); acpi_update_sci(&s->ar, s->irq); - - PIIX4_DPRINTF("gpe write %" HWADDR_PRIx " <=3D=3D %" PRIu64 "\n", addr= , val); } =20 static const MemoryRegionOps piix4_gpe_ops =3D { diff --git a/hw/acpi/trace-events b/hw/acpi/trace-events index 6272d8a9e7..825b25cbb0 100644 --- a/hw/acpi/trace-events +++ b/hw/acpi/trace-events @@ -31,6 +31,10 @@ 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 =20 +# piix4.c +piix4_gpe_readb(uint64_t addr, unsigned width, uint64_t val) "addr: 0x%" P= RIx64 " width: %d =3D=3D> 0x%" PRIx64 +piix4_gpe_writeb(uint64_t addr, unsigned width, uint64_t val) "addr: 0x%" = PRIx64 " width: %d <=3D=3D 0x%" PRIx64 + # 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 2.17.2 From nobody Sun May 5 10:38:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1554222213650194.94022952174305; Tue, 2 Apr 2019 09:23:33 -0700 (PDT) Received: from localhost ([127.0.0.1]:49334 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hBMCA-0002Wc-Ni for importer@patchew.org; Tue, 02 Apr 2019 12:23:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34603) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hBM7w-0007aZ-Ko for qemu-devel@nongnu.org; Tue, 02 Apr 2019 12:19:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hBM7v-0006YQ-Jz for qemu-devel@nongnu.org; Tue, 02 Apr 2019 12:19:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39276) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hBM7v-0006Y0-Aq for qemu-devel@nongnu.org; Tue, 02 Apr 2019 12:19:07 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A22AF308FEC1; Tue, 2 Apr 2019 16:19:06 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-116.ams2.redhat.com [10.36.116.116]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6B6FC18E22; Tue, 2 Apr 2019 16:19:02 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id E4A2B1132BD3; Tue, 2 Apr 2019 18:19:00 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 2 Apr 2019 18:18:59 +0200 Message-Id: <20190402161900.7374-3-armbru@redhat.com> In-Reply-To: <20190402161900.7374-1-armbru@redhat.com> References: <20190402161900.7374-1-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Tue, 02 Apr 2019 16:19:06 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/3] acpi/pcihp: Convert debug printf()s to 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: , Cc: imammedo@redhat.com, mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Markus Armbruster Reviewed-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/acpi/pcihp.c | 25 ++++++++----------------- hw/acpi/trace-events | 9 +++++++++ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c index 88e4ae1bcd..7729c5338b 100644 --- a/hw/acpi/pcihp.c +++ b/hw/acpi/pcihp.c @@ -37,14 +37,7 @@ #include "hw/pci/pci_bus.h" #include "qapi/error.h" #include "qom/qom-qobject.h" - -//#define DEBUG - -#ifdef DEBUG -# define ACPI_PCIHP_DPRINTF(format, ...) printf(format, ## __VA_ARGS__) -#else -# define ACPI_PCIHP_DPRINTF(format, ...) do { } while (0) -#endif +#include "trace.h" =20 #define ACPI_PCIHP_ADDR 0xae00 #define ACPI_PCIHP_SIZE 0x0014 @@ -306,23 +299,23 @@ static uint64_t pci_read(void *opaque, hwaddr addr, u= nsigned int size) if (!s->legacy_piix) { s->acpi_pcihp_pci_status[bsel].up =3D 0; } - ACPI_PCIHP_DPRINTF("pci_up_read %" PRIu32 "\n", val); + trace_acpi_pci_up_read(val); break; case PCI_DOWN_BASE: val =3D s->acpi_pcihp_pci_status[bsel].down; - ACPI_PCIHP_DPRINTF("pci_down_read %" PRIu32 "\n", val); + trace_acpi_pci_down_read(val); break; case PCI_EJ_BASE: /* No feature defined yet */ - ACPI_PCIHP_DPRINTF("pci_features_read %" PRIu32 "\n", val); + trace_acpi_pci_features_read(val); break; case PCI_RMV_BASE: val =3D s->acpi_pcihp_pci_status[bsel].hotplug_enable; - ACPI_PCIHP_DPRINTF("pci_rmv_read %" PRIu32 "\n", val); + trace_acpi_pci_rmv_read(val); break; case PCI_SEL_BASE: val =3D s->hotplug_select; - ACPI_PCIHP_DPRINTF("pci_sel_read %" PRIu32 "\n", val); + trace_acpi_pci_sel_read(val); default: break; } @@ -340,13 +333,11 @@ static void pci_write(void *opaque, hwaddr addr, uint= 64_t data, break; } acpi_pcihp_eject_slot(s, s->hotplug_select, data); - ACPI_PCIHP_DPRINTF("pciej write %" HWADDR_PRIx " <=3D=3D %" PRIu64= "\n", - addr, data); + trace_acpi_pci_ej_write(addr, data); break; case PCI_SEL_BASE: s->hotplug_select =3D s->legacy_piix ? ACPI_PCIHP_BSEL_DEFAULT : d= ata; - ACPI_PCIHP_DPRINTF("pcisel write %" HWADDR_PRIx " <=3D=3D %" PRIu6= 4 "\n", - addr, data); + trace_acpi_pci_sel_write(addr, data); default: break; } diff --git a/hw/acpi/trace-events b/hw/acpi/trace-events index 825b25cbb0..98a56baa6f 100644 --- a/hw/acpi/trace-events +++ b/hw/acpi/trace-events @@ -31,6 +31,15 @@ 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 =20 +# pcihp.c +acpi_pci_up_read(uint32_t val) "%" PRIu32 +acpi_pci_down_read(uint32_t val) "%" PRIu32 +acpi_pci_features_read(uint32_t val) "%" PRIu32 +acpi_pci_rmv_read(uint32_t val) "%" PRIu32 +acpi_pci_sel_read(uint32_t val) "%" PRIu32 +acpi_pci_ej_write(uint64_t addr, uint64_t data) "0x%" PRIx64 " <=3D=3D %" = PRIu64 +acpi_pci_sel_write(uint64_t addr, uint64_t data) "0x%" PRIx64 " <=3D=3D %"= PRIu64 + # piix4.c piix4_gpe_readb(uint64_t addr, unsigned width, uint64_t val) "addr: 0x%" P= RIx64 " width: %d =3D=3D> 0x%" PRIx64 piix4_gpe_writeb(uint64_t addr, unsigned width, uint64_t val) "addr: 0x%" = PRIx64 " width: %d <=3D=3D 0x%" PRIx64 --=20 2.17.2 From nobody Sun May 5 10:38:44 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1554222313673629.1936048482178; Tue, 2 Apr 2019 09:25:13 -0700 (PDT) Received: from localhost ([127.0.0.1]:49849 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hBMDn-0003m7-Kn for importer@patchew.org; Tue, 02 Apr 2019 12:25:11 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34633) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hBM7y-0007eS-Ro for qemu-devel@nongnu.org; Tue, 02 Apr 2019 12:19:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hBM7x-0006Zj-SZ for qemu-devel@nongnu.org; Tue, 02 Apr 2019 12:19:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59554) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hBM7x-0006Z8-KD for qemu-devel@nongnu.org; Tue, 02 Apr 2019 12:19:09 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E2D6D368E7; Tue, 2 Apr 2019 16:19:08 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-116.ams2.redhat.com [10.36.116.116]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6B0FD1001DEE; Tue, 2 Apr 2019 16:19:03 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id E82401132B6C; Tue, 2 Apr 2019 18:19:00 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 2 Apr 2019 18:19:00 +0200 Message-Id: <20190402161900.7374-4-armbru@redhat.com> In-Reply-To: <20190402161900.7374-1-armbru@redhat.com> References: <20190402161900.7374-1-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 02 Apr 2019 16:19:08 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 3/3] acpi/pcihp: Add a few more trace points related to unplug 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: , Cc: imammedo@redhat.com, mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Markus Armbruster Reviewed-by: Igor Mammedov Reviewed-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/acpi/pcihp.c | 7 +++++++ hw/acpi/trace-events | 3 +++ 2 files changed, 10 insertions(+) diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c index 7729c5338b..613406d09b 100644 --- a/hw/acpi/pcihp.c +++ b/hw/acpi/pcihp.c @@ -152,6 +152,8 @@ static void acpi_pcihp_eject_slot(AcpiPciHpState *s, un= signed bsel, unsigned slo int slot =3D ctz32(slots); PCIBus *bus =3D acpi_pcihp_find_hotplug_bus(s, bsel); =20 + trace_acpi_pci_eject_slot(bsel, slot); + if (!bus) { return; } @@ -263,6 +265,8 @@ void acpi_pcihp_device_plug_cb(HotplugHandler *hotplug_= dev, AcpiPciHpState *s, void acpi_pcihp_device_unplug_cb(HotplugHandler *hotplug_dev, AcpiPciHpSta= te *s, DeviceState *dev, Error **errp) { + trace_acpi_pci_unplug(PCI_SLOT(PCI_DEVICE(dev)->devfn), + acpi_pcihp_get_bsel(pci_get_bus(PCI_DEVICE(dev))= )); object_property_set_bool(OBJECT(dev), false, "realized", NULL); } =20 @@ -273,6 +277,9 @@ void acpi_pcihp_device_unplug_request_cb(HotplugHandler= *hotplug_dev, PCIDevice *pdev =3D PCI_DEVICE(dev); int slot =3D PCI_SLOT(pdev->devfn); int bsel =3D acpi_pcihp_get_bsel(pci_get_bus(pdev)); + + trace_acpi_pci_unplug_request(bsel, slot); + if (bsel < 0) { error_setg(errp, "Unsupported bus. Bus doesn't have property '" ACPI_PCIHP_PROP_BSEL "' set"); diff --git a/hw/acpi/trace-events b/hw/acpi/trace-events index 98a56baa6f..96b8273297 100644 --- a/hw/acpi/trace-events +++ b/hw/acpi/trace-events @@ -32,6 +32,9 @@ cpuhp_acpi_write_ost_ev(uint32_t slot, uint32_t ev) "idx[= 0x%"PRIx32"] OST EVENT: cpuhp_acpi_write_ost_status(uint32_t slot, uint32_t st) "idx[0x%"PRIx32"] = OST STATUS: 0x%"PRIx32 =20 # pcihp.c +acpi_pci_eject_slot(unsigned bsel, unsigned slot) "bsel: %u slot: %u" +acpi_pci_unplug(int bsel, int slot) "bsel: %d slot: %d" +acpi_pci_unplug_request(int bsel, int slot) "bsel: %d slot: %d" acpi_pci_up_read(uint32_t val) "%" PRIu32 acpi_pci_down_read(uint32_t val) "%" PRIu32 acpi_pci_features_read(uint32_t val) "%" PRIu32 --=20 2.17.2