• 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;
19
20package perfetto.protos;
21
22// Per-CPU stats for the ftrace data source gathered from the kernel from
23// /sys/kernel/debug/tracing/per_cpu/cpuX/stats.
24message FtraceCpuStats {
25  // CPU index.
26  optional uint64 cpu = 1;
27
28  // Number of entries still in the kernel buffer. Ideally this should be close
29  // to zero, as events are consumed regularly and moved into the userspace
30  // buffers (or file).
31  optional uint64 entries = 2;
32
33  // Number of events lost in kernel buffers due to overwriting of old events
34  // before userspace had a chance to drain them.
35  optional uint64 overrun = 3;
36
37  // This should always be zero. If not the buffer size is way too small or
38  // something went wrong with the tracer.
39  optional uint64 commit_overrun = 4;
40
41  // Bytes actually read (not overwritten).
42  optional uint64 bytes_read = 5;
43
44  // The timestamp for the oldest event still in the ring buffer.
45  optional double oldest_event_ts = 6;
46
47  // The current timestamp.
48  optional double now_ts = 7;
49
50  // If the kernel buffer has overwrite mode disabled, this will show the number
51  // of new events that were lost because the buffer was full. This is similar
52  // to |overrun| but only for the overwrite=false case.
53  optional uint64 dropped_events = 8;
54
55  // The number of events read.
56  optional uint64 read_events = 9;
57}
58
59// Ftrace stats for all CPUs.
60message FtraceStats {
61  enum Phase {
62    UNSPECIFIED = 0;
63    START_OF_TRACE = 1;
64    END_OF_TRACE = 2;
65  }
66
67  // Tells when stats were sampled. There should be one sample at the beginning
68  // of the trace and one sample at the end.
69  optional Phase phase = 1;
70
71  // Per-CPU stats (one entry for each CPU).
72  repeated FtraceCpuStats cpu_stats = 2;
73}
74