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// Configuration for go/heapprofd. 23message HeapprofdConfig { 24 message ContinuousDumpConfig { 25 // ms to wait before first dump. 26 optional uint32 dump_phase_ms = 5; 27 // ms to wait between following dumps. 28 optional uint32 dump_interval_ms = 6; 29 }; 30 31 // Set to 1 for perfect accuracy. 32 // Otherwise, sample every sample_interval_bytes on average. 33 // 34 // See https://docs.perfetto.dev/#/heapprofd?id=sampling-interval for more 35 // details. 36 optional uint64 sampling_interval_bytes = 1; 37 38 // E.g. surfaceflinger, com.android.phone 39 // This input is normalized in the following way: if it contains slashes, 40 // everything up to the last slash is discarded. If it contains "@", 41 // everything after the first @ is discared. 42 // E.g. /system/bin/surfaceflinger@1.0 normalizes to surfaceflinger. 43 // This transformation is also applied to the processes' command lines when 44 // matching. 45 repeated string process_cmdline = 2; 46 47 // For watermark based triggering or local debugging. 48 repeated uint64 pid = 4; 49 50 // Profile all processes eligible for profiling on the system. 51 // See https://docs.perfetto.dev/#/heapprofd?id=target-processes for which 52 // processes are eligible. 53 // 54 // On unmodified userdebug builds, this will lead to system crashes. Zygote 55 // will crash when trying to launch a new process as it will have an 56 // unexpected open socket to heapprofd. 57 // 58 // heapprofd will likely be overloaded by the amount of data for low 59 // sampling intervals. 60 optional bool all = 5; 61 62 // Do not emit function names for mappings starting with this prefix. 63 // E.g. /system to not emit symbols for any system libraries. 64 repeated string skip_symbol_prefix = 7; 65 66 // Dump once at the end of the trace, emitting the heap dump at maximum 67 // memory usage. 68 // optional bool retain_max = 5; // TODO(fmayer): Implement 69 70 // Dump at a predefined interval. 71 optional ContinuousDumpConfig continuous_dump_config = 6; 72 73 // Size of the shared memory buffer between the profiled processes and 74 // heapprofd. Defaults to 8 MiB. If larger than 500 MiB, truncated to 500 75 // MiB. 76 // 77 // Needs to be: 78 // * at least 8192, 79 // * a power of two, 80 // * a multiple of 4096. 81 optional uint64 shmem_size_bytes = 8; 82 83 // When the shmem buffer is full, block the client instead of ending the 84 // trace. Use with caution as this will significantly slow down the target 85 // process. 86 optional bool block_client = 9; 87} 88