MCPcopy Create free account
hub / github.com/async-profiler/async-profiler / getJavaTraceJvmti

Method getJavaTraceJvmti

src/profiler.cpp:377–390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

375}
376
377int Profiler::getJavaTraceJvmti(jvmtiFrameInfo* jvmti_frames, ASGCT_CallFrame* frames, int start_depth, int max_depth) {
378 int num_frames = 0;
379 if (VM::jvmti()->GetStackTrace(NULL, start_depth, max_depth, jvmti_frames, &num_frames) == 0 && num_frames > 0) {
380 // Convert to AsyncGetCallTrace format.
381 // Note: jvmti_frames and frames may overlap.
382 for (int i = 0; i < num_frames; i++) {
383 jint bci = jvmti_frames[i].location;
384 frames[i].method_id = jvmti_frames[i].method;
385 frames[i].bci = bci;
386 LP64_ONLY(frames[i].padding = 0;)
387 }
388 }
389 return num_frames;
390}
391
392u64 Profiler::recordSample(void* ucontext, u64 counter, EventType event_type, Event* event) {
393 atomicInc(_total_samples);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected