• Home
Name Date Size #Lines LOC

..--

DIR_METADATAD04-Jul-2025110 76

README.mdD04-Jul-20251.9 KiB3831

chrome_unwind_info_android_32.ccD04-Jul-20252.4 KiB6547

chrome_unwind_info_android_32.hD04-Jul-202510.1 KiB22740

chrome_unwind_info_android_32_unittest.ccD04-Jul-20253.6 KiB9973

chrome_unwinder_android_32.ccD04-Jul-202516.5 KiB421277

chrome_unwinder_android_32.hD04-Jul-20254.6 KiB11753

chrome_unwinder_android_32_unittest.ccD04-Jul-202556.8 KiB1,6641,317

frame.ccD04-Jul-2025643 2212

frame.hD04-Jul-20251.1 KiB3918

frame_pointer_unwinder.ccD04-Jul-20254.5 KiB13084

frame_pointer_unwinder.hD04-Jul-20251.5 KiB5534

frame_pointer_unwinder_unittest.ccD04-Jul-202512.5 KiB368302

libunwindstack_unwinder_android.ccD04-Jul-20259.1 KiB234179

libunwindstack_unwinder_android.hD04-Jul-20252.4 KiB5834

libunwindstack_unwinder_android_unittest.ccD04-Jul-20259.9 KiB245182

metadata_recorder.ccD04-Jul-20258 KiB217132

metadata_recorder.hD04-Jul-202513.2 KiB30180

metadata_recorder_unittest.ccD04-Jul-202510.7 KiB319254

module_cache.ccD04-Jul-20257.6 KiB194125

module_cache.hD04-Jul-20258.5 KiB20276

module_cache_apple.ccD04-Jul-20255 KiB158115

module_cache_posix.ccD04-Jul-20256 KiB170104

module_cache_unittest.ccD04-Jul-202518.6 KiB491354

module_cache_win.ccD04-Jul-20256 KiB178118

native_unwinder_android.ccD04-Jul-202510.2 KiB284218

native_unwinder_android.hD04-Jul-20254.1 KiB10052

native_unwinder_android_map_delegate.hD04-Jul-2025873 2712

native_unwinder_android_memory_regions_map.hD04-Jul-20251.3 KiB3314

native_unwinder_android_memory_regions_map_impl.ccD04-Jul-2025616 1710

native_unwinder_android_memory_regions_map_impl.hD04-Jul-20251.4 KiB4124

native_unwinder_android_unittest.ccD04-Jul-202520.4 KiB515397

native_unwinder_win.ccD04-Jul-20253.7 KiB9652

native_unwinder_win.hD04-Jul-2025973 3318

periodic_sampling_scheduler.ccD04-Jul-20251.4 KiB4630

periodic_sampling_scheduler.hD04-Jul-20251.7 KiB4924

periodic_sampling_scheduler_unittest.ccD04-Jul-20253.5 KiB9760

profile_builder.hD04-Jul-20252.9 KiB7231

register_context.hD04-Jul-20256.7 KiB243162

sample_metadata.ccD04-Jul-20254.7 KiB12799

sample_metadata.hD04-Jul-20257.1 KiB18662

sample_metadata_unittest.ccD04-Jul-20256.4 KiB152117

sampling_profiler_thread_token.ccD04-Jul-2025802 3120

sampling_profiler_thread_token.hD04-Jul-20251.4 KiB4323

stack_base_address_posix.ccD04-Jul-20253.7 KiB10569

stack_base_address_posix.hD04-Jul-20251.1 KiB3613

stack_base_address_posix_unittest.ccD04-Jul-20251.7 KiB5133

stack_buffer.ccD04-Jul-20252.8 KiB7941

stack_buffer.hD04-Jul-20252.6 KiB7229

stack_buffer_unittest.ccD04-Jul-20252.7 KiB8355

stack_copier.ccD04-Jul-20254.7 KiB12580

stack_copier.hD04-Jul-20254.7 KiB11141

stack_copier_signal.ccD04-Jul-202510.7 KiB301194

stack_copier_signal.hD04-Jul-20251.2 KiB4425

stack_copier_signal_unittest.ccD04-Jul-20258.3 KiB240177

stack_copier_suspend.ccD04-Jul-20253.1 KiB8548

stack_copier_suspend.hD04-Jul-20251.2 KiB4425

stack_copier_suspend_unittest.ccD04-Jul-20259.7 KiB263200

stack_copier_unittest.ccD04-Jul-202511 KiB289189

stack_sampler.ccD04-Jul-202514.5 KiB382261

stack_sampler.hD04-Jul-20257.1 KiB18598

stack_sampler_android.ccD04-Jul-20251.6 KiB4935

stack_sampler_ios.ccD04-Jul-20251.9 KiB6849

stack_sampler_mac.ccD04-Jul-20251.7 KiB5435

stack_sampler_posix.ccD04-Jul-20252.2 KiB7556

stack_sampler_unittest.ccD04-Jul-202522.5 KiB598448

stack_sampler_win.ccD04-Jul-20251.8 KiB5235

stack_sampling_profiler.ccD04-Jul-202536.7 KiB976613

stack_sampling_profiler.hD04-Jul-20259.3 KiB23082

stack_sampling_profiler_java_test_util.ccD04-Jul-20251.3 KiB4728

stack_sampling_profiler_java_test_util.hD04-Jul-2025704 208

stack_sampling_profiler_test_util.ccD04-Jul-202517 KiB492374

stack_sampling_profiler_test_util.hD04-Jul-20256.5 KiB194107

stack_sampling_profiler_unittest.ccD04-Jul-202570.3 KiB1,8131,272

stack_unwind_data.ccD04-Jul-20252.5 KiB7353

stack_unwind_data.hD04-Jul-20252.2 KiB7244

suspendable_thread_delegate.hD04-Jul-20252.2 KiB6024

suspendable_thread_delegate_mac.ccD04-Jul-20255.1 KiB14595

suspendable_thread_delegate_mac.hD04-Jul-20252.2 KiB6844

suspendable_thread_delegate_win.ccD04-Jul-20258.7 KiB246150

suspendable_thread_delegate_win.hD04-Jul-20252.1 KiB7047

test_support_library.ccD04-Jul-2025905 3317

thread_delegate.hD04-Jul-20251.4 KiB4420

thread_delegate_posix.ccD04-Jul-20254.6 KiB11889

thread_delegate_posix.hD04-Jul-20251.3 KiB4627

thread_delegate_posix_unittest.ccD04-Jul-20251.7 KiB5033

thread_group_profiler_client.hD04-Jul-20251.7 KiB5126

unwinder.ccD04-Jul-2025491 2111

unwinder.hD04-Jul-20254.7 KiB11641

win32_stack_frame_unwinder.ccD04-Jul-20255 KiB14589

win32_stack_frame_unwinder.hD04-Jul-20252.7 KiB8956

win32_stack_frame_unwinder_unittest.ccD04-Jul-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