Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Unified Diff: src/perf-jit.cc

Issue 2783203005: [perf-prof] Adjust source position addresses according to ELF header size (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/perf-jit.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/perf-jit.cc
diff --git a/src/perf-jit.cc b/src/perf-jit.cc
index 907a4cde2c9adce7a4ee1e408737f421fe707b7a..e7e4c344cd280c2b70725805b7831fa1112fa02d 100644
--- a/src/perf-jit.cc
+++ b/src/perf-jit.cc
@@ -322,13 +322,11 @@ void PerfJitLogger::LogWriteDebugInfo(Code* code, SharedFunctionInfo* shared) {
SourcePositionInfo info(GetSourcePositionInfo(code_handle, function_handle,
iterator.source_position()));
PerfJitDebugEntry entry;
- // TODO(danno): There seems to be a bug in the dwarf handling of JIT code in
- // the perf tool. It seems to erroneously believe that the first instruction
- // of functions is at offset 0x40 when displayed in "perf report". To
- // compensate for this, add a magic constant to the position addresses when
- // writing them out.
- entry.address_ =
- reinterpret_cast<intptr_t>(code_start + iterator.code_offset() + 0x40);
+ // The entry point of the function will be placed straight after the ELF
+ // header when processed by "perf inject". Adjust the position addresses
+ // accordingly.
+ entry.address_ = reinterpret_cast<intptr_t>(
+ code_start + iterator.code_offset() + kElfHeaderSize);
entry.line_number_ = info.line + 1;
entry.column_ = info.column + 1;
LogWriteBytes(reinterpret_cast<const char*>(&entry), sizeof(entry));
« no previous file with comments | « src/perf-jit.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698