• 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";
18option optimize_for = LITE_RUNTIME;
19package perfetto.protos;
20
21// Per-process periodically sampled stats. These samples are wrapped in a
22// dedicated message (as opposite to be fields in process_tree.proto) because
23// they are dumped at a different rate than cmdline and thread list.
24// Note: not all of these stats will be present in every ProcessStats message
25// and sometimes processes may be missing . This is because counters are
26// cached to reduce emission of counters which do not change.
27message ProcessStats {
28  message Process {
29    optional int32 pid = 1;
30
31    // See /proc/[pid]/status in `man 5 proc` for a description of these fields.
32    optional uint64 vm_size_kb = 2;
33    optional uint64 vm_rss_kb = 3;
34    optional uint64 rss_anon_kb = 4;
35    optional uint64 rss_file_kb = 5;
36    optional uint64 rss_shmem_kb = 6;
37    optional uint64 vm_swap_kb = 7;
38    optional uint64 vm_locked_kb = 8;
39    optional uint64 vm_hwm_kb = 9;
40    // When adding a new field remember to update kProcMemCounterSize in
41    // the trace processor.
42
43    optional int64 oom_score_adj = 10;
44  }
45  repeated Process processes = 1;
46
47  // The time at which we finish collecting this batch of samples;
48  // the top-level packet timestamp is the time at which
49  // we begin collection.
50  // TODO(dancol): analysis might be improved by
51  // time-bracketing each sample as well as the whole
52  // ProcessStats, but doing that is probably gated on
53  // a vdso for CLOCK_BOOTTIME.
54  optional uint64 collection_end_timestamp = 2;
55}
56