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/base/platform/platform.h" | 9 #include "src/base/platform/platform.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 1517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1528 } else { | 1528 } else { |
1529 msg.Append(",0,"); | 1529 msg.Append(",0,"); |
1530 msg.AppendAddress(sample->tos); | 1530 msg.AppendAddress(sample->tos); |
1531 } | 1531 } |
1532 msg.Append(",%d", static_cast<int>(sample->state)); | 1532 msg.Append(",%d", static_cast<int>(sample->state)); |
1533 if (overflow) { | 1533 if (overflow) { |
1534 msg.Append(",overflow"); | 1534 msg.Append(",overflow"); |
1535 } | 1535 } |
1536 for (unsigned i = 0; i < sample->frames_count; ++i) { | 1536 for (unsigned i = 0; i < sample->frames_count; ++i) { |
1537 msg.Append(','); | 1537 msg.Append(','); |
1538 msg.AppendAddress(sample->stack[i]); | 1538 msg.AppendAddress(static_cast<Address>(sample->stack[i])); |
1539 } | 1539 } |
1540 msg.WriteToLogFile(); | 1540 msg.WriteToLogFile(); |
1541 } | 1541 } |
1542 | 1542 |
1543 | 1543 |
1544 void Logger::StopProfiler() { | 1544 void Logger::StopProfiler() { |
1545 if (!log_->IsEnabled()) return; | 1545 if (!log_->IsEnabled()) return; |
1546 if (profiler_ != NULL) { | 1546 if (profiler_ != NULL) { |
1547 profiler_->pause(); | 1547 profiler_->pause(); |
1548 is_logging_ = false; | 1548 is_logging_ = false; |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1862 if (Log::InitLogAtStart()) { | 1862 if (Log::InitLogAtStart()) { |
1863 is_logging_ = true; | 1863 is_logging_ = true; |
1864 } | 1864 } |
1865 | 1865 |
1866 if (FLAG_prof) { | 1866 if (FLAG_prof) { |
1867 profiler_ = new Profiler(isolate); | 1867 profiler_ = new Profiler(isolate); |
1868 is_logging_ = true; | 1868 is_logging_ = true; |
1869 profiler_->Engage(); | 1869 profiler_->Engage(); |
1870 } | 1870 } |
1871 | 1871 |
1872 // TODO(gholap): This one's for the new sampler API. (include/v8-sampler.h) | |
yurys
2014/09/09 14:35:20
There is no include/v8-sampler.h
gholap
2014/09/17 02:35:06
Done.
| |
1873 // Call to IncreaseProfilingDepth causes the | |
1874 // SIGPROF signal handler to be installed on the VM thread. | |
1875 // Figure out whether there's a way to only optionally | |
1876 // do this based on a runtime flag. | |
1877 ticker_->IncreaseProfilingDepth(); | |
yurys
2014/09/09 14:35:20
This breaks the invariant as now Sampler::IsProfil
gholap
2014/09/17 02:35:06
Done.
| |
1878 | |
1872 if (FLAG_log_internal_timer_events || FLAG_prof) timer_.Start(); | 1879 if (FLAG_log_internal_timer_events || FLAG_prof) timer_.Start(); |
1873 | 1880 |
1874 return true; | 1881 return true; |
1875 } | 1882 } |
1876 | 1883 |
1877 | 1884 |
1878 void Logger::SetCodeEventHandler(uint32_t options, | 1885 void Logger::SetCodeEventHandler(uint32_t options, |
1879 JitCodeEventHandler event_handler) { | 1886 JitCodeEventHandler event_handler) { |
1880 if (jit_logger_) { | 1887 if (jit_logger_) { |
1881 removeCodeEventListener(jit_logger_); | 1888 removeCodeEventListener(jit_logger_); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1935 if (jit_logger_) { | 1942 if (jit_logger_) { |
1936 removeCodeEventListener(jit_logger_); | 1943 removeCodeEventListener(jit_logger_); |
1937 delete jit_logger_; | 1944 delete jit_logger_; |
1938 jit_logger_ = NULL; | 1945 jit_logger_ = NULL; |
1939 } | 1946 } |
1940 | 1947 |
1941 return log_->Close(); | 1948 return log_->Close(); |
1942 } | 1949 } |
1943 | 1950 |
1944 } } // namespace v8::internal | 1951 } } // namespace v8::internal |
OLD | NEW |