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";
15 import "perf_stat.proto";
17 // Protocol buffer for collected sample-based profiling data.
18 // Contains the parameters and data from a single profile collection event.
21 message SampledProfile {
22 // Indicates the event that triggered this collection.
24 UNKNOWN_TRIGGER_EVENT = 0;
26 // The profile was triggered by periodic sampling. Periodically sampled
27 // profiles are collected once per uniformly sized period interval. Within
28 // each interval, the sampled data is collected at a random time. For
29 // example, if the interval is 60 s, then data would be collected at a
30 // random point in each of the intervals [0, 60 s), [60 s, 120 s), etc.
31 PERIODIC_COLLECTION = 1;
33 // The profile was collected upon resume from suspend.
34 RESUME_FROM_SUSPEND = 2;
36 // The profile was collected upon restoring a previous session.
39 // The profile was collected at process startup.
42 // The profile was collected after jank was detected while executing a task.
45 // The profile was collected after a thread was determined to be hung.
48 optional TriggerEvent trigger_event = 1;
50 // Fields 2-3: Time durations are given in ticks, and represent system uptime
51 // rather than wall time.
53 // Time after system boot when the collection took place, in milliseconds.
54 optional int64 ms_after_boot = 2;
56 // Time after last login when the collection took place, in milliseconds.
57 optional int64 ms_after_login = 3;
59 // The duration for which the machine was suspended prior to collecting the
60 // sampled profile. Only set when |trigger_event| is RESUME_FROM_SUSPEND.
61 optional int64 suspend_duration_ms = 5;
63 // Number of milliseconds after a resume that profile was collected. Only set
64 // when |trigger_event| is RESUME_FROM_SUSPEND.
65 optional int64 ms_after_resume = 6;
67 // Number of tabs restored during a session restore. Only set when
68 // |trigger_event| is RESTORE_SESSION.
69 optional int32 num_tabs_restored = 7;
71 // Number of milliseconds after a session restore that a profile was
72 // collected. Only set when |trigger_event| is RESTORE_SESSION.
73 optional int64 ms_after_restore = 8;
75 // Sampled profile data collected from Linux perf tool.
76 optional PerfDataProto perf_data = 4;
78 // Sampled profile data collected by periodic sampling of call stacks.
79 optional CallStackProfile call_stack_profile = 9;
81 // Perf counter data collected using "perf stat".
82 optional PerfStatProto perf_stat = 10;