blob: 5cf56501f00268d84201780642857b4b6e89f119 [file] [log] [blame]
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
option java_outer_classname = "SampledProfileProtos";
option java_package = "org.chromium.components.metrics";
package metrics;
import "call_stack_profile.proto";
import "execution_context.proto";
import "perf_data.proto";
import "perf_stat.proto";
// Protocol buffer for collected sample-based profiling data.
// Contains the parameters and data from a single profile collection event.
// Next tag: 15
message SampledProfile {
// Indicates the event that triggered this collection.
enum TriggerEvent {
UNKNOWN_TRIGGER_EVENT = 0;
// The profile was triggered by periodic sampling. Periodically sampled
// profiles are collected once per uniformly sized period interval. Within
// each interval, the sampled data is collected at a random time. For
// example, if the interval is 60 s, then data would be collected at a
// random point in each of the intervals [0, 60 s), [60 s, 120 s), etc.
PERIODIC_COLLECTION = 1;
// The profile was collected upon resume from suspend.
RESUME_FROM_SUSPEND = 2;
// The profile was collected upon restoring a previous session.
RESTORE_SESSION = 3;
// The profile was collected at process startup.
PROCESS_STARTUP = 4;
// The profile was collected after jank was detected while executing a task.
JANKY_TASK = 5;
// The profile was collected after a thread was determined to be hung.
THREAD_HUNG = 6;
// The heap profile was triggered by periodic sampling. The time intervals
// between trigger events conform to the Poisson process with certain mean
// interval between collections.
PERIODIC_HEAP_COLLECTION = 7;
}
optional TriggerEvent trigger_event = 1;
// The process in which the profile was collected.
optional Process process = 11;
// The thread in which the profile was collected.
optional Thread thread = 12;
// Map of Chrome PIDs running on the system when the profile was collected.
// Each Chrome PID is mapped to its process type.
// This field and the below thread_types field assume that the PID/TID
// information are collected in a short duration for a single session such
// that, the PID/TID reuse is highly unlikely.
// The information from these two fields is used to map chrome samples
// collected for a specific PID/TID to the corresponding process type and
// thread type.
map<uint32, Process> process_types = 13;
// Map of Chrome TIDs running on the system when the profile was collected.
// Each Chrome TID is mapped to its thread type.
map<uint32, Thread> thread_types = 14;
// Fields 2-3: Time durations are given in ticks, and represent system uptime
// rather than wall time.
// Time after system boot when the collection took place, in milliseconds.
optional int64 ms_after_boot = 2;
// Time after last login when the collection took place, in milliseconds.
optional int64 ms_after_login = 3;
// The duration for which the machine was suspended prior to collecting the
// sampled profile. Only set when |trigger_event| is RESUME_FROM_SUSPEND.
optional int64 suspend_duration_ms = 5;
// Number of milliseconds after a resume that profile was collected. Only set
// when |trigger_event| is RESUME_FROM_SUSPEND.
optional int64 ms_after_resume = 6;
// Number of tabs restored during a session restore. Only set when
// |trigger_event| is RESTORE_SESSION.
optional int32 num_tabs_restored = 7;
// Number of milliseconds after a session restore that a profile was
// collected. Only set when |trigger_event| is RESTORE_SESSION.
optional int64 ms_after_restore = 8;
// Sampled profile data collected from Linux perf tool.
optional PerfDataProto perf_data = 4;
// Sampled profile data collected by periodic sampling of call stacks.
optional CallStackProfile call_stack_profile = 9;
// Perf counter data collected using "perf stat".
optional PerfStatProto perf_stat = 10;
}