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.
5 #ifndef BASE_PROFILER_FRAME_H_
6 #define BASE_PROFILER_FRAME_H_
8 #include "base/base_export.h"
9 #include "base/memory/raw_ptr_exclusion.h"
10 #include "base/profiler/module_cache.h"
14 // Frame represents an individual sampled stack frame with full module
16 struct BASE_EXPORT Frame {
17 Frame(uintptr_t instruction_pointer, const ModuleCache::Module* module);
19 // TODO(crbug.com/1371105): For prototype use by Android arm browser main
20 // thread profiling for tracing only. Update once we have a full design
21 // for function name upload.
22 Frame(uintptr_t instruction_pointer,
23 const ModuleCache::Module* module,
24 std::string function_name);
27 // The sampled instruction pointer within the function.
28 uintptr_t instruction_pointer;
30 // The module information.
31 // `module` is not a raw_ptr<...> because it is used with gmock Field() that
32 // expects a raw pointer in V8UnwinderTest.UnwindThroughV8Frames.
33 RAW_PTR_EXCLUSION const ModuleCache::Module* module;
35 // This serves as a temporary way to pass function names from libunwindstack
36 // unwinder to tracing profiler. Not used by any other unwinder.
37 // TODO(crbug.com/1371105): For prototype use by Android arm browser main
38 // thread profiling for tracing only. Update once we have a full design
39 // for function name upload.
40 std::string function_name;
45 #endif // BASE_PROFILER_FRAME_H_