28 #ifndef V8_PERF_JIT_H_ 29 #define V8_PERF_JIT_H_ 39 class PerfJitLogger :
public CodeEventLogger {
41 explicit PerfJitLogger(Isolate* isolate);
42 ~PerfJitLogger()
override;
44 void CodeMoveEvent(AbstractCode from, AbstractCode to)
override;
45 void CodeDisableOptEvent(AbstractCode code,
46 SharedFunctionInfo* shared)
override {}
49 void OpenJitDumpFile();
50 void CloseJitDumpFile();
51 void* OpenMarkerFile(
int fd);
52 void CloseMarkerFile(
void* marker_address);
54 uint64_t GetTimestamp();
55 void LogRecordedBuffer(AbstractCode code, SharedFunctionInfo* shared,
56 const char* name,
int length)
override;
57 void LogRecordedBuffer(
const wasm::WasmCode* code,
const char* name,
61 static const char kFilenameFormatString[];
62 static const int kFilenameBufferPadding;
66 static const int kLogBufferSize = 2 * MB;
68 void WriteJitCodeLoadEntry(
const uint8_t* code_pointer,
uint32_t code_size,
69 const char* name,
int name_length);
71 void LogWriteBytes(
const char* bytes,
int size);
72 void LogWriteHeader();
73 void LogWriteDebugInfo(Code code, SharedFunctionInfo* shared);
74 void LogWriteUnwindingInfo(Code code);
76 static const uint32_t kElfMachIA32 = 3;
77 static const uint32_t kElfMachX64 = 62;
78 static const uint32_t kElfMachARM = 40;
79 static const uint32_t kElfMachMIPS = 10;
80 static const uint32_t kElfMachARM64 = 183;
83 #if V8_TARGET_ARCH_IA32 85 #elif V8_TARGET_ARCH_X64 87 #elif V8_TARGET_ARCH_ARM 89 #elif V8_TARGET_ARCH_MIPS 91 #elif V8_TARGET_ARCH_ARM64 99 #if V8_TARGET_ARCH_32_BIT 100 static const int kElfHeaderSize = 0x34;
101 #elif V8_TARGET_ARCH_64_BIT 102 static const int kElfHeaderSize = 0x40;
104 #error Unknown target architecture pointer size 109 static base::LazyRecursiveMutex file_mutex_;
110 static FILE* perf_output_handle_;
111 static uint64_t reference_count_;
112 static void* marker_address_;
113 static uint64_t code_index_;
133 const char* name,
int length)
override {
137 void LogRecordedBuffer(
const wasm::WasmCode* code,
const char* name,
138 int length)
override {
143 #endif // V8_OS_LINUX 147 #endif // V8_PERF_JIT_H_