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 20import "protos/perfetto/common/sys_stats_counters.proto"; 21 22// Various Linux system stat counters from /proc. 23// The fields in this message can be reported at different rates and with 24// different granularity. See sys_stats_config.proto. 25message SysStats { 26 // Counters from /proc/meminfo. Values are in KB. 27 message MeminfoValue { 28 optional MeminfoCounters key = 1; 29 optional uint64 value = 2; 30 }; 31 repeated MeminfoValue meminfo = 1; 32 33 // Counter from /proc/vmstat. Units are often pages, not KB. 34 message VmstatValue { 35 optional VmstatCounters key = 1; 36 optional uint64 value = 2; 37 }; 38 repeated VmstatValue vmstat = 2; 39 40 // Times in each mode, since boot. Unit: nanoseconds. 41 message CpuTimes { 42 optional uint32 cpu_id = 1; 43 44 // Time spent in user mode. 45 optional uint64 user_ns = 2; 46 47 // Time spent in user mode (low prio). 48 optional uint64 user_ice_ns = 3; 49 50 // Time spent in system mode. 51 optional uint64 system_mode_ns = 4; 52 53 // Time spent in the idle task. 54 optional uint64 idle_ns = 5; 55 56 // Time spent waiting for I/O. 57 optional uint64 io_wait_ns = 6; 58 59 // Time spent servicing interrupts. 60 optional uint64 irq_ns = 7; 61 62 // Time spent servicing softirqs. 63 optional uint64 softirq_ns = 8; 64 } 65 // One entry per cpu. 66 repeated CpuTimes cpu_stat = 3; 67 68 // Num processes forked since boot. 69 // Populated only if FORK_COUNT in config.stat_counters. 70 optional uint64 num_forks = 4; 71 72 message InterruptCount { 73 optional int32 irq = 1; 74 optional uint64 count = 2; 75 } 76 77 // Number of interrupts, broken by IRQ number. 78 // Populated only if IRQ_COUNTS in config.stat_counters. 79 80 // Total num of irqs serviced since boot. 81 optional uint64 num_irq_total = 5; 82 repeated InterruptCount num_irq = 6; 83 84 // Number of softirqs, broken by softirq number. 85 // Populated only if SOFTIRQ_COUNTS in config.stat_counters. 86 87 // Total num of softirqs since boot. 88 optional uint64 num_softirq_total = 7; 89 90 // Per-softirq count. 91 repeated InterruptCount num_softirq = 8; 92 93 // The time at which we finish collecting this set of samples; 94 // the top-level packet timestamp is the time at which 95 // we begin collection. 96 optional uint64 collection_end_timestamp = 9; 97 98 // Frequencies for /sys/class/devfreq/ entries in kHz. 99 message DevfreqValue { 100 optional string key = 1; 101 optional uint64 value = 2; 102 }; 103 104 // One entry per device. 105 repeated DevfreqValue devfreq = 10; 106} 107