Commit 799a69d4 authored by Deepti Gandluri's avatar Deepti Gandluri Committed by Commit Bot

[wasm] Improve instrumentation for chrome://tracing

Currently, the tracing for background tasks is quite cryptic when
looking at chrome://tracing. Most tasks that are posted appear as
ThreadControllerImpl::RunTask, which when looking at other threads
can be deduced as compile tasks. Improve instrumentation to be more
indicative of the work being done.

BUG:v8:8423

Change-Id: I9b5469154ff7163d743efb1df998ca1df08cd4ce
Reviewed-on: https://chromium-review.googlesource.com/c/1330012
Commit-Queue: Deepti Gandluri <gdeepti@chromium.org>
Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57413}
parent cec00efa
......@@ -940,6 +940,8 @@ class BackgroundCompileTask : public CancelableTask {
void RunInternal() override {
TRACE_COMPILE("(3b) Compiling...\n");
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.wasm"),
"BackgroundCompileTask::RunInternal");
// The number of currently running background tasks is reduced in
// {OnBackgroundTaskStopped}.
CompilationEnv env = native_module_->CreateCompilationEnv();
......@@ -2561,6 +2563,8 @@ class AsyncCompileJob::DecodeModule : public AsyncCompileJob::CompileStep {
DisallowHeapAllocation no_allocation;
// Decode the module bytes.
TRACE_COMPILE("(1) Decoding module...\n");
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.wasm"),
"AsyncCompileJob::DecodeModule");
result = DecodeWasmModule(
job->enabled_features_, job->wire_bytes_.start(),
job->wire_bytes_.end(), false, kWasmOrigin, counters_,
......
......@@ -1044,6 +1044,7 @@ void WasmMemoryObject::RemoveInstance(Handle<WasmMemoryObject> memory,
int32_t WasmMemoryObject::Grow(Isolate* isolate,
Handle<WasmMemoryObject> memory_object,
uint32_t pages) {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.wasm"), "GrowMemory")
Handle<JSArrayBuffer> old_buffer(memory_object->array_buffer(), isolate);
if (!old_buffer->is_growable()) return -1;
size_t old_size = old_buffer->byte_length();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment