MCPcopy Index your code
hub / github.com/python/cpython / getStackAt

Method getStackAt

Doc/_static/profiling-sampling-visualization.js:182–202  ·  view source on GitHub ↗
(timestamp)

Source from the content-addressed store, hash-verified

180 }
181
182 getStackAt(timestamp) {
183 const stack = [];
184 const events = this.getEventsUntil(timestamp);
185
186 for (const event of events) {
187 if (event.type === "call") {
188 stack.push({
189 func: event.functionName,
190 line: event.lineno,
191 args: event.args,
192 });
193 } else if (event.type === "return") {
194 stack.pop();
195 } else if (event.type === "line") {
196 if (stack.length > 0) {
197 stack[stack.length - 1].line = event.lineno;
198 }
199 }
200 }
201 return stack;
202 }
203
204 getNextEvent(timestamp) {
205 return this.events.find((e) => e.timestamp > timestamp);

Callers 3

triggerSamplingEffectMethod · 0.80
_processEventMethod · 0.80
_rebuildStateMethod · 0.80

Calls 3

getEventsUntilMethod · 0.95
pushMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected