• Home
Name Date Size #Lines LOC

..--

README.mdD03-May-20241.9 KiB3831

chrome_unwind_info_android.ccD03-May-20242.4 KiB6447

chrome_unwind_info_android.hD03-May-202410 KiB22539

chrome_unwind_info_android_unittest.ccD03-May-20243.3 KiB8965

chrome_unwinder_android.ccD03-May-202416.4 KiB414272

chrome_unwinder_android.hD03-May-20244.5 KiB11552

chrome_unwinder_android_unittest.ccD03-May-202457.7 KiB1,6441,300

frame.ccD03-May-2024643 2212

frame.hD03-May-20241.5 KiB4618

frame_pointer_unwinder.ccD03-May-20243.9 KiB10871

frame_pointer_unwinder.hD03-May-20241.2 KiB4526

frame_pointer_unwinder_unittest.ccD03-May-202410.9 KiB336273

libunwindstack_unwinder_android.ccD03-May-20247.1 KiB187140

libunwindstack_unwinder_android.hD03-May-20242.6 KiB5933

libunwindstack_unwinder_android_unittest.ccD03-May-20249.9 KiB237175

metadata_recorder.ccD03-May-20248.1 KiB216132

metadata_recorder.hD03-May-202413.2 KiB29979

metadata_recorder_unittest.ccD03-May-202410.7 KiB318254

module_cache.ccD03-May-20247.6 KiB193124

module_cache.hD03-May-20248.5 KiB20276

module_cache_mac.ccD03-May-20244.9 KiB150109

module_cache_posix.ccD03-May-20246.1 KiB169104

module_cache_unittest.ccD03-May-202418.9 KiB495357

module_cache_win.ccD03-May-20246 KiB177118

native_unwinder_android.ccD03-May-202410.4 KiB286217

native_unwinder_android.hD03-May-20243.6 KiB8945

native_unwinder_android_map_delegate.hD03-May-2024873 2712

native_unwinder_android_memory_regions_map.hD03-May-20241.5 KiB4322

native_unwinder_android_unittest.ccD03-May-202420.8 KiB506381

native_unwinder_win.ccD03-May-20243.7 KiB9652

native_unwinder_win.hD03-May-2024911 3217

profile_builder.hD03-May-20242.9 KiB7231

register_context.hD03-May-20246.6 KiB238159

sample_metadata.ccD03-May-20244.5 KiB127100

sample_metadata.hD03-May-20247.1 KiB18562

sample_metadata_unittest.ccD03-May-20245.1 KiB126101

sampling_profiler_thread_token.ccD03-May-2024803 3120

sampling_profiler_thread_token.hD03-May-20241.4 KiB4223

stack_base_address_posix.ccD03-May-20243.7 KiB10569

stack_base_address_posix.hD03-May-20241.1 KiB3513

stack_base_address_posix_unittest.ccD03-May-20241.7 KiB5133

stack_buffer.ccD03-May-20242.6 KiB7237

stack_buffer.hD03-May-20242.6 KiB7229

stack_buffer_unittest.ccD03-May-20242.6 KiB7852

stack_copier.ccD03-May-20242.8 KiB7544

stack_copier.hD03-May-20244.1 KiB9735

stack_copier_signal.ccD03-May-20249 KiB267178

stack_copier_signal.hD03-May-20241.1 KiB4022

stack_copier_signal_unittest.ccD03-May-20248.3 KiB238176

stack_copier_suspend.ccD03-May-20242.9 KiB8044

stack_copier_suspend.hD03-May-20241.1 KiB4022

stack_copier_suspend_unittest.ccD03-May-20249.6 KiB258197

stack_copier_unittest.ccD03-May-20249 KiB236146

stack_sampler.ccD03-May-20249.8 KiB263169

stack_sampler.hD03-May-20246.3 KiB16588

stack_sampler_android.ccD03-May-20241.6 KiB4935

stack_sampler_ios.ccD03-May-20241.9 KiB6849

stack_sampler_mac.ccD03-May-20241.6 KiB5435

stack_sampler_posix.ccD03-May-20242.1 KiB7253

stack_sampler_unittest.ccD03-May-202419.9 KiB539402

stack_sampler_win.ccD03-May-20241.7 KiB5235

stack_sampling_profiler.ccD03-May-202436.5 KiB959594

stack_sampling_profiler.hD03-May-20249.5 KiB23684

stack_sampling_profiler_java_test_util.ccD03-May-20241.3 KiB4528

stack_sampling_profiler_java_test_util.hD03-May-2024704 208

stack_sampling_profiler_test_util.ccD03-May-202417.5 KiB503385

stack_sampling_profiler_test_util.hD03-May-20246.8 KiB201110

stack_sampling_profiler_unittest.ccD03-May-202469.8 KiB1,7991,262

suspendable_thread_delegate.hD03-May-20242.2 KiB6024

suspendable_thread_delegate_mac.ccD03-May-20245 KiB14092

suspendable_thread_delegate_mac.hD03-May-20242.2 KiB6844

suspendable_thread_delegate_win.ccD03-May-20248.7 KiB244150

suspendable_thread_delegate_win.hD03-May-20242.1 KiB6947

test_support_library.ccD03-May-2024905 3317

thread_delegate.hD03-May-20241.4 KiB4420

thread_delegate_posix.ccD03-May-20244.5 KiB11286

thread_delegate_posix.hD03-May-20241.3 KiB4627

thread_delegate_posix_unittest.ccD03-May-20241.7 KiB5033

unwinder.ccD03-May-2024333 157

unwinder.hD03-May-20244.1 KiB10235

win32_stack_frame_unwinder.ccD03-May-20245 KiB14690

win32_stack_frame_unwinder.hD03-May-20242.7 KiB8956

win32_stack_frame_unwinder_unittest.ccD03-May-20247.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