OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // For performance reasons logs are buffered. Every thread has its own buffer | 8 // For performance reasons logs are buffered. Every thread has its own buffer |
9 // and log file so the contention between threads is minimal. As a side-effect, | 9 // and log file so the contention between threads is minimal. As a side-effect, |
10 // functions called might be mentioned in many thread logs. | 10 // functions called might be mentioned in many thread logs. |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 | 149 |
150 // Used to make the internal thread sleep before each flush iteration. | 150 // Used to make the internal thread sleep before each flush iteration. |
151 const base::Closure wait_callback_; | 151 const base::Closure wait_callback_; |
152 // Used to trigger a notification when a flush happened on the internal | 152 // Used to trigger a notification when a flush happened on the internal |
153 // thread. | 153 // thread. |
154 const base::Closure notify_callback_; | 154 const base::Closure notify_callback_; |
155 | 155 |
156 // Protects the state below. | 156 // Protects the state below. |
157 base::Lock lock_; | 157 base::Lock lock_; |
158 std::unique_ptr<Thread> flush_thread_; | 158 std::unique_ptr<Thread> flush_thread_; |
159 std::vector<ThreadLog*> logs_; | 159 std::vector<std::unique_ptr<ThreadLog>> logs_; |
160 | 160 |
161 DISALLOW_COPY_AND_ASSIGN(ThreadLogsManager); | 161 DISALLOW_COPY_AND_ASSIGN(ThreadLogsManager); |
162 }; | 162 }; |
163 | 163 |
164 } // namespace cygprofile | 164 } // namespace cygprofile |
165 | 165 |
166 #endif // TOOLS_CYGPROFILE_CYGPROFILE_H_ | 166 #endif // TOOLS_CYGPROFILE_CYGPROFILE_H_ |
OLD | NEW |