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