| 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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 // Open the perf JIT dump file. | 264 // Open the perf JIT dump file. |
| 265 int bufferSize = sizeof(kFilenameFormatString) + kFilenameBufferPadding; | 265 int bufferSize = sizeof(kFilenameFormatString) + kFilenameBufferPadding; |
| 266 ScopedVector<char> perf_dump_name(bufferSize); | 266 ScopedVector<char> perf_dump_name(bufferSize); |
| 267 int size = SNPrintF( | 267 int size = SNPrintF( |
| 268 perf_dump_name, | 268 perf_dump_name, |
| 269 kFilenameFormatString, | 269 kFilenameFormatString, |
| 270 base::OS::GetCurrentProcessId()); | 270 base::OS::GetCurrentProcessId()); |
| 271 CHECK_NE(size, -1); | 271 CHECK_NE(size, -1); |
| 272 perf_output_handle_ = | 272 perf_output_handle_ = |
| 273 base::OS::FOpen(perf_dump_name.start(), base::OS::LogFileOpenMode); | 273 base::OS::FOpen(perf_dump_name.start(), base::OS::LogFileOpenMode); |
| 274 CHECK_NE(perf_output_handle_, NULL); | 274 CHECK_NOT_NULL(perf_output_handle_); |
| 275 setvbuf(perf_output_handle_, NULL, _IOFBF, kLogBufferSize); | 275 setvbuf(perf_output_handle_, NULL, _IOFBF, kLogBufferSize); |
| 276 } | 276 } |
| 277 | 277 |
| 278 | 278 |
| 279 PerfBasicLogger::~PerfBasicLogger() { | 279 PerfBasicLogger::~PerfBasicLogger() { |
| 280 fclose(perf_output_handle_); | 280 fclose(perf_output_handle_); |
| 281 perf_output_handle_ = NULL; | 281 perf_output_handle_ = NULL; |
| 282 } | 282 } |
| 283 | 283 |
| 284 | 284 |
| (...skipping 1648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1933 if (jit_logger_) { | 1933 if (jit_logger_) { |
| 1934 removeCodeEventListener(jit_logger_); | 1934 removeCodeEventListener(jit_logger_); |
| 1935 delete jit_logger_; | 1935 delete jit_logger_; |
| 1936 jit_logger_ = NULL; | 1936 jit_logger_ = NULL; |
| 1937 } | 1937 } |
| 1938 | 1938 |
| 1939 return log_->Close(); | 1939 return log_->Close(); |
| 1940 } | 1940 } |
| 1941 | 1941 |
| 1942 } } // namespace v8::internal | 1942 } } // namespace v8::internal |
| OLD | NEW |