From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57286) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VAHvr-0007bq-Qi for qemu-devel@nongnu.org; Fri, 16 Aug 2013 07:11:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VAHvl-0001SK-B9 for qemu-devel@nongnu.org; Fri, 16 Aug 2013 07:11:03 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:51982) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VAHvl-0001SE-51 for qemu-devel@nongnu.org; Fri, 16 Aug 2013 07:10:57 -0400 Received: by mail-pa0-f46.google.com with SMTP id fa1so1760356pad.33 for ; Fri, 16 Aug 2013 04:10:56 -0700 (PDT) From: Alexey Kardashevskiy Date: Fri, 16 Aug 2013 21:10:48 +1000 Message-Id: <1376651448-19472-1-git-send-email-aik@ozlabs.ru> Subject: [Qemu-devel] [PATCH] pci: add config space access traces List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alexey Kardashevskiy , =?UTF-8?q?Andreas=20F=C3=A4rber?= , "Michael S . Tsirkin" This adds pci_cfg_read and pci_cfg_write traces for config spaces accesses. Signed-off-by: Alexey Kardashevskiy --- hw/pci/pci_host.c | 9 ++++++++- trace-events | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/hw/pci/pci_host.c b/hw/pci/pci_host.c index 7dd9b25..f1ba5ae 100644 --- a/hw/pci/pci_host.c +++ b/hw/pci/pci_host.c @@ -20,6 +20,7 @@ #include "hw/pci/pci.h" #include "hw/pci/pci_host.h" +#include "trace.h" /* debug PCI */ //#define DEBUG_PCI @@ -51,14 +52,20 @@ void pci_host_config_write_common(PCIDevice *pci_dev, uint32_t addr, uint32_t limit, uint32_t val, uint32_t len) { assert(len <= 4); + trace_pci_cfg_write(pci_dev->name, addr, val); pci_dev->config_write(pci_dev, addr, val, MIN(len, limit - addr)); } uint32_t pci_host_config_read_common(PCIDevice *pci_dev, uint32_t addr, uint32_t limit, uint32_t len) { + uint32_t ret; + assert(len <= 4); - return pci_dev->config_read(pci_dev, addr, MIN(len, limit - addr)); + ret = pci_dev->config_read(pci_dev, addr, MIN(len, limit - addr)); + trace_pci_cfg_read(pci_dev->name, addr, ret); + + return ret; } void pci_data_write(PCIBus *s, uint32_t addr, uint32_t val, int len) diff --git a/trace-events b/trace-events index 3856b5c..1f0ebf1 100644 --- a/trace-events +++ b/trace-events @@ -1176,3 +1176,7 @@ object_class_dynamic_cast_assert(const char *type, const char *target, const cha # hw/xen/xen_pvdevice.c xen_pv_mmio_read(uint64_t addr) "WARNING: read from Xen PV Device MMIO space (address %"PRIx64")" xen_pv_mmio_write(uint64_t addr) "WARNING: write to Xen PV Device MMIO space (address %"PRIx64")" + +# hw/pci/pci_host.c +pci_cfg_read(const char *dev, unsigned offs, unsigned val) "%s @0x%x 0x%x" +pci_cfg_write(const char *dev, unsigned offs, unsigned val) "%s @0x%x 0x%x" -- 1.8.3.2