aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/util/dwarf-aux.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/util/dwarf-aux.c b/tools/perf/util/dwarf-aux.c
index fddf40f30d3e..d35b454f98b8 100644
--- a/tools/perf/util/dwarf-aux.c
+++ b/tools/perf/util/dwarf-aux.c
@@ -439,7 +439,7 @@ static int __die_walk_culines_cb(Dwarf_Die *sp_die, void *data)
439 439
440/** 440/**
441 * die_walk_lines - Walk on lines inside given DIE 441 * die_walk_lines - Walk on lines inside given DIE
442 * @rt_die: a root DIE (CU or subprogram) 442 * @rt_die: a root DIE (CU, subprogram or inlined_subroutine)
443 * @callback: callback routine 443 * @callback: callback routine
444 * @data: user data 444 * @data: user data
445 * 445 *
@@ -460,12 +460,12 @@ int die_walk_lines(Dwarf_Die *rt_die, line_walk_callback_t callback, void *data)
460 size_t nlines, i; 460 size_t nlines, i;
461 461
462 /* Get the CU die */ 462 /* Get the CU die */
463 if (dwarf_tag(rt_die) == DW_TAG_subprogram) 463 if (dwarf_tag(rt_die) != DW_TAG_compile_unit)
464 cu_die = dwarf_diecu(rt_die, &die_mem, NULL, NULL); 464 cu_die = dwarf_diecu(rt_die, &die_mem, NULL, NULL);
465 else 465 else
466 cu_die = rt_die; 466 cu_die = rt_die;
467 if (!cu_die) { 467 if (!cu_die) {
468 pr_debug2("Failed to get CU from subprogram\n"); 468 pr_debug2("Failed to get CU from given DIE.\n");
469 return -EINVAL; 469 return -EINVAL;
470 } 470 }
471 471