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. |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include <fstream> | 27 #include <fstream> |
28 #include <pthread.h> | 28 #include <pthread.h> |
29 #include <stdarg.h> | 29 #include <stdarg.h> |
30 #include <string> | 30 #include <string> |
31 #include <sys/stat.h> | 31 #include <sys/stat.h> |
32 #include <sys/syscall.h> | 32 #include <sys/syscall.h> |
33 #include <sys/time.h> | 33 #include <sys/time.h> |
34 #include <sys/types.h> | 34 #include <sys/types.h> |
35 #include <vector> | 35 #include <vector> |
36 | 36 |
37 #include "base/hash_tables.h" | 37 #include "base/containers/hash_tables.h" |
38 #include "base/lazy_instance.h" | 38 #include "base/lazy_instance.h" |
39 #include "base/logging.h" | 39 #include "base/logging.h" |
40 #include "base/memory/singleton.h" | 40 #include "base/memory/singleton.h" |
41 #include "base/synchronization/lock.h" | 41 #include "base/synchronization/lock.h" |
42 | 42 |
43 namespace cygprofile { | 43 namespace cygprofile { |
44 | 44 |
45 extern "C" { | 45 extern "C" { |
46 | 46 |
47 // Note that these are linked internally by the compiler. Don't call | 47 // Note that these are linked internally by the compiler. Don't call |
(...skipping 344 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 |