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 "src/log.h" | 5 #include "src/log.h" |
6 | 6 |
7 #include <cstdarg> | 7 #include <cstdarg> |
8 #include <sstream> | 8 #include <sstream> |
9 | 9 |
10 #include "src/v8.h" | 10 #include "src/v8.h" |
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
897 if (!log_->IsEnabled() || !FLAG_log_internal_timer_events) return; | 897 if (!log_->IsEnabled() || !FLAG_log_internal_timer_events) return; |
898 Log::MessageBuilder msg(log_); | 898 Log::MessageBuilder msg(log_); |
899 int since_epoch = static_cast<int>(timer_.Elapsed().InMicroseconds()); | 899 int since_epoch = static_cast<int>(timer_.Elapsed().InMicroseconds()); |
900 msg.Append("code-deopt,%ld,%d", since_epoch, code->CodeSize()); | 900 msg.Append("code-deopt,%ld,%d", since_epoch, code->CodeSize()); |
901 msg.WriteToLogFile(); | 901 msg.WriteToLogFile(); |
902 } | 902 } |
903 | 903 |
904 | 904 |
905 void Logger::CurrentTimeEvent() { | 905 void Logger::CurrentTimeEvent() { |
906 if (!log_->IsEnabled()) return; | 906 if (!log_->IsEnabled()) return; |
907 DCHECK(FLAG_log_internal_timer_events); | 907 DCHECK(FLAG_log_timer_events || FLAG_prof_cpp); |
908 Log::MessageBuilder msg(log_); | 908 Log::MessageBuilder msg(log_); |
909 int since_epoch = static_cast<int>(timer_.Elapsed().InMicroseconds()); | 909 int since_epoch = static_cast<int>(timer_.Elapsed().InMicroseconds()); |
910 msg.Append("current-time,%ld", since_epoch); | 910 msg.Append("current-time,%ld", since_epoch); |
911 msg.WriteToLogFile(); | 911 msg.WriteToLogFile(); |
912 } | 912 } |
913 | 913 |
914 | 914 |
915 void Logger::TimerEvent(Logger::StartEnd se, const char* name) { | 915 void Logger::TimerEvent(Logger::StartEnd se, const char* name) { |
916 if (!log_->IsEnabled()) return; | 916 if (!log_->IsEnabled()) return; |
917 DCHECK(FLAG_log_internal_timer_events); | 917 DCHECK(FLAG_log_internal_timer_events); |
(...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1915 if (jit_logger_) { | 1915 if (jit_logger_) { |
1916 removeCodeEventListener(jit_logger_); | 1916 removeCodeEventListener(jit_logger_); |
1917 delete jit_logger_; | 1917 delete jit_logger_; |
1918 jit_logger_ = NULL; | 1918 jit_logger_ = NULL; |
1919 } | 1919 } |
1920 | 1920 |
1921 return log_->Close(); | 1921 return log_->Close(); |
1922 } | 1922 } |
1923 | 1923 |
1924 } } // namespace v8::internal | 1924 } } // namespace v8::internal |
OLD | NEW |