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 #ifndef SRC_PROFILING_MEMORY_UNWOUND_MESSAGES_H_ 18 #define SRC_PROFILING_MEMORY_UNWOUND_MESSAGES_H_ 19 20 #include <unwindstack/Maps.h> 21 #include <unwindstack/Unwinder.h> 22 23 #include "src/profiling/common/unwind_support.h" 24 #include "src/profiling/memory/wire_protocol.h" 25 26 namespace perfetto { 27 namespace profiling { 28 29 // Single allocation with an unwound callstack. 30 struct AllocRecord { 31 pid_t pid; 32 bool error = false; 33 bool reparsed_map = false; 34 uint64_t unwinding_time_us = 0; 35 uint64_t data_source_instance_id; 36 uint64_t timestamp; 37 AllocMetadata alloc_metadata; 38 std::vector<unwindstack::FrameData> frames; 39 std::vector<std::string> build_ids; 40 }; 41 42 // Batch of deallocations. 43 struct FreeRecord { 44 pid_t pid; 45 uint64_t data_source_instance_id; 46 uint64_t timestamp; 47 FreeEntry entry; 48 }; 49 50 struct HeapNameRecord { 51 pid_t pid; 52 uint64_t data_source_instance_id; 53 HeapName entry; 54 }; 55 56 } // namespace profiling 57 } // namespace perfetto 58 59 #endif // SRC_PROFILING_MEMORY_UNWOUND_MESSAGES_H_ 60