diff options
Diffstat (limited to 'deps/v8/src/compiler/pipeline-statistics.cc')
-rw-r--r-- | deps/v8/src/compiler/pipeline-statistics.cc | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/deps/v8/src/compiler/pipeline-statistics.cc b/deps/v8/src/compiler/pipeline-statistics.cc index 82a6e6bb3e..16366bf588 100644 --- a/deps/v8/src/compiler/pipeline-statistics.cc +++ b/deps/v8/src/compiler/pipeline-statistics.cc @@ -10,21 +10,12 @@ #include "src/compiler/zone-stats.h" #include "src/objects/shared-function-info.h" #include "src/objects/string.h" -#include "src/tracing/trace-event.h" namespace v8 { namespace internal { namespace compiler { -namespace { - -// We log detailed phase information about the pipeline -// in both the v8.turbofan and the v8.wasm.turbofan categories. -constexpr const char kTraceCategory[] = // -- - TRACE_DISABLED_BY_DEFAULT("v8.turbofan") "," // -- - TRACE_DISABLED_BY_DEFAULT("v8.wasm.turbofan"); - -} // namespace +constexpr char PipelineStatistics::kTraceCategory[]; void PipelineStatistics::CommonStats::Begin( PipelineStatistics* pipeline_stats) { @@ -62,6 +53,7 @@ PipelineStatistics::PipelineStatistics(OptimizedCompilationInfo* info, : outer_zone_(info->zone()), zone_stats_(zone_stats), compilation_stats_(compilation_stats), + code_kind_(info->code_kind()), phase_kind_name_(nullptr), phase_name_(nullptr) { if (info->has_shared_info()) { @@ -70,7 +62,6 @@ PipelineStatistics::PipelineStatistics(OptimizedCompilationInfo* info, total_stats_.Begin(this); } - PipelineStatistics::~PipelineStatistics() { if (InPhaseKind()) EndPhaseKind(); CompilationStatistics::BasicStats diff; @@ -82,7 +73,8 @@ PipelineStatistics::~PipelineStatistics() { void PipelineStatistics::BeginPhaseKind(const char* phase_kind_name) { DCHECK(!InPhase()); if (InPhaseKind()) EndPhaseKind(); - TRACE_EVENT_BEGIN0(kTraceCategory, phase_kind_name); + TRACE_EVENT_BEGIN1(kTraceCategory, phase_kind_name, "kind", + CodeKindToString(code_kind_)); phase_kind_name_ = phase_kind_name; phase_kind_stats_.Begin(this); } @@ -92,11 +84,14 @@ void PipelineStatistics::EndPhaseKind() { CompilationStatistics::BasicStats diff; phase_kind_stats_.End(this, &diff); compilation_stats_->RecordPhaseKindStats(phase_kind_name_, diff); - TRACE_EVENT_END0(kTraceCategory, phase_kind_name_); + TRACE_EVENT_END2(kTraceCategory, phase_kind_name_, "kind", + CodeKindToString(code_kind_), "stats", + TRACE_STR_COPY(diff.AsJSON().c_str())); } void PipelineStatistics::BeginPhase(const char* phase_name) { - TRACE_EVENT_BEGIN0(kTraceCategory, phase_name); + TRACE_EVENT_BEGIN1(kTraceCategory, phase_name, "kind", + CodeKindToString(code_kind_)); DCHECK(InPhaseKind()); phase_name_ = phase_name; phase_stats_.Begin(this); @@ -107,7 +102,9 @@ void PipelineStatistics::EndPhase() { CompilationStatistics::BasicStats diff; phase_stats_.End(this, &diff); compilation_stats_->RecordPhaseStats(phase_kind_name_, phase_name_, diff); - TRACE_EVENT_END0(kTraceCategory, phase_name_); + TRACE_EVENT_END2(kTraceCategory, phase_name_, "kind", + CodeKindToString(code_kind_), "stats", + TRACE_STR_COPY(diff.AsJSON().c_str())); } } // namespace compiler |