Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 263067
b: refs/heads/master
c: 3f4460a
h: refs/heads/master
i:
  263065: f837811
  263063: f68106f
v: v3
  • Loading branch information
Masami Hiramatsu authored and Arnaldo Carvalho de Melo committed Aug 12, 2011
1 parent cb179a9 commit 37c583f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: db0d2c6420eeb8fd669bac84d72f1ab828bbaa64
refs/heads/master: 3f4460a28fb2f73df6c32c3a305797abc01c0f9c
22 changes: 22 additions & 0 deletions trunk/tools/perf/util/dwarf-aux.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,17 @@ static int die_get_call_fileno(Dwarf_Die *in_die)
return -ENOENT;
}

/* Get the declared file index number in CU DIE */
static int die_get_decl_fileno(Dwarf_Die *pdie)
{
Dwarf_Sword idx;

if (die_get_attr_sdata(pdie, DW_AT_decl_file, &idx) == 0)
return (int)idx;
else
return -ENOENT;
}

/**
* die_get_call_file - Get callsite file name of inlined function instance
* @in_die: a DIE of an inlined function instance
Expand Down Expand Up @@ -467,6 +478,7 @@ static int __die_walk_instances_cb(Dwarf_Die *inst, void *data)
Dwarf_Die origin_mem;
Dwarf_Attribute *attr;
Dwarf_Die *origin;
int tmp;

attr = dwarf_attr(inst, DW_AT_abstract_origin, &attr_mem);
if (attr == NULL)
Expand All @@ -476,6 +488,16 @@ static int __die_walk_instances_cb(Dwarf_Die *inst, void *data)
if (origin == NULL || origin->addr != iwp->addr)
return DIE_FIND_CB_CONTINUE;

/* Ignore redundant instances */
if (dwarf_tag(inst) == DW_TAG_inlined_subroutine) {
dwarf_decl_line(origin, &tmp);
if (die_get_call_lineno(inst) == tmp) {
tmp = die_get_decl_fileno(origin);
if (die_get_call_fileno(inst) == tmp)
return DIE_FIND_CB_CONTINUE;
}
}

iwp->retval = iwp->callback(inst, iwp->data);

return (iwp->retval) ? DIE_FIND_CB_END : DIE_FIND_CB_CONTINUE;
Expand Down

0 comments on commit 37c583f

Please sign in to comment.