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;
11 import "call_stack_profile.proto";
12 import "perf_data.proto";
14 // Protocol buffer for collected sample-based profiling data.
15 // Contains the parameters and data from a single profile collection event.
18 message SampledProfile {
19 // Indicates the event that triggered this collection.
21 UNKNOWN_TRIGGER_EVENT = 0;
23 // The profile was triggered by periodic sampling. Periodically sampled
24 // profiles are collected once per uniformly sized period interval. Within
25 // each interval, the sampled data is collected at a random time. For
26 // example, if the interval is 60 s, then data would be collected at a
27 // random point in each of the intervals [0, 60 s), [60 s, 120 s), etc.
28 PERIODIC_COLLECTION = 1;
30 // The profile was collected upon resume from suspend.
31 RESUME_FROM_SUSPEND = 2;
33 // The profile was collected upon restoring a previous session.
36 optional TriggerEvent trigger_event = 1;
38 // Fields 2-3: Time durations are given in ticks, and represent system uptime
39 // rather than wall time.
41 // Time after system boot when the collection took place, in milliseconds.
42 optional int64 ms_after_boot = 2;
44 // Time after last login when the collection took place, in milliseconds.
45 optional int64 ms_after_login = 3;
47 // The duration for which the machine was suspended prior to collecting the
48 // sampled profile. Only set when |trigger_event| is RESUME_FROM_SUSPEND.
49 optional int64 suspend_duration_ms = 5;
51 // Number of milliseconds after a resume that profile was collected. Only set
52 // when |trigger_event| is RESUME_FROM_SUSPEND.
53 optional int64 ms_after_resume = 6;
55 // Number of tabs restored during a session restore. Only set when
56 // |trigger_event| is RESTORE_SESSION.
57 optional int32 num_tabs_restored = 7;
59 // Number of milliseconds after a session restore that a profile was
60 // collected. Only set when |trigger_event| is RESTORE_SESSION.
61 optional int64 ms_after_restore = 8;
63 // Sampled profile data collected from Linux perf tool.
64 optional PerfDataProto perf_data = 4;
66 // Sampled profile data collected by periodic sampling of call stacks.
67 optional CallStackProfile call_stack_profile = 9;