From: "Michael S. Tsirkin" <mst@redhat.com>
To: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: qemu-devel@nongnu.org, "Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH] pci: add config space access traces
Date: Tue, 20 Aug 2013 18:27:02 +0300 [thread overview]
Message-ID: <20130820152702.GA25262@redhat.com> (raw)
In-Reply-To: <1376651448-19472-1-git-send-email-aik@ozlabs.ru>
On Fri, Aug 16, 2013 at 09:10:48PM +1000, Alexey Kardashevskiy wrote:
> This adds pci_cfg_read and pci_cfg_write traces for config spaces accesses.
>
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Looks good to me.
I think it would be useful to add device and function numbers
in trace.
Could you incorporate this please?
> ---
> 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
>
prev parent reply other threads:[~2013-08-20 15:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-16 11:10 [Qemu-devel] [PATCH] pci: add config space access traces Alexey Kardashevskiy
2013-08-20 15:27 ` Michael S. Tsirkin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130820152702.GA25262@redhat.com \
--to=mst@redhat.com \
--cc=afaerber@suse.de \
--cc=aik@ozlabs.ru \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.