Setup a experiment to enable background tracing.
[chromium-blink-merge.git] / cc / debug / benchmark_instrumentation.cc
blob5a04e214ed1a6d8eff90bef0bf1ddad25b877ddd
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "base/trace_event/trace_event.h"
6 #include "cc/debug/benchmark_instrumentation.h"
8 namespace cc {
9 namespace benchmark_instrumentation {
11 // Please do not change the trace events in this file without updating
12 // tools/perf/measurements/rendering_stats.py accordingly.
13 // The benchmarks search for events and their arguments by name.
15 void IssueImplThreadRenderingStatsEvent(const RenderingStats& stats) {
16 TRACE_EVENT_INSTANT1("benchmark",
17 "BenchmarkInstrumentation::ImplThreadRenderingStats",
18 TRACE_EVENT_SCOPE_THREAD,
19 "data", stats.AsTraceableData());
22 void IssueDisplayRenderingStatsEvent() {
23 scoped_refptr<base::trace_event::TracedValue> record_data =
24 new base::trace_event::TracedValue();
25 record_data->SetInteger("frame_count", 1);
26 TRACE_EVENT_INSTANT1(
27 "benchmark",
28 "BenchmarkInstrumentation::DisplayRenderingStats",
29 TRACE_EVENT_SCOPE_THREAD,
30 "data",
31 scoped_refptr<base::trace_event::ConvertableToTraceFormat>(record_data));
34 } // namespace benchmark_instrumentation
35 } // namespace cc