Chromium Code Reviews| Index: src/log.h |
| diff --git a/src/log.h b/src/log.h |
| index 33f359a7f996be80842fe7a6d6e7f685ed68ac03..ce5064df8c1e66d733d8d63c33a4e5917a94caef 100644 |
| --- a/src/log.h |
| +++ b/src/log.h |
| @@ -274,6 +274,25 @@ class Logger { |
| void SharedLibraryEvent(const wchar_t* library_path, |
| uintptr_t start, |
| uintptr_t end); |
| + void TimerEvent(const char* name, int64_t start, int64_t end); |
| + |
| + class TimerEventScope { |
| + public: |
| + TimerEventScope(Logger* logger, const char* name) |
| + : logger_(logger), name_(name), start_(0) { |
| + if (FLAG_log_timer_events) start_ = OS::Ticks(); |
| + } |
| + |
| + ~TimerEventScope() { |
| + if (FLAG_log_timer_events) { |
| + logger_->TimerEvent(name_, start_, OS::Ticks()); |
| + } |
| + } |
| + |
| + Logger* logger_; |
|
Jakob Kummerow
2012/11/22 10:56:08
"private:"?
Yang
2012/11/22 13:04:20
Done.
|
| + const char* name_; |
| + int64_t start_; |
| + }; |
| // ==== Events logged by --log-regexp ==== |
| // Regexp compilation and execution events. |
| @@ -449,6 +468,8 @@ class Logger { |
| // Logger::FunctionCreateEvent(...) |
| Address prev_code_; |
| + int64_t epoch_; |
| + |
| friend class CpuProfiler; |
| }; |