[wasm] Add some more information to trace events

When tracing function compilations, do also trace the function index
and the function body size. This information often helps investigating
bottlenecks in compilation.

R=ahaas@chromium.org

Bug: v8:8916, chromium:950493
Change-Id: Ibabd1b59827b67ac9b0ef3a78f121ab8fb2c4e09
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1622111
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61701}
This commit is contained in:
Clemens Hammacher 2019-05-21 15:47:13 +02:00 committed by Commit Bot
parent 93ccfb74db
commit a031112eeb
4 changed files with 14 additions and 8 deletions

View File

@ -6450,8 +6450,10 @@ wasm::WasmCompilationResult ExecuteTurbofanWasmCompilation(
wasm::WasmEngine* wasm_engine, wasm::CompilationEnv* env,
const wasm::FunctionBody& func_body, int func_index, Counters* counters,
wasm::WasmFeatures* detected) {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.wasm"),
"ExecuteTurbofanCompilation");
TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("v8.wasm"),
"ExecuteTurbofanCompilation", "func_index", func_index,
"body_size",
static_cast<uint32_t>(func_body.end - func_body.start));
double decode_ms = 0;
size_t node_count = 0;

View File

@ -2051,10 +2051,13 @@ class LiftoffCompiler {
WasmCompilationResult ExecuteLiftoffCompilation(AccountingAllocator* allocator,
CompilationEnv* env,
const FunctionBody& func_body,
int func_index,
Counters* counters,
WasmFeatures* detected) {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.wasm"),
"ExecuteLiftoffCompilation");
TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("v8.wasm"),
"ExecuteLiftoffCompilation", "func_index", func_index,
"body_size",
static_cast<uint32_t>(func_body.end - func_body.start));
base::ElapsedTimer compile_timer;
if (FLAG_trace_wasm_decode_time) {
compile_timer.Start();

View File

@ -20,8 +20,8 @@ struct FunctionBody;
struct WasmFeatures;
WasmCompilationResult ExecuteLiftoffCompilation(
AccountingAllocator*, CompilationEnv*, const FunctionBody&, Counters*,
WasmFeatures* detected_features);
AccountingAllocator*, CompilationEnv*, const FunctionBody&, int func_index,
Counters*, WasmFeatures* detected_features);
} // namespace wasm
} // namespace internal

View File

@ -145,8 +145,9 @@ WasmCompilationResult WasmCompilationUnit::ExecuteCompilation(
if (V8_LIKELY(FLAG_wasm_tier_mask_for_testing == 0) ||
func_index_ >= 32 ||
((FLAG_wasm_tier_mask_for_testing & (1 << func_index_)) == 0)) {
result = ExecuteLiftoffCompilation(wasm_engine->allocator(), env,
func_body, counters, detected);
result =
ExecuteLiftoffCompilation(wasm_engine->allocator(), env, func_body,
func_index_, counters, detected);
if (result.succeeded()) break;
}