Skip to content

Commit

Permalink
[cpu-profiler] Add flag to always generate accurate line info.
Browse files Browse the repository at this point in the history
For optimized code there are two modes. This is controlled by
NeedsSourcePositionsForProfiling(). The problem we currently have is
that this mode must be enabled before the code is optimized, otherwise
the source position information will be low quality, even once the CPU
profiler is turned on.

Also add an implication from --future to this new flag, to gather
perf & memory data from the bots.

Bug: v8:7983
Change-Id: I993fc03df83028529eea365b6d336d9f4c0dcd2b
Reviewed-on: https://chromium-review.googlesource.com/1156309
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54809}
  • Loading branch information
psmarshall authored and Commit Bot committed Jul 31, 2018
1 parent 8b450f5 commit 56baf56
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/flag-definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -1251,6 +1251,10 @@ DEFINE_BOOL(log_function_events, false,
DEFINE_BOOL(prof, false,
"Log statistical profiling information (implies --log-code).")

DEFINE_BOOL(detailed_line_info, false,
"Always generate detailed line information for CPU profiling.")
DEFINE_IMPLICATION(future, detailed_line_info)

#if defined(ANDROID)
// Phones and tablets have processors that are much slower than desktop
// and laptop computers for which current heuristics are tuned.
Expand Down
3 changes: 2 additions & 1 deletion src/isolate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3242,7 +3242,8 @@ bool Isolate::use_optimizer() {
bool Isolate::NeedsSourcePositionsForProfiling() const {
return FLAG_trace_deopt || FLAG_trace_turbo || FLAG_trace_turbo_graph ||
FLAG_turbo_profiling || FLAG_perf_prof || is_profiling() ||
debug_->is_active() || logger_->is_logging() || FLAG_trace_maps;
debug_->is_active() || logger_->is_logging() || FLAG_trace_maps ||
FLAG_detailed_line_info;
}

void Isolate::SetFeedbackVectorsForProfilingTools(Object* value) {
Expand Down

0 comments on commit 56baf56

Please sign in to comment.