提交 99df82f2 编写于 作者: N Nick Gasson 提交者: Yang Yingliang

perf jit: Fix inaccurate DWARF line table

mainline inclusion
from mainline-v5.7
commit 1e4bd2ae
category: bugfix
bugzilla: NA
CVE: NA

-------------------------------------------------

Fix an issue where addresses in the DWARF line table are offset by -0x40
(GEN_ELF_TEXT_OFFSET). This can be seen with `objdump -S` on the ELF
files after perf inject.

Committer notes:

Ian added this in his Acked-by reply:

 ---
Without too much knowledge this looks good to me. The original code came
from oprofile's jit support:

  https://sourceforge.net/p/oprofile/oprofile/ci/master/tree/opjitconv/debug_line.c#l325
 ---
Signed-off-by: NNick Gasson <nick.gasson@arm.com>
Acked-by: NIan Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lore.kernel.org/lkml/20200528051916.6722-1-nick.gasson@arm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: NZhichang Yuan <erik.yuan@arm.com>
Reviewed-by: NYang Jihong <yangjihong1@huawei.com>
Signed-off-by: NCheng Jian <cj.chengjian@huawei.com>
上级 09198b0f
......@@ -344,7 +344,7 @@ static void emit_lineno_info(struct buffer_ext *be,
*/
/* start state of the state machine we take care of */
unsigned long last_vma = code_addr;
unsigned long last_vma = 0;
char const *cur_filename = NULL;
unsigned long cur_file_idx = 0;
int last_line = 1;
......@@ -475,7 +475,7 @@ jit_process_debug_info(uint64_t code_addr,
ent = debug_entry_next(ent);
}
add_compilation_unit(di, buffer_ext_size(dl));
add_debug_line(dl, debug, nr_debug_entries, 0);
add_debug_line(dl, debug, nr_debug_entries, GEN_ELF_TEXT_OFFSET);
add_debug_abbrev(da);
if (0) buffer_ext_dump(da, "abbrev");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册