aboutsummaryrefslogtreecommitdiff
path: root/hw/pci/pci.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2023-02-11 16:22:39 +0100
committerMichael S. Tsirkin <mst@redhat.com>2023-03-02 19:13:52 -0500
commit28566eab2dd147f93735bc986513fff5fa5a236d (patch)
treeffe5da0ab62cb8f9b2e142db2cbb5cc16b50e236 /hw/pci/pci.c
parent9c1916057a8b14411116106e5a5c0c33d551cfeb (diff)
downloadqemu-28566eab2dd147f93735bc986513fff5fa5a236d.zip
qemu-28566eab2dd147f93735bc986513fff5fa5a236d.tar.gz
qemu-28566eab2dd147f93735bc986513fff5fa5a236d.tar.bz2
hw/pci: Trace IRQ routing on PCI topology
Trace how IRQ are rooted from EP to RC. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230211152239.88106-3-philmd@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/pci/pci.c')
-rw-r--r--hw/pci/pci.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index bad8e63..08060b3 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -279,9 +279,13 @@ static void pci_change_irq_level(PCIDevice *pci_dev, int irq_num, int change)
{
PCIBus *bus;
for (;;) {
+ int dev_irq = irq_num;
bus = pci_get_bus(pci_dev);
assert(bus->map_irq);
irq_num = bus->map_irq(pci_dev, irq_num);
+ trace_pci_route_irq(dev_irq, DEVICE(pci_dev)->canonical_path, irq_num,
+ pci_bus_is_root(bus) ? "root-complex"
+ : DEVICE(bus->parent_dev)->canonical_path);
if (bus->set_irq)
break;
pci_dev = bus->parent_dev;
@@ -1600,8 +1604,12 @@ PCIINTxRoute pci_device_route_intx_to_irq(PCIDevice *dev, int pin)
PCIBus *bus;
do {
+ int dev_irq = pin;
bus = pci_get_bus(dev);
pin = bus->map_irq(dev, pin);
+ trace_pci_route_irq(dev_irq, DEVICE(dev)->canonical_path, pin,
+ pci_bus_is_root(bus) ? "root-complex"
+ : DEVICE(bus->parent_dev)->canonical_path);
dev = bus->parent_dev;
} while (dev);