File tree 1 file changed +32
-0
lines changed
1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 4
4
*
5
5
* USAGE: sudo eptfault.d -p <pid of hyperkit>
6
6
* sudo eptfault.d -D TOTAL -p <pid of hyperkit>
7
+ * sudo eptfault.d -D INTERVAL=1 -p <pid of hyperkit>
8
+ *
9
+ * If '-D INTERVAL=<seconds>' is specified periodically print a
10
+ * summary of EPT Faults per vCPU.
7
11
*
8
12
* It seems that tracing starts before the end of dtrace:::BEGIN, i.e.
9
13
* before the 'lapic_map' array is fully initialised. This results in
@@ -91,6 +95,12 @@ dtrace:::BEGIN
91
95
lapic_map [0x3F0 ] = "SELF_IPI" ;
92
96
93
97
printf ("Tracing... Hit Ctrl-C to end.\n" );
98
+
99
+ #ifdef INTERVAL
100
+ secs = INTERVAL ;
101
+ printf ("\n\n" );
102
+ printf ("Per CPU VM Exits\n" );
103
+ #endif
94
104
}
95
105
96
106
hyperkit$target :::vmx - ept - fault
@@ -108,9 +118,31 @@ hyperkit$target:::vmx-ept-fault
108
118
109
119
hyperkit$target :::vmx - ept - fault
110
120
{
121
+ #ifdef INTERVAL
122
+ /* Per vCPU count for periodic reporting */
123
+ @total [arg0 ] = count ();
124
+ #endif
125
+
111
126
@all_faults [arg1 , arg0 ] = count ();
112
127
}
113
128
129
+ #ifdef INTERVAL
130
+ /* timer */
131
+ profile :::tick - 1 sec
132
+ {
133
+ secs -- ;
134
+ }
135
+
136
+ /* Periodically print per vCPU VM Exits */
137
+ profile :::tick - 1 sec
138
+ /secs == 0 /
139
+ {
140
+ printa (@total );
141
+ clear (@total );
142
+ secs = INTERVAL ;
143
+ }
144
+ #endif
145
+
114
146
dtrace :::END
115
147
{
116
148
#ifdef TOTAL
You can’t perform that action at this time.
0 commit comments