Commit 85a5f5b6 authored by Danylo Boiko's avatar Danylo Boiko Committed by V8 LUCI CQ

[turbolizer] Presenting filename in the tab label

Bug: v8:7327
Change-Id: I7312ec4fb23bbf1c67fdf110de221105279bfa4a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3837859Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Danylo Boiko <danielboyko02@gmail.com>
Cr-Commit-Position: refs/heads/main@{#82566}
parent 5015c4ea
......@@ -232,15 +232,17 @@ std::unique_ptr<char[]> GetVisualizerLogFileName(OptimizedCompilationInfo* info,
const char* suffix) {
base::EmbeddedVector<char, 256> filename(0);
std::unique_ptr<char[]> debug_name = info->GetDebugName();
const char* file_prefix = FLAG_trace_turbo_file_prefix.value();
int optimization_id = info->IsOptimizing() ? info->optimization_id() : 0;
if (strlen(debug_name.get()) > 0) {
SNPrintF(filename, "turbo-%s-%i", debug_name.get(), optimization_id);
} else if (info->has_shared_info()) {
SNPrintF(filename, "turbo-%p-%i",
reinterpret_cast<void*>(info->shared_info()->address()),
SNPrintF(filename, "%s-%s-%i", file_prefix, debug_name.get(),
optimization_id);
} else if (info->has_shared_info()) {
SNPrintF(filename, "%s-%p-%i", file_prefix,
reinterpret_cast<void*>(info->shared_info()->address()),
optimization_id);
} else {
SNPrintF(filename, "turbo-none-%i", optimization_id);
SNPrintF(filename, "%s-none-%i", file_prefix, optimization_id);
}
base::EmbeddedVector<char, 256> source_file(0);
bool source_available = false;
......
......@@ -839,6 +839,8 @@ DEFINE_STRING(trace_turbo_filter, "*",
DEFINE_BOOL(trace_turbo_graph, false, "trace generated TurboFan graphs")
DEFINE_BOOL(trace_turbo_scheduled, false, "trace TurboFan IR with schedule")
DEFINE_IMPLICATION(trace_turbo_scheduled, trace_turbo_graph)
DEFINE_STRING(trace_turbo_file_prefix, "turbo",
"trace turbo graph to a file with given prefix")
DEFINE_STRING(trace_turbo_cfg_file, nullptr,
"trace turbo cfg graph (for C1 visualizer) to a given file name")
DEFINE_BOOL(trace_turbo_types, true, "trace TurboFan's types")
......
......@@ -144,6 +144,7 @@ window.onload = function () {
if (uploadFile) {
const fileReader = new FileReader();
fileReader.onload = () => {
document.title = uploadFile.name.replace(".json", "");
const txtRes = fileReader.result;
if (typeof txtRes === "string") {
loadFile(txtRes);
......
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