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 <memory> | 8 #include <memory> |
9 #include <sstream> | 9 #include <sstream> |
10 | 10 |
11 #include "include/v8-tracing.h" | |
11 #include "src/bailout-reason.h" | 12 #include "src/bailout-reason.h" |
12 #include "src/base/platform/platform.h" | 13 #include "src/base/platform/platform.h" |
13 #include "src/bootstrapper.h" | 14 #include "src/bootstrapper.h" |
14 #include "src/code-stubs.h" | 15 #include "src/code-stubs.h" |
15 #include "src/counters.h" | 16 #include "src/counters.h" |
16 #include "src/deoptimizer.h" | 17 #include "src/deoptimizer.h" |
17 #include "src/global-handles.h" | 18 #include "src/global-handles.h" |
18 #include "src/interpreter/bytecodes.h" | 19 #include "src/interpreter/bytecodes.h" |
19 #include "src/interpreter/interpreter.h" | 20 #include "src/interpreter/interpreter.h" |
20 #include "src/libsampler/sampler.h" | 21 #include "src/libsampler/sampler.h" |
(...skipping 1255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1276 RuntimeCallCounter* counter = timer->counter(); | 1277 RuntimeCallCounter* counter = timer->counter(); |
1277 if (counter == nullptr) return; | 1278 if (counter == nullptr) return; |
1278 Log::MessageBuilder msg(log_); | 1279 Log::MessageBuilder msg(log_); |
1279 msg.Append("active-runtime-timer,"); | 1280 msg.Append("active-runtime-timer,"); |
1280 msg.AppendDoubleQuotedString(counter->name); | 1281 msg.AppendDoubleQuotedString(counter->name); |
1281 msg.WriteToLogFile(); | 1282 msg.WriteToLogFile(); |
1282 } | 1283 } |
1283 | 1284 |
1284 void Logger::TickEvent(v8::TickSample* sample, bool overflow) { | 1285 void Logger::TickEvent(v8::TickSample* sample, bool overflow) { |
1285 if (!log_->IsEnabled() || !FLAG_prof_cpp) return; | 1286 if (!log_->IsEnabled() || !FLAG_prof_cpp) return; |
1286 if (FLAG_runtime_call_stats) { | 1287 if (V8_UNLIKELY(FLAG_runtime_stats == |
alph
2016/10/31 20:43:54
ditto
lpy
2016/10/31 20:54:19
No we don't want to print counters if tracing is e
| |
1288 v8::tracing::TracingCategoryObserver::ENABLED_BY_NATIVE)) { | |
1287 RuntimeCallTimerEvent(); | 1289 RuntimeCallTimerEvent(); |
1288 } | 1290 } |
1289 Log::MessageBuilder msg(log_); | 1291 Log::MessageBuilder msg(log_); |
1290 msg.Append("%s,", kLogEventsNames[CodeEventListener::TICK_EVENT]); | 1292 msg.Append("%s,", kLogEventsNames[CodeEventListener::TICK_EVENT]); |
1291 msg.AppendAddress(reinterpret_cast<Address>(sample->pc)); | 1293 msg.AppendAddress(reinterpret_cast<Address>(sample->pc)); |
1292 msg.Append(",%d", static_cast<int>(timer_.Elapsed().InMicroseconds())); | 1294 msg.Append(",%d", static_cast<int>(timer_.Elapsed().InMicroseconds())); |
1293 if (sample->has_external_callback) { | 1295 if (sample->has_external_callback) { |
1294 msg.Append(",1,"); | 1296 msg.Append(",1,"); |
1295 msg.AppendAddress( | 1297 msg.AppendAddress( |
1296 reinterpret_cast<Address>(sample->external_callback_entry)); | 1298 reinterpret_cast<Address>(sample->external_callback_entry)); |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1777 | 1779 |
1778 if (profiler_listener_.get() != nullptr) { | 1780 if (profiler_listener_.get() != nullptr) { |
1779 removeCodeEventListener(profiler_listener_.get()); | 1781 removeCodeEventListener(profiler_listener_.get()); |
1780 } | 1782 } |
1781 | 1783 |
1782 return log_->Close(); | 1784 return log_->Close(); |
1783 } | 1785 } |
1784 | 1786 |
1785 } // namespace internal | 1787 } // namespace internal |
1786 } // namespace v8 | 1788 } // namespace v8 |
OLD | NEW |