1 // Copyright 2019 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef BASE_PROFILER_FRAME_H_ 6 #define BASE_PROFILER_FRAME_H_ 7 8 #include "base/base_export.h" 9 #include "base/memory/raw_ptr.h" 10 #include "base/profiler/module_cache.h" 11 12 namespace base { 13 14 // Frame represents an individual sampled stack frame with full module 15 // information. 16 struct BASE_EXPORT Frame { 17 Frame(uintptr_t instruction_pointer, const ModuleCache::Module* module); 18 19 // The function name should only be populated by Android Java frames. 20 Frame(uintptr_t instruction_pointer, 21 const ModuleCache::Module* module, 22 std::string function_name); 23 ~Frame(); 24 25 // The sampled instruction pointer within the function. 26 uintptr_t instruction_pointer; 27 28 // The module information. 29 raw_ptr<const ModuleCache::Module, DanglingUntriaged> module; 30 31 // Function name associated with the frame. Currently populated only for 32 // Android Java frames. 33 std::string function_name; 34 }; 35 36 } // namespace base 37 38 #endif // BASE_PROFILER_FRAME_H_ 39