• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (C) 2018 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
18package perfetto.protos;
19
20// Per-process periodically sampled stats. These samples are wrapped in a
21// dedicated message (as opposite to be fields in process_tree.proto) because
22// they are dumped at a different rate than cmdline and thread list.
23// Note: not all of these stats will be present in every ProcessStats message
24// and sometimes processes may be missing . This is because counters are
25// cached to reduce emission of counters which do not change.
26message ProcessStats {
27  // Per-thread periodically sampled stats.
28  // Note: not all of these stats will be present in every message. See the note
29  // for ProcessStats.
30  message Thread {
31    optional int32 tid = 1;
32
33    // DEPRECATED cpu_freq_indices
34    reserved 2;
35
36    // DEPRECATED cpu_freq_ticks
37    reserved 3;
38
39    // DEPRECATED cpu_freq_full
40    reserved 4;
41  }
42
43  message FDInfo {
44    optional uint64 fd = 1;
45    optional string path = 2;
46  }
47
48  message Process {
49    optional int32 pid = 1;
50
51    // See /proc/[pid]/status in `man 5 proc` for a description of these fields.
52    optional uint64 vm_size_kb = 2;
53    optional uint64 vm_rss_kb = 3;
54    optional uint64 rss_anon_kb = 4;
55    optional uint64 rss_file_kb = 5;
56    optional uint64 rss_shmem_kb = 6;
57    optional uint64 vm_swap_kb = 7;
58    optional uint64 vm_locked_kb = 8;
59    optional uint64 vm_hwm_kb = 9;
60    // When adding a new field remember to update kProcMemCounterSize in
61    // the trace processor.
62
63    optional int64 oom_score_adj = 10;
64
65    repeated Thread threads = 11;
66
67    // The peak resident set size is resettable in newer Posix kernels.
68    // This field specifies if reset is supported and if the writer had reset
69    // the peaks after each process stats recording.
70    optional bool is_peak_rss_resettable = 12;
71
72    // Private, shared and swap footprint of the process as measured by
73    // Chrome. To know more about these metrics refer to:
74    // https://docs.google.com/document/d/1_WmgE1F5WUrhwkPqJis3dWyOiUmQKvpXp5cd4w86TvA
75    optional uint32 chrome_private_footprint_kb = 13;
76    optional uint32 chrome_peak_resident_set_kb = 14;
77
78    repeated FDInfo fds = 15;
79
80    // These fields are set only when scan_smaps_rollup=true
81    optional uint64 smr_rss_kb = 16;
82    optional uint64 smr_pss_kb = 17;
83    optional uint64 smr_pss_anon_kb = 18;
84    optional uint64 smr_pss_file_kb = 19;
85    optional uint64 smr_pss_shmem_kb = 20;
86  }
87  repeated Process processes = 1;
88
89  // The time at which we finish collecting this batch of samples;
90  // the top-level packet timestamp is the time at which
91  // we begin collection.
92  optional uint64 collection_end_timestamp = 2;
93}
94