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 17 syntax = "proto2"; 18 option optimize_for = LITE_RUNTIME; 19 20 package perfetto.protos; 21 22 // Statistics for the internals of the tracing service. 23 message TraceStats { 24 // From TraceBuffer::Stats. 25 message BufferStats { 26 // Num. bytes written into the circular buffer. 27 optional uint64 bytes_written = 1; 28 29 // Num. chunks (!= packets) written into the buffer. 30 optional uint64 chunks_written = 2; 31 32 // Num. chunks overwritten before they have been read (i.e. loss of data). 33 optional uint64 chunks_overwritten = 3; 34 35 // Num. times the ring buffer wrapped around. 36 optional uint64 write_wrap_count = 4; 37 38 // Num. out-of-band (OOB) patches that succeeded. 39 optional uint64 patches_succeeded = 5; 40 41 // Num. OOB patches that failed (e.g., the chunk to patch was gone). 42 optional uint64 patches_failed = 6; 43 44 // Num. readaheads (for large multi-chunk packet reads) that ended up in a 45 // successful packet read. 46 optional uint64 readaheads_succeeded = 7; 47 48 // Num. readaheads aborted because of missing chunks in the sequence stream. 49 // Note that a small number > 0 is totally expected: occasionally, when 50 // issuing a read, the very last packet in a sequence might be incomplete 51 // (because the producer is still writing it while we read). The read will 52 // stop at that point, for that sequence, increasing this counter. 53 optional uint64 readaheads_failed = 8; 54 55 // Num. of violations of the SharedMemoryABI found while writing or reading 56 // the buffer. This is an indication of either a bug in the producer(s) or 57 // malicious producer(s). 58 optional uint64 abi_violations = 9; 59 } 60 61 // Stats for the TraceBuffer(s) of the current trace session. 62 repeated BufferStats buffer_stats = 1; 63 64 // Num. producers connected (whether they are involved in the current tracing 65 // session or not). 66 optional uint32 producers_connected = 2; 67 68 // Num. producers ever seen for all trace sessions since startup (it's a good 69 // proxy for inferring num. producers crashed / killed). 70 optional uint64 producers_seen = 3; 71 72 // Num. data sources registered for all trace sessions. 73 optional uint32 data_sources_registered = 4; 74 75 // Num. data sources ever seen for all trace sessions since startupb 76 optional uint64 data_sources_seen = 5; 77 78 // Num. concurrently active tracing sessions. 79 optional uint32 tracing_sessions = 6; 80 81 // Num. buffers for all tracing session (not just the current one). This will 82 // be >= buffer_stats.size(), because the latter is only about the current 83 // session. 84 optional uint32 total_buffers = 7; 85 } 86