mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
perf libdw: Support DWARF line 0 in inline list
Allow DWARF line 0 in `libdw_a2l_cb()`, as it is a valid reference for compiler-generated code. Filter `die_get_call_lineno` error codes (negative values), but fallback to line 0 if `call_fname` is present to preserve the caller's filename instead of discarding it entirely. Signed-off-by: Ian Rogers <irogers@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: James Clark <james.clark@linaro.org> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Zecheng Li <zli94@ncsu.edu> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
0e18b5bb7c
commit
15f8c22c46
|
|
@ -80,6 +80,7 @@ static int libdw_a2l_cb(Dwarf_Die *die, void *_args)
|
|||
struct libdw_a2l_cb_args *args = _args;
|
||||
struct symbol *inline_sym = new_inline_sym(args->dso, args->sym, dwarf_diename(die));
|
||||
const char *call_fname = die_get_call_file(die);
|
||||
int call_lineno = die_get_call_lineno(die);
|
||||
char *call_srcline = srcline__unknown;
|
||||
|
||||
if (!inline_sym)
|
||||
|
|
@ -87,7 +88,7 @@ static int libdw_a2l_cb(Dwarf_Die *die, void *_args)
|
|||
|
||||
/* Assign caller information to the parent. */
|
||||
if (call_fname)
|
||||
call_srcline = srcline_from_fileline(call_fname, die_get_call_lineno(die));
|
||||
call_srcline = srcline_from_fileline(call_fname, call_lineno >= 0 ? call_lineno : 0);
|
||||
|
||||
if (!list_empty(&args->node->val)) {
|
||||
struct inline_list *parent;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user