@@ -51,6 +51,7 @@ export type StackTiming = {|
51
51
start : Milliseconds [ ] ,
52
52
end : Milliseconds [ ] ,
53
53
callNode : IndexIntoCallNodeTable [ ] ,
54
+ argv : number [ ] ,
54
55
length : number ,
55
56
| } ;
56
57
@@ -76,6 +77,7 @@ export function getStackTimingByDepth(
76
77
start : [ ] ,
77
78
end : [ ] ,
78
79
callNode : [ ] ,
80
+ argv : [ ] ,
79
81
length : 0 ,
80
82
} ) ) ;
81
83
@@ -105,9 +107,14 @@ export function getStackTimingByDepth(
105
107
let deepestOpenBoxCallNodeIndex = - 1 ;
106
108
let deepestOpenBoxDepth = - 1 ;
107
109
const openBoxStartTimeByDepth = new Float64Array ( maxDepthPlusOne ) ;
110
+ const openBoxArgvByDepth = new Int32Array ( maxDepthPlusOne ) ;
108
111
109
112
for ( let sampleIndex = 0 ; sampleIndex < samples . length ; sampleIndex ++ ) {
110
113
const sampleTime = samples . time [ sampleIndex ] ;
114
+ let sampleArgv : number = - 1 ;
115
+ if ( samples . argv ) {
116
+ sampleArgv = samples . argv [ sampleIndex ] ;
117
+ }
111
118
const thisCallNodeIndex = sampleCallNodes [ sampleIndex ] ?? - 1 ;
112
119
if ( thisCallNodeIndex === deepestOpenBoxCallNodeIndex ) {
113
120
continue ;
@@ -134,10 +141,12 @@ export function getStackTimingByDepth(
134
141
// deepestOpenBoxCallNodeIndex is *not* an ancestors of thisCallNodeIndex.
135
142
// Commit this box.
136
143
const start = openBoxStartTimeByDepth [ deepestOpenBoxDepth ] ;
144
+ const argv = openBoxArgvByDepth [ deepestOpenBoxDepth ] ;
137
145
const stackTimingForThisDepth = stackTimingByDepth [ deepestOpenBoxDepth ] ;
138
146
const index = stackTimingForThisDepth . length ++ ;
139
147
stackTimingForThisDepth . start [ index ] = start ;
140
148
stackTimingForThisDepth . end [ index ] = sampleTime ;
149
+ stackTimingForThisDepth . argv [ index ] = argv ;
141
150
stackTimingForThisDepth . callNode [ index ] = deepestOpenBoxCallNodeIndex ;
142
151
deepestOpenBoxCallNodeIndex =
143
152
callNodeTablePrefixColumn [ deepestOpenBoxCallNodeIndex ] ;
@@ -153,6 +162,7 @@ export function getStackTimingByDepth(
153
162
while ( deepestOpenBoxDepth < thisCallNodeDepth ) {
154
163
deepestOpenBoxDepth ++ ;
155
164
openBoxStartTimeByDepth [ deepestOpenBoxDepth ] = sampleTime ;
165
+ openBoxArgvByDepth [ deepestOpenBoxDepth ] = sampleArgv ;
156
166
}
157
167
}
158
168
@@ -166,8 +176,10 @@ export function getStackTimingByDepth(
166
176
const stackTimingForThisDepth = stackTimingByDepth [ deepestOpenBoxDepth ] ;
167
177
const index = stackTimingForThisDepth . length ++ ;
168
178
const start = openBoxStartTimeByDepth [ deepestOpenBoxDepth ] ;
179
+ const argv = openBoxArgvByDepth [ deepestOpenBoxDepth ] ;
169
180
stackTimingForThisDepth . start [ index ] = start ;
170
181
stackTimingForThisDepth . end [ index ] = endTime ;
182
+ stackTimingForThisDepth . argv [ index ] = argv ;
171
183
stackTimingForThisDepth . callNode [ index ] = deepestOpenBoxCallNodeIndex ;
172
184
deepestOpenBoxCallNodeIndex =
173
185
callNodeTablePrefixColumn [ deepestOpenBoxCallNodeIndex ] ;
0 commit comments