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.
7 option optimize_for = LITE_RUNTIME;
8 option java_outer_classname = "SampledProfileProtos";
9 option java_package = "org.chromium.components.metrics";
13 import "call_stack_profile.proto";
14 import "perf_data.proto";
16 // Protocol buffer for collected sample-based profiling data.
17 // Contains the parameters and data from a single profile collection event.
20 message SampledProfile {
21 // Indicates the event that triggered this collection.
23 UNKNOWN_TRIGGER_EVENT = 0;
25 // The profile was triggered by periodic sampling. Periodically sampled
26 // profiles are collected once per uniformly sized period interval. Within
27 // each interval, the sampled data is collected at a random time. For
28 // example, if the interval is 60 s, then data would be collected at a
29 // random point in each of the intervals [0, 60 s), [60 s, 120 s), etc.
30 PERIODIC_COLLECTION = 1;
32 // The profile was collected upon resume from suspend.
33 RESUME_FROM_SUSPEND = 2;
35 // The profile was collected upon restoring a previous session.
38 // The profile was collected at process startup.
41 // The profile was collected after jank was detected while executing a task.
44 // The profile was collected after a thread was determined to be hung.
47 optional TriggerEvent trigger_event = 1;
49 // Fields 2-3: Time durations are given in ticks, and represent system uptime
50 // rather than wall time.
52 // Time after system boot when the collection took place, in milliseconds.
53 optional int64 ms_after_boot = 2;
55 // Time after last login when the collection took place, in milliseconds.
56 optional int64 ms_after_login = 3;
58 // The duration for which the machine was suspended prior to collecting the
59 // sampled profile. Only set when |trigger_event| is RESUME_FROM_SUSPEND.
60 optional int64 suspend_duration_ms = 5;
62 // Number of milliseconds after a resume that profile was collected. Only set
63 // when |trigger_event| is RESUME_FROM_SUSPEND.
64 optional int64 ms_after_resume = 6;
66 // Number of tabs restored during a session restore. Only set when
67 // |trigger_event| is RESTORE_SESSION.
68 optional int32 num_tabs_restored = 7;
70 // Number of milliseconds after a session restore that a profile was
71 // collected. Only set when |trigger_event| is RESTORE_SESSION.
72 optional int64 ms_after_restore = 8;
74 // Sampled profile data collected from Linux perf tool.
75 optional PerfDataProto perf_data = 4;
77 // Sampled profile data collected by periodic sampling of call stacks.
78 optional CallStackProfile call_stack_profile = 9;