1/* 2 * Copyright (C) 2019 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 */ 16syntax = "proto2"; 17 18package perfetto.protos; 19 20import "protos/perfetto/metrics/android/process_metadata.proto"; 21 22message HeapProfileCallsites { 23 message Frame { 24 optional string name = 1; 25 optional string mapping_name = 2; 26 } 27 28 message Counters { 29 // Count of objects allocated 30 optional int64 total_count = 1; 31 // Count of bytes allocated 32 optional int64 total_bytes = 2; 33 34 // Count of allocated objects that were not freed 35 optional int64 delta_count = 3; 36 // Count of allocated bytes that were not freed 37 optional int64 delta_bytes = 4; 38 } 39 40 message Callsite { 41 // The hash unambiguously identifies a callsite in a heap profile (as a 42 // traversal from the root node). It is based on the symbol names (instead 43 // of the addresses). 44 optional int64 hash = 1; 45 optional int64 parent_hash = 2; 46 47 // Leaf frame of the callsite. Use parent_hash to traverse to parent nodes. 48 optional Frame frame = 3; 49 50 optional Counters self_allocs = 4; 51 optional Counters child_allocs = 5; 52 } 53 54 // Callsites per process instance. 55 // Next id: 7 56 message InstanceStats { 57 optional uint32 pid = 1; 58 // TODO(ilkos): Remove process_name in favour of the metadata. 59 optional string process_name = 2; 60 optional AndroidProcessMetadata process = 6; 61 repeated Callsite callsites = 3; 62 63 // Bytes allocated via malloc but not freed. 64 optional int64 profile_delta_bytes = 4; 65 // Bytes allocated via malloc irrespective of whether they were freed. 66 optional int64 profile_total_bytes = 5; 67 } 68 69 repeated InstanceStats instance_stats = 1; 70} 71