-
Notifications
You must be signed in to change notification settings - Fork 816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java method profiling saved in JFR format, no corresponding event found #868
Comments
seems rewrite in latest code void JNICALL Instrument::recordSample(JNIEnv* jni, jobject unused) {
if (!_enabled) return;
if (_interval <= 1 || ((atomicInc(_calls) + 1) % _interval) == 0) {
ExecutionEvent event;
Profiler::instance()->recordSample(NULL, _interval, INSTRUMENTED_METHOD, &event);
}
} void FlightRecorder::recordEvent(int lock_index, int tid, u32 call_trace_id,
EventType event_type, Event* event) {
if (_rec != NULL) {
Buffer* buf = _rec->buffer(lock_index);
switch (event_type) {
case PERF_SAMPLE:
case EXECUTION_SAMPLE:
case INSTRUMENTED_METHOD:
_rec->recordExecutionSample(buf, tid, call_trace_id, (ExecutionEvent*)event);
break;
case ALLOC_SAMPLE:
_rec->recordAllocationInNewTLAB(buf, tid, call_trace_id, (AllocEvent*)event);
break;
case ALLOC_OUTSIDE_TLAB:
_rec->recordAllocationOutsideTLAB(buf, tid, call_trace_id, (AllocEvent*)event);
break;
case LIVE_OBJECT:
_rec->recordLiveObject(buf, tid, call_trace_id, (LiveObject*)event);
break;
case LOCK_SAMPLE:
_rec->recordMonitorBlocked(buf, tid, call_trace_id, (LockEvent*)event);
break;
case PARK_SAMPLE:
_rec->recordThreadPark(buf, tid, call_trace_id, (LockEvent*)event);
break;
case PROFILING_WINDOW:
_rec->recordWindow(buf, tid, (ProfilingWindow*)event);
break;
}
_rec->flushIfNeeded(buf);
_rec->addThread(tid);
}
} |
Will this be backported? |
I verified that Java method profiling works fine with JFR with the
|
We typically maintain only the latest version of async-profiler. |
Alright, I got it, thank you. We will test the latest version. |
async profiler version
Java Method Profiling
jfr output
./profiler.sh -e java.lang.Thread.sleep -f p.jfr -d 120 51286
jfr summary:
no execution samples
html output
Native Method Profiling
since macos does not support perf, we use linux instead
jfr summary:
event content:
render into html:
simple dig
method instrumented
source code
event_type is BCI_INSTRUMENT
when record event, BCI_INSTRUMENT is ignored
Expection
java method profiling via instrument is recorded in jfr events
The text was updated successfully, but these errors were encountered: