Commit 9480ea44 authored by mattloring's avatar mattloring Committed by Commit bot

Reland of Include file names in trace_turbo output (patchset #1 id:1 of...

Reland of Include file names in trace_turbo output (patchset #1 id:1 of https://codereview.chromium.org/2083153004/ )

Reason for revert:
Ready to test fix and reland.

Original issue's description:
> Revert of Include file names in trace_turbo output (patchset #3 id:40001 of https://codereview.chromium.org/2083863004/ )
>
> Reason for revert:
> Many build bots are failing with a message of the form:
>
> Missing or invalid v8 JSON file: /tmp/tmp2qcEUy_swarming/0/output.json
>
> Can be relanded once we understand why these failures are occuring.
>
> Original issue's description:
> > Include file names in trace_turbo output
> >
> > The trace turbo output will overwrite itself when functions in different
> > files share the same name. Output files now have the form
> > `turbo-<function_name>:<opt_file_name>-<opt_phase>.suffix`.
> >
> > R=ofrobots@google.com
> > BUG=
> >
> > Committed: https://crrev.com/a53b9bf02f31e5647c37e0392afa19f74df1a3ba
> > Cr-Commit-Position: refs/heads/master@{#37199}
>
> TBR=ofrobots@google.com,bmeurer@chromium.org,danno@chromium.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=
>
> Committed: https://crrev.com/97c2bc362f234bd58515a0faf6af23b4f8ad183a
> Cr-Commit-Position: refs/heads/master@{#37204}

TBR=ofrobots@google.com,bmeurer@chromium.org,danno@chromium.org,machenbach@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

Review-Url: https://codereview.chromium.org/2081323007
Cr-Commit-Position: refs/heads/master@{#37303}
parent 4efd20ab
...@@ -36,14 +36,34 @@ base::SmartArrayPointer<const char> GetVisualizerLogFileName( ...@@ -36,14 +36,34 @@ base::SmartArrayPointer<const char> GetVisualizerLogFileName(
} else { } else {
SNPrintF(filename, "turbo-none-%s", phase); SNPrintF(filename, "turbo-none-%s", phase);
} }
EmbeddedVector<char, 256> source_file(0);
bool source_available = false;
if (FLAG_trace_file_names && info->parse_info()) {
Object* source_name = info->script()->name();
if (source_name->IsString()) {
String* str = String::cast(source_name);
if (str->length() > 0) {
SNPrintF(source_file, "%s", str->ToCString().get());
std::replace(source_file.start(),
source_file.start() + source_file.length(), '/', '_');
source_available = true;
}
}
}
std::replace(filename.start(), filename.start() + filename.length(), ' ', std::replace(filename.start(), filename.start() + filename.length(), ' ',
'_'); '_');
EmbeddedVector<char, 256> full_filename; EmbeddedVector<char, 256> full_filename;
if (phase == nullptr) { if (phase == nullptr && !source_available) {
SNPrintF(full_filename, "%s.%s", filename.start(), suffix); SNPrintF(full_filename, "%s.%s", filename.start(), suffix);
} else { } else if (phase != nullptr && !source_available) {
SNPrintF(full_filename, "%s-%s.%s", filename.start(), phase, suffix); SNPrintF(full_filename, "%s-%s.%s", filename.start(), phase, suffix);
} else if (phase == nullptr && source_available) {
SNPrintF(full_filename, "%s_%s.%s", filename.start(), source_file.start(),
suffix);
} else {
SNPrintF(full_filename, "%s_%s-%s.%s", filename.start(),
source_file.start(), phase, suffix);
} }
char* buffer = new char[full_filename.length() + 1]; char* buffer = new char[full_filename.length() + 1];
......
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