OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project 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 #include <stdarg.h> | 5 #include <stdarg.h> |
6 | 6 |
7 #include "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1077 void Logger::CodeDeoptEvent(Code* code) { | 1077 void Logger::CodeDeoptEvent(Code* code) { |
1078 if (!log_->IsEnabled()) return; | 1078 if (!log_->IsEnabled()) return; |
1079 ASSERT(FLAG_log_internal_timer_events); | 1079 ASSERT(FLAG_log_internal_timer_events); |
1080 Log::MessageBuilder msg(log_); | 1080 Log::MessageBuilder msg(log_); |
1081 int since_epoch = static_cast<int>(timer_.Elapsed().InMicroseconds()); | 1081 int since_epoch = static_cast<int>(timer_.Elapsed().InMicroseconds()); |
1082 msg.Append("code-deopt,%ld,%d\n", since_epoch, code->CodeSize()); | 1082 msg.Append("code-deopt,%ld,%d\n", since_epoch, code->CodeSize()); |
1083 msg.WriteToLogFile(); | 1083 msg.WriteToLogFile(); |
1084 } | 1084 } |
1085 | 1085 |
1086 | 1086 |
| 1087 void Logger::CurrentTimeEvent() { |
| 1088 if (!log_->IsEnabled()) return; |
| 1089 ASSERT(FLAG_log_internal_timer_events); |
| 1090 Log::MessageBuilder msg(log_); |
| 1091 int since_epoch = static_cast<int>(timer_.Elapsed().InMicroseconds()); |
| 1092 msg.Append("current-time,%ld\n", since_epoch); |
| 1093 msg.WriteToLogFile(); |
| 1094 } |
| 1095 |
| 1096 |
1087 void Logger::TimerEvent(StartEnd se, const char* name) { | 1097 void Logger::TimerEvent(StartEnd se, const char* name) { |
1088 if (!log_->IsEnabled()) return; | 1098 if (!log_->IsEnabled()) return; |
1089 ASSERT(FLAG_log_internal_timer_events); | 1099 ASSERT(FLAG_log_internal_timer_events); |
1090 Log::MessageBuilder msg(log_); | 1100 Log::MessageBuilder msg(log_); |
1091 int since_epoch = static_cast<int>(timer_.Elapsed().InMicroseconds()); | 1101 int since_epoch = static_cast<int>(timer_.Elapsed().InMicroseconds()); |
1092 const char* format = (se == START) ? "timer-event-start,\"%s\",%ld\n" | 1102 const char* format = (se == START) ? "timer-event-start,\"%s\",%ld\n" |
1093 : "timer-event-end,\"%s\",%ld\n"; | 1103 : "timer-event-end,\"%s\",%ld\n"; |
1094 msg.Append(format, name, since_epoch); | 1104 msg.Append(format, name, since_epoch); |
1095 msg.WriteToLogFile(); | 1105 msg.WriteToLogFile(); |
1096 } | 1106 } |
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2117 if (jit_logger_) { | 2127 if (jit_logger_) { |
2118 removeCodeEventListener(jit_logger_); | 2128 removeCodeEventListener(jit_logger_); |
2119 delete jit_logger_; | 2129 delete jit_logger_; |
2120 jit_logger_ = NULL; | 2130 jit_logger_ = NULL; |
2121 } | 2131 } |
2122 | 2132 |
2123 return log_->Close(); | 2133 return log_->Close(); |
2124 } | 2134 } |
2125 | 2135 |
2126 } } // namespace v8::internal | 2136 } } // namespace v8::internal |
OLD | NEW |