1 // Copyright 2014 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 // Performance metrics collected via Chrome's built-in profiler.
9 option optimize_for = LITE_RUNTIME;
10 option java_outer_classname = "ProfilerEventProtos";
11 option java_package = "org.chromium.components.metrics";
16 message ProfilerEventProto {
17 // The version of this profile.
19 VERSION_UNKNOWN = 0; // Unknown version (should not reach here).
20 VERSION_STARTUP_PROFILE = 1; // Startup profile, logged approximately 60
21 // seconds after launch.
22 VERSION_SPLIT_PROFILE = 2; // Part of a profile logged in pieces, where
23 // we finish a piece when a ProfilerEvent or a
24 // special end-of-recording event gets
27 optional ProfileVersion profile_version = 1;
29 // The source based upon which "time" measurements are made.
30 // We currently only measure wall clock time; but we are exploring other
31 // measurement sources as well, such as CPU time or TCMalloc statistics.
33 UNKNOWN_TIME_SOURCE = 0; // Unknown type (should not reach here).
34 WALL_CLOCK_TIME = 1; // Total time elapsed between the start and end of
35 // the task's execution.
37 optional TimeSource time_source = 2;
39 // An event in the browser life that causes the client-side profiler framework
40 // to finish recording of its current instance of ProfilerEventProto, and
41 // start recording a new one.
42 // It's not guaranteed that the events get triggered in the order they are
45 // The first non-empty paint of the first web contents happened.
46 // Corresponds to the Startup.FirstWebContents.NonEmptyPaint histogram.
47 EVENT_FIRST_NONEMPTY_PAINT = 0;
50 // The set of events, in no particular order, that were triggered in the
51 // current Chrome session before the recording of this ProfilerEventProto
52 // started. It doesn't include the event that triggered the end of this
53 // ProfilerEventProto. A given event will not occur twice in this set.
54 // The field can be used to find all ProfilerEventProto instances recorded
55 // before or not before a given event.
56 repeated ProfilerEvent past_session_event = 4;
58 // Time when profiling started. This is recorded as a time delta relative to
59 // the start time of the profiler data recording in the current browser
61 optional int64 profiling_start_ms = 5;
63 // Time when profiling finished. This is recorded as a time delta relative to
64 // the start time of the profiler data recording in the current browser
66 optional int64 profiling_finish_ms = 6;
68 // Data for a single tracked object (typically, a Task).
69 message TrackedObject {
70 // The name of the thread from which this task was posted, hashed.
71 optional fixed64 birth_thread_name_hash = 1;
73 // The name of the thread on which this task was executed, hashed.
74 optional fixed64 exec_thread_name_hash = 2;
76 // The source file name from which this task was posted, hashed.
77 optional fixed64 source_file_name_hash = 3;
79 // Function name from which this task was posted, hashed.
80 optional fixed64 source_function_name_hash = 4;
82 // The line number within the source file from which this task was posted.
83 optional int32 source_line_number = 5;
85 // The number of times this task was executed.
86 optional int32 exec_count = 6;
88 // The total execution time for instances this task.
89 optional int32 exec_time_total = 7;
91 // The execution time for a uniformly randomly sampled instance of this
93 optional int32 exec_time_sampled = 8;
95 // The total time instances this task spent waiting (e.g. in a message loop)
96 // before they were run.
97 optional int32 queue_time_total = 9;
99 // The time that a uniformly randomly sampled instance of this task spent
100 // waiting (e.g. in a message loop) before it was run.
101 optional int32 queue_time_sampled = 10;
103 // The type of process within which this task was executed.
105 UNKNOWN = 0; // Should not reach here
120 optional ProcessType process_type = 11;
122 // The local PID for the process within which this task was executed.
123 optional uint32 process_id = 12;
125 repeated TrackedObject tracked_object = 3;