Fix vtune logging for WASM

Vtune logging for WASM can't work after
https://chromium-review.googlesource.com/c/v8/v8/+/1602700.
This CL adds detection for logger()->is_listening_to_code_events() which is true
with jit_logger_ set under ENABLE_VTUNE_JIT_INTERFACE, because
code_event_dispatcher()->IsListeningToCodeEvents() remains false with
jit_logger_.
Contributed by yolanda.chen@intel.com

Change-Id: I1e6e67345ffbbe30fbf5faa0e344c34e606ec81f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1692484
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Jing Bao <jing.bao@intel.com>
Cr-Commit-Position: refs/heads/master@{#62620}
This commit is contained in:
jing.bao 2019-07-09 16:44:33 +08:00 committed by Commit Bot
parent 2269913232
commit e19b3778f9

View File

@ -150,7 +150,8 @@ bool WasmCode::ShouldBeLogged(Isolate* isolate) {
// The return value is cached in {WasmEngine::IsolateData::log_codes}. Ensure
// to call {WasmEngine::EnableCodeLogging} if this return value would change
// for any isolate. Otherwise we might lose code events.
return isolate->code_event_dispatcher()->IsListeningToCodeEvents() ||
return isolate->logger()->is_listening_to_code_events() ||
isolate->code_event_dispatcher()->IsListeningToCodeEvents() ||
isolate->is_profiling();
}