Add StartProfiling to filter out v8 warm up

v8.cpu_profiler has a long and variable warm up period. If you look in
tracing that time shows up under V8.Execute which is very misleading. By
adding a tracing category for the time spent in
CpuProfiler::StartProfiling the warm up time can be easily identified or
even filtered out.

With this tracing event the block in StartProfiling correctly described
the time spent prepare v8.cpu_profiler out from V8.Execute

Test by collecting a trace with V8.Execute and look at when a trace
starts generating v8 samples.

BUG=chromium:733853

Review-Url: https://codereview.chromium.org/2950543002
Cr-Commit-Position: refs/heads/master@{#46393}
This commit is contained in:
bgirard 2017-07-03 15:01:14 -07:00 committed by Commit Bot
parent b7a9c0223f
commit 93557496a2

View File

@ -300,6 +300,7 @@ void CpuProfiler::CollectSample() {
void CpuProfiler::StartProfiling(const char* title, bool record_samples) {
if (profiles_->StartProfiling(title, record_samples)) {
TRACE_EVENT0("v8", "CpuProfiler::StartProfiling");
StartProcessorIfNotStarted();
}
}