Name Date Size #Lines LOC

..--

DIR_METADATAH A D25-Apr-2025110 76

README.mdH A D25-Apr-20251.9 KiB3831

chrome_unwind_info_android.ccH A D25-Apr-20252.4 KiB6447

chrome_unwind_info_android.hH A D25-Apr-202510 KiB22539

chrome_unwind_info_android_unittest.ccH A D25-Apr-20253.3 KiB8965

chrome_unwinder_android.ccH A D25-Apr-202516.4 KiB412270

chrome_unwinder_android.hH A D25-Apr-20254.5 KiB11652

chrome_unwinder_android_unittest.ccH A D25-Apr-202556.3 KiB1,6451,300

frame.ccH A D25-Apr-2025643 2212

frame.hH A D25-Apr-20251.5 KiB4618

frame_pointer_unwinder.ccH A D25-Apr-20254.2 KiB11674

frame_pointer_unwinder.hH A D25-Apr-20251.2 KiB4526

frame_pointer_unwinder_unittest.ccH A D25-Apr-202510.9 KiB336273

libunwindstack_unwinder_android.ccH A D25-Apr-20258.6 KiB221169

libunwindstack_unwinder_android.hH A D25-Apr-20252.3 KiB5733

libunwindstack_unwinder_android_unittest.ccH A D25-Apr-202510 KiB239176

metadata_recorder.ccH A D25-Apr-20258 KiB217132

metadata_recorder.hH A D25-Apr-202513.1 KiB29979

metadata_recorder_unittest.ccH A D25-Apr-202510.7 KiB319254

module_cache.ccH A D25-Apr-20257.6 KiB194125

module_cache.hH A D25-Apr-20258.5 KiB20276

module_cache_apple.ccH A D25-Apr-20254.9 KiB153112

module_cache_posix.ccH A D25-Apr-20256.1 KiB170104

module_cache_unittest.ccH A D25-Apr-202518.6 KiB491354

module_cache_win.ccH A D25-Apr-20256 KiB178118

native_unwinder_android.ccH A D25-Apr-202511.6 KiB313243

native_unwinder_android.hH A D25-Apr-20254.2 KiB10153

native_unwinder_android_map_delegate.hH A D25-Apr-2025873 2712

native_unwinder_android_memory_regions_map.hH A D25-Apr-20251.3 KiB3314

native_unwinder_android_memory_regions_map_impl.ccH A D25-Apr-2025616 1710

native_unwinder_android_memory_regions_map_impl.hH A D25-Apr-20251.4 KiB4124

native_unwinder_android_unittest.ccH A D25-Apr-202521.2 KiB534415

native_unwinder_win.ccH A D25-Apr-20253.7 KiB9652

native_unwinder_win.hH A D25-Apr-2025911 3217

profile_builder.hH A D25-Apr-20252.9 KiB7231

register_context.hH A D25-Apr-20256.6 KiB238159

sample_metadata.ccH A D25-Apr-20254.7 KiB12799

sample_metadata.hH A D25-Apr-20257.1 KiB18662

sample_metadata_unittest.ccH A D25-Apr-20256.4 KiB152117

sampling_profiler_thread_token.ccH A D25-Apr-2025802 3120

sampling_profiler_thread_token.hH A D25-Apr-20251.4 KiB4323

stack_base_address_posix.ccH A D25-Apr-20253.7 KiB10569

stack_base_address_posix.hH A D25-Apr-20251.1 KiB3613

stack_base_address_posix_unittest.ccH A D25-Apr-20251.7 KiB5133

stack_buffer.ccH A D25-Apr-20252.6 KiB7438

stack_buffer.hH A D25-Apr-20252.6 KiB7229

stack_buffer_unittest.ccH A D25-Apr-20252.6 KiB7852

stack_copier.ccH A D25-Apr-20252.8 KiB7544

stack_copier.hH A D25-Apr-20254.1 KiB9735

stack_copier_signal.ccH A D25-Apr-202510.6 KiB299193

stack_copier_signal.hH A D25-Apr-20251.1 KiB4022

stack_copier_signal_unittest.ccH A D25-Apr-20258.2 KiB235174

stack_copier_suspend.ccH A D25-Apr-20252.9 KiB8044

stack_copier_suspend.hH A D25-Apr-20251.1 KiB4022

stack_copier_suspend_unittest.ccH A D25-Apr-20259.6 KiB258197

stack_copier_unittest.ccH A D25-Apr-20259 KiB236146

stack_sampler.ccH A D25-Apr-20259.8 KiB263169

stack_sampler.hH A D25-Apr-20256.3 KiB16588

stack_sampler_android.ccH A D25-Apr-20251.6 KiB4935

stack_sampler_ios.ccH A D25-Apr-20251.9 KiB6849

stack_sampler_mac.ccH A D25-Apr-20251.6 KiB5435

stack_sampler_posix.ccH A D25-Apr-20252.2 KiB7556

stack_sampler_unittest.ccH A D25-Apr-202519.9 KiB539402

stack_sampler_win.ccH A D25-Apr-20251.7 KiB5235

stack_sampling_profiler.ccH A D25-Apr-202536.5 KiB959594

stack_sampling_profiler.hH A D25-Apr-20259.6 KiB23583

stack_sampling_profiler_java_test_util.ccH A D25-Apr-20251.3 KiB4528

stack_sampling_profiler_java_test_util.hH A D25-Apr-2025704 208

stack_sampling_profiler_test_util.ccH A D25-Apr-202517.7 KiB505387

stack_sampling_profiler_test_util.hH A D25-Apr-20256.7 KiB198109

stack_sampling_profiler_unittest.ccH A D25-Apr-202570 KiB1,8031,264

suspendable_thread_delegate.hH A D25-Apr-20252.2 KiB6024

suspendable_thread_delegate_mac.ccH A D25-Apr-20255 KiB14092

suspendable_thread_delegate_mac.hH A D25-Apr-20252.2 KiB6844

suspendable_thread_delegate_win.ccH A D25-Apr-20258.7 KiB246150

suspendable_thread_delegate_win.hH A D25-Apr-20252.1 KiB7047

test_support_library.ccH A D25-Apr-2025905 3317

thread_delegate.hH A D25-Apr-20251.4 KiB4420

thread_delegate_posix.ccH A D25-Apr-20254.5 KiB11386

thread_delegate_posix.hH A D25-Apr-20251.3 KiB4627

thread_delegate_posix_unittest.ccH A D25-Apr-20251.7 KiB5033

unwinder.ccH A D25-Apr-2025333 157

unwinder.hH A D25-Apr-20253.9 KiB10035

win32_stack_frame_unwinder.ccH A D25-Apr-20255 KiB14791

win32_stack_frame_unwinder.hH A D25-Apr-20252.7 KiB8956

win32_stack_frame_unwinder_unittest.ccH A D25-Apr-20257.1 KiB207154

README.md

1# What is this?
2
3//base/profiler implements a
4[statistical profiler](https://en.wikipedia.org/wiki/Profiling_(computer_programming)#Statistical_profilers)
5for Chrome execution. It supports periodic sampling of thread stacks for the
6purpose of understanding how frequently different parts of the Chrome code are
7being executed. The profiler is used to collect execution information by UMA,
8for broad-scale profiling, and by Chrometto, for targeted profiling during
9tracing.
10
11
12## Technical Overview
13
14The primary entry point to this code is
15[StackSamplingProfiler](stack_sampling_profiler.h). This class regularly
16records the list of currently executing functions on a target thread. See
17the comments above that function for an overview of how to use the profiler.
18
19The details are very platform-specific, but the major sub-components are
20
21* A dedicated thread is created to periodically wake up and sample the target
22  thread. At each wake up:
23  * A [StackCopier](stack_copier.h) copies the target thread's stack
24    memory into a [StackBuffer](stack_buffer.h).
25  * One or more [Unwinders](unwinder.h) take the memory blob in the StackBuffer
26    and turn it into a list of function [Frames](frame.h). Every platform has
27    a native unwinder to deal with C++ frames; there are also unwinders for
28    V8's special frame layout and for Java frames.
29  * Frames have the function instruction address and some module information
30    from [ModuleCache](module_cache.h). This should be enough for a program
31    with access to the original debug information to reconstruct the names of
32    the functions in the stack. The actual conversion back to human-readable
33    names is not part of this directory's code.
34  * A subclass of [ProfileBuilder](profile_builder.h) is called with a vector
35    of Frames corresponding to one stack. The various users of this code are
36    responsible for implementing this subclass and recording the stacks in the
37    manner they see fit.
38