b4d35dedda4bab414ab7dbd94dde4587bd8168e7vboxsync * DTracing VBox - Interrupt Experiment #1.
b4d35dedda4bab414ab7dbd94dde4587bd8168e7vboxsync * Copyright (C) 2012 Oracle Corporation
b4d35dedda4bab414ab7dbd94dde4587bd8168e7vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
b4d35dedda4bab414ab7dbd94dde4587bd8168e7vboxsync * available from http://www.virtualbox.org. This file is free software;
b4d35dedda4bab414ab7dbd94dde4587bd8168e7vboxsync * you can redistribute it and/or modify it under the terms of the GNU
b4d35dedda4bab414ab7dbd94dde4587bd8168e7vboxsync * General Public License (GPL) as published by the Free Software
b4d35dedda4bab414ab7dbd94dde4587bd8168e7vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
b4d35dedda4bab414ab7dbd94dde4587bd8168e7vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
b4d35dedda4bab414ab7dbd94dde4587bd8168e7vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
5f0b2a477f40177194bff6d34581ae1382a3ea33vboxsync * Timestamp the when the device raises the IRQ.
13080fa6a2040179c8c24cee6d48c4c8d08686f7vboxsync /*printf("high: tag=%#x src=%d %llx -> %llx\n", args[1], args[2], g_aStarts[args[1]], timestamp);*/
5f0b2a477f40177194bff6d34581ae1382a3ea33vboxsync * Catch the CPU getting the IRQ from the (A)PIC and preparing for injection.
5f0b2a477f40177194bff6d34581ae1382a3ea33vboxsync printf("get: tag=%#x src=%d %llx - %llx = %llx\n", args[1], args[2], timestamp, g_aStarts[args[1]], timestamp - g_aStarts[args[1]]);
5f0b2a477f40177194bff6d34581ae1382a3ea33vboxsync @g_MissedHighs[args[3], args[2] & kfDevIdMask] = count();
13080fa6a2040179c8c24cee6d48c4c8d08686f7vboxsync /*printf("get: tag=%#x src=%d %llx - %llx = %llx\n", args[1], args[2], timestamp, g_aStarts[args[1]], timestamp - g_aStarts[args[1]]);*/
5f0b2a477f40177194bff6d34581ae1382a3ea33vboxsync @g_Interrupts[args[3], args[2] & kfDevIdMask] = count();
5f0b2a477f40177194bff6d34581ae1382a3ea33vboxsync @g_DispAvg[ args[3], args[2] & kfDevIdMask] = avg(timestamp - g_aStarts[args[1]]);
5f0b2a477f40177194bff6d34581ae1382a3ea33vboxsync @g_DispMax[ args[3], args[2] & kfDevIdMask] = max(timestamp - g_aStarts[args[1]]);
5f0b2a477f40177194bff6d34581ae1382a3ea33vboxsync @g_DispMin[ args[3], args[2] & kfDevIdMask] = min(timestamp - g_aStarts[args[1]]);
5f0b2a477f40177194bff6d34581ae1382a3ea33vboxsync @g_Shared[args[3], args[2] & kfDevIdMask] = count();
5f0b2a477f40177194bff6d34581ae1382a3ea33vboxsync/* For the time being, quit after 256 interrupts. */
5f0b2a477f40177194bff6d34581ae1382a3ea33vboxsync * Catch the device clearing the IRQ.
5f0b2a477f40177194bff6d34581ae1382a3ea33vboxsync printf("Interrupt sharing (devices detect pushing a line high at the same time):\n");
5f0b2a477f40177194bff6d34581ae1382a3ea33vboxsync printf("Missed (or shared?) highs: %u\n", g_cMissedHighs);
5f0b2a477f40177194bff6d34581ae1382a3ea33vboxsync printa(" irq %3d dev %2d %@12u\n", @g_MissedHighs);