| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 } | 50 } |
| 51 | 51 |
| 52 // Open the perf JIT dump file. | 52 // Open the perf JIT dump file. |
| 53 int bufferSize = sizeof(kFilenameFormatString) + kFilenameBufferPadding; | 53 int bufferSize = sizeof(kFilenameFormatString) + kFilenameBufferPadding; |
| 54 ScopedVector<char> perf_dump_name(bufferSize); | 54 ScopedVector<char> perf_dump_name(bufferSize); |
| 55 int size = SNPrintF(perf_dump_name, kFilenameFormatString, | 55 int size = SNPrintF(perf_dump_name, kFilenameFormatString, |
| 56 base::OS::GetCurrentProcessId()); | 56 base::OS::GetCurrentProcessId()); |
| 57 CHECK_NE(size, -1); | 57 CHECK_NE(size, -1); |
| 58 perf_output_handle_ = | 58 perf_output_handle_ = |
| 59 base::OS::FOpen(perf_dump_name.start(), base::OS::LogFileOpenMode); | 59 base::OS::FOpen(perf_dump_name.start(), base::OS::LogFileOpenMode); |
| 60 CHECK_NE(perf_output_handle_, NULL); | 60 CHECK_NOT_NULL(perf_output_handle_); |
| 61 setvbuf(perf_output_handle_, NULL, _IOFBF, kLogBufferSize); | 61 setvbuf(perf_output_handle_, NULL, _IOFBF, kLogBufferSize); |
| 62 | 62 |
| 63 LogWriteHeader(); | 63 LogWriteHeader(); |
| 64 } | 64 } |
| 65 | 65 |
| 66 | 66 |
| 67 PerfJitLogger::~PerfJitLogger() { | 67 PerfJitLogger::~PerfJitLogger() { |
| 68 fclose(perf_output_handle_); | 68 fclose(perf_output_handle_); |
| 69 perf_output_handle_ = NULL; | 69 perf_output_handle_ = NULL; |
| 70 } | 70 } |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 header.elf_mach = GetElfMach(); | 139 header.elf_mach = GetElfMach(); |
| 140 header.pid = base::OS::GetCurrentProcessId(); | 140 header.pid = base::OS::GetCurrentProcessId(); |
| 141 header.timestamp = | 141 header.timestamp = |
| 142 static_cast<uint64_t>(base::OS::TimeCurrentMillis() * 1000.0); | 142 static_cast<uint64_t>(base::OS::TimeCurrentMillis() * 1000.0); |
| 143 LogWriteBytes(reinterpret_cast<const char*>(&header), sizeof(header)); | 143 LogWriteBytes(reinterpret_cast<const char*>(&header), sizeof(header)); |
| 144 } | 144 } |
| 145 | 145 |
| 146 #endif // V8_OS_LINUX | 146 #endif // V8_OS_LINUX |
| 147 } | 147 } |
| 148 } // namespace v8::internal | 148 } // namespace v8::internal |
| OLD | NEW |