1 | /* $Id: int-1.d 40925 2012-04-14 17:04:18Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * DTracing VBox - Interrupt Experiment #1.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2012 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #pragma D option quiet
|
---|
19 |
|
---|
20 | uint64_t g_aStarts[uint32_t];
|
---|
21 | unsigned int g_cHits;
|
---|
22 |
|
---|
23 | vboxvmm*:::pdm-irq-high,vboxvmm*:::pdm-irq-hilo
|
---|
24 | /args[1] != 0/
|
---|
25 | {
|
---|
26 | /*printf("high: tag=%#x src=%d %llx -> %llx\n", args[1], args[2], g_aStarts[args[1]], timestamp);*/
|
---|
27 | g_aStarts[args[1]] = timestamp;
|
---|
28 | }
|
---|
29 |
|
---|
30 | vboxvmm*:::pdm-irq-get
|
---|
31 | /g_aStarts[args[1]] > 0 && args[1] != 0/
|
---|
32 | {
|
---|
33 | @interrupts[args[3], args[2]] = count();
|
---|
34 | /*printf("get: tag=%#x src=%d %llx - %llx = %llx\n", args[1], args[2], timestamp, g_aStarts[args[1]], timestamp - g_aStarts[args[1]]);*/
|
---|
35 | @dispavg[args[3], args[2]] = avg(timestamp - g_aStarts[args[1]]);
|
---|
36 | @dispmax[args[3], args[2]] = max(timestamp - g_aStarts[args[1]]);
|
---|
37 | @dispmin[args[3], args[2]] = min(timestamp - g_aStarts[args[1]]);
|
---|
38 | g_aStarts[args[1]] = 0;
|
---|
39 | g_cHits++;
|
---|
40 | }
|
---|
41 |
|
---|
42 | vboxvmm*:::pdm-irq-get
|
---|
43 | /g_cHits >= 512/
|
---|
44 | {
|
---|
45 | exit(0);
|
---|
46 | }
|
---|
47 |
|
---|
48 |
|
---|
49 | END
|
---|
50 | {
|
---|
51 | printf("\nInterrupt distribution:");
|
---|
52 | printa(@interrupts);
|
---|
53 | printf("Average dispatch latency:");
|
---|
54 | printa(@dispavg);
|
---|
55 | printf("Minimax dispatch latency:");
|
---|
56 | printa(@dispmin);
|
---|
57 | printf("Maximum dispatch latency:");
|
---|
58 | printa(@dispmax);
|
---|
59 | }
|
---|