| 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/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
| (...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 659 | 659 |
| 660 | 660 |
| 661 void Profiler::Engage() { | 661 void Profiler::Engage() { |
| 662 if (engaged_) return; | 662 if (engaged_) return; |
| 663 engaged_ = true; | 663 engaged_ = true; |
| 664 | 664 |
| 665 std::vector<base::OS::SharedLibraryAddress> addresses = | 665 std::vector<base::OS::SharedLibraryAddress> addresses = |
| 666 base::OS::GetSharedLibraryAddresses(); | 666 base::OS::GetSharedLibraryAddresses(); |
| 667 for (size_t i = 0; i < addresses.size(); ++i) { | 667 for (size_t i = 0; i < addresses.size(); ++i) { |
| 668 LOG(isolate_, SharedLibraryEvent( | 668 LOG(isolate_, SharedLibraryEvent( |
| 669 addresses[i].library_path, addresses[i].start, addresses[i].end)); | 669 addresses[i].library_path, addresses[i].start, addresses[i].end, |
| 670 addresses[i].slide)); |
| 670 } | 671 } |
| 671 | 672 |
| 672 // Start thread processing the profiler buffer. | 673 // Start thread processing the profiler buffer. |
| 673 base::NoBarrier_Store(&running_, 1); | 674 base::NoBarrier_Store(&running_, 1); |
| 674 Start(); | 675 Start(); |
| 675 | 676 |
| 676 // Register to get ticks. | 677 // Register to get ticks. |
| 677 Logger* logger = isolate_->logger(); | 678 Logger* logger = isolate_->logger(); |
| 678 logger->ticker_->SetProfiler(this); | 679 logger->ticker_->SetProfiler(this); |
| 679 | 680 |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 821 | 822 |
| 822 | 823 |
| 823 void Logger::ApiSecurityCheck() { | 824 void Logger::ApiSecurityCheck() { |
| 824 if (!log_->IsEnabled() || !FLAG_log_api) return; | 825 if (!log_->IsEnabled() || !FLAG_log_api) return; |
| 825 ApiEvent("api,check-security"); | 826 ApiEvent("api,check-security"); |
| 826 } | 827 } |
| 827 | 828 |
| 828 | 829 |
| 829 void Logger::SharedLibraryEvent(const std::string& library_path, | 830 void Logger::SharedLibraryEvent(const std::string& library_path, |
| 830 uintptr_t start, | 831 uintptr_t start, |
| 831 uintptr_t end) { | 832 uintptr_t end, |
| 833 uintptr_t slide) { |
| 832 if (!log_->IsEnabled() || !FLAG_prof_cpp) return; | 834 if (!log_->IsEnabled() || !FLAG_prof_cpp) return; |
| 833 Log::MessageBuilder msg(log_); | 835 Log::MessageBuilder msg(log_); |
| 834 msg.Append("shared-library,\"%s\",0x%08" V8PRIxPTR ",0x%08" V8PRIxPTR, | 836 msg.Append("shared-library,\"%s\",0x%08" V8PRIxPTR ",0x%08" V8PRIxPTR |
| 835 library_path.c_str(), start, end); | 837 ",0x%08" V8PRIxPTR, |
| 838 library_path.c_str(), start, end, slide); |
| 836 msg.WriteToLogFile(); | 839 msg.WriteToLogFile(); |
| 837 } | 840 } |
| 838 | 841 |
| 839 | 842 |
| 840 void Logger::CodeDeoptEvent(Code* code, Address pc, int fp_to_sp_delta) { | 843 void Logger::CodeDeoptEvent(Code* code, Address pc, int fp_to_sp_delta) { |
| 841 PROFILER_LOG(CodeDeoptEvent(code, pc, fp_to_sp_delta)); | 844 PROFILER_LOG(CodeDeoptEvent(code, pc, fp_to_sp_delta)); |
| 842 if (!log_->IsEnabled() || !FLAG_log_internal_timer_events) return; | 845 if (!log_->IsEnabled() || !FLAG_log_internal_timer_events) return; |
| 843 Log::MessageBuilder msg(log_); | 846 Log::MessageBuilder msg(log_); |
| 844 int since_epoch = static_cast<int>(timer_.Elapsed().InMicroseconds()); | 847 int since_epoch = static_cast<int>(timer_.Elapsed().InMicroseconds()); |
| 845 msg.Append("code-deopt,%d,%d", since_epoch, code->CodeSize()); | 848 msg.Append("code-deopt,%d,%d", since_epoch, code->CodeSize()); |
| (...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1850 removeCodeEventListener(jit_logger_); | 1853 removeCodeEventListener(jit_logger_); |
| 1851 delete jit_logger_; | 1854 delete jit_logger_; |
| 1852 jit_logger_ = NULL; | 1855 jit_logger_ = NULL; |
| 1853 } | 1856 } |
| 1854 | 1857 |
| 1855 return log_->Close(); | 1858 return log_->Close(); |
| 1856 } | 1859 } |
| 1857 | 1860 |
| 1858 } // namespace internal | 1861 } // namespace internal |
| 1859 } // namespace v8 | 1862 } // namespace v8 |
| OLD | NEW |