Skip to content

Commit

Permalink
rust: use a different METHOD_LOAD event (#105)
Browse files Browse the repository at this point in the history
Previously, the Rust bindings used the
`iJVM_EVENT_TYPE_METHOD_INLINE_LOAD_FINISHED` event to notify VTune of
new JIT code. This may not be correct: it is unclear from the
documentation, but an "inline JIT-compiled method" sounds more like
self-modifying code, not typically what we think of with JIT-compiled
code. JIT-compiled as used elsewhere (e.g., Wasmtime) is emitted in a
memory allocation that is separate from the runtime binary code region.
This change uses the `iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED` event
instead.
  • Loading branch information
abrown authored Oct 23, 2023
1 parent 19cf9b7 commit f342766
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rust/ittapi/src/jit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ impl EventType {
fn tag(&self) -> ittapi_sys::iJIT_jvm_event {
match self {
EventType::MethodLoadFinished(_) => {
ittapi_sys::iJIT_jvm_event_iJVM_EVENT_TYPE_METHOD_INLINE_LOAD_FINISHED
ittapi_sys::iJIT_jvm_event_iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED
}
EventType::Shutdown => ittapi_sys::iJIT_jvm_event_iJVM_EVENT_TYPE_SHUTDOWN,
}
Expand Down

0 comments on commit f342766

Please sign in to comment.