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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 } | 76 } |
77 | 77 |
78 | 78 |
79 void PerfJitLogger::LogRecordedBuffer(Code* code, SharedFunctionInfo*, | 79 void PerfJitLogger::LogRecordedBuffer(Code* code, SharedFunctionInfo*, |
80 const char* name, int length) { | 80 const char* name, int length) { |
81 DCHECK(code->instruction_start() == code->address() + Code::kHeaderSize); | 81 DCHECK(code->instruction_start() == code->address() + Code::kHeaderSize); |
82 DCHECK(perf_output_handle_ != NULL); | 82 DCHECK(perf_output_handle_ != NULL); |
83 | 83 |
84 const char* code_name = name; | 84 const char* code_name = name; |
85 uint8_t* code_pointer = reinterpret_cast<uint8_t*>(code->instruction_start()); | 85 uint8_t* code_pointer = reinterpret_cast<uint8_t*>(code->instruction_start()); |
86 uint32_t code_size = code->instruction_size(); | 86 uint32_t code_size = code->is_crankshafted() ? code->safepoint_table_offset() |
| 87 : code->instruction_size(); |
87 | 88 |
88 static const char string_terminator[] = "\0"; | 89 static const char string_terminator[] = "\0"; |
89 | 90 |
90 jr_code_load code_load; | 91 jr_code_load code_load; |
91 code_load.p.id = JIT_CODE_LOAD; | 92 code_load.p.id = JIT_CODE_LOAD; |
92 code_load.p.total_size = sizeof(code_load) + length + 1 + code_size; | 93 code_load.p.total_size = sizeof(code_load) + length + 1 + code_size; |
93 code_load.p.timestamp = GetTimestamp(); | 94 code_load.p.timestamp = GetTimestamp(); |
94 code_load.pid = static_cast<uint32_t>(base::OS::GetCurrentProcessId()); | 95 code_load.pid = static_cast<uint32_t>(base::OS::GetCurrentProcessId()); |
95 code_load.tid = static_cast<uint32_t>(base::OS::GetCurrentThreadId()); | 96 code_load.tid = static_cast<uint32_t>(base::OS::GetCurrentThreadId()); |
96 code_load.vma = 0x0; // Our addresses are absolute. | 97 code_load.vma = 0x0; // Our addresses are absolute. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 header.elf_mach = GetElfMach(); | 139 header.elf_mach = GetElfMach(); |
139 header.pid = base::OS::GetCurrentProcessId(); | 140 header.pid = base::OS::GetCurrentProcessId(); |
140 header.timestamp = | 141 header.timestamp = |
141 static_cast<uint64_t>(base::OS::TimeCurrentMillis() * 1000.0); | 142 static_cast<uint64_t>(base::OS::TimeCurrentMillis() * 1000.0); |
142 LogWriteBytes(reinterpret_cast<const char*>(&header), sizeof(header)); | 143 LogWriteBytes(reinterpret_cast<const char*>(&header), sizeof(header)); |
143 } | 144 } |
144 | 145 |
145 #endif // V8_OS_LINUX | 146 #endif // V8_OS_LINUX |
146 } | 147 } |
147 } // namespace v8::internal | 148 } // namespace v8::internal |
OLD | NEW |