OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // Tool to log the execution of the process (Chrome). Writes logs containing | 5 // Tool to log the execution of the process (Chrome). Writes logs containing |
6 // time and address of the callback being called for the first time. | 6 // time and address of the callback being called for the first time. |
7 // | 7 // |
8 // To speed up the logging, buffering logs is implemented. Every thread have its | 8 // To speed up the logging, buffering logs is implemented. Every thread have its |
9 // own buffer and log file so the contention between threads is minimal. As a | 9 // own buffer and log file so the contention between threads is minimal. As a |
10 // side-effect, functions called might be mentioned in many thread logs. | 10 // side-effect, functions called might be mentioned in many thread logs. |
11 // | 11 // |
12 // Special thread is created in the process to periodically flushes logs for all | 12 // Special thread is created in the process to periodically flushes logs for all |
13 // threads for the case the thread has stopped before flushing its logs. | 13 // threads for the case the thread has stopped before flushing its logs. |
14 // | 14 // |
15 // Use this profiler with linux_use_tcmalloc=0. | 15 // Use this profiler with use_allocator!="none". |
16 // | 16 // |
17 // Note for the ChromeOS Chrome. Remove renderer process from the sandbox (add | 17 // Note for the ChromeOS Chrome. Remove renderer process from the sandbox (add |
18 // --no-sandbox option to running Chrome in /sbin/session_manager_setup.sh). | 18 // --no-sandbox option to running Chrome in /sbin/session_manager_setup.sh). |
19 // Otherwise renderer will not be able to write logs (and will assert on that). | 19 // Otherwise renderer will not be able to write logs (and will assert on that). |
20 // | 20 // |
21 // Also note that the instrumentation code is self-activated. It begins to | 21 // Also note that the instrumentation code is self-activated. It begins to |
22 // record the log data when it is called first, including the run-time startup. | 22 // record the log data when it is called first, including the run-time startup. |
23 // Have it in mind when modifying it, in particular do not use global objects | 23 // Have it in mind when modifying it, in particular do not use global objects |
24 // with constructors as they are called during startup (too late for us). | 24 // with constructors as they are called during startup (too late for us). |
25 | 25 |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 tls_current_log->LogEnter(this_fn); | 392 tls_current_log->LogEnter(this_fn); |
393 } | 393 } |
394 } | 394 } |
395 | 395 |
396 // Gcc Compiler callback, called after every function invocation providing | 396 // Gcc Compiler callback, called after every function invocation providing |
397 // addresses of caller and callee codes. | 397 // addresses of caller and callee codes. |
398 void __cyg_profile_func_exit(void* this_fn, void* call_site) { | 398 void __cyg_profile_func_exit(void* this_fn, void* call_site) { |
399 } | 399 } |
400 | 400 |
401 } // namespace cygprofile | 401 } // namespace cygprofile |
OLD | NEW |