From f34276629aa592c3fadadce611079a25c526b893 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Mon, 23 Oct 2023 10:41:42 -0700 Subject: [PATCH] rust: use a different `METHOD_LOAD` event (#105) 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. --- rust/ittapi/src/jit.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/ittapi/src/jit.rs b/rust/ittapi/src/jit.rs index b7113ab..685dae2 100644 --- a/rust/ittapi/src/jit.rs +++ b/rust/ittapi/src/jit.rs @@ -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, }