aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/probe-finder.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/probe-finder.c')
-rw-r--r--tools/perf/util/probe-finder.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index ebeb413ac473..ab476736cbe7 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -547,7 +547,10 @@ static void convert_variable(Dwarf_Die *vr_die, struct probe_finder *pf)
547 &die_mem); 547 &die_mem);
548 vr_die = &die_mem; 548 vr_die = &die_mem;
549 } 549 }
550 convert_variable_type(vr_die, pf->tvar); 550 if (pf->pvar->type)
551 pf->tvar->type = xstrdup(pf->pvar->type);
552 else
553 convert_variable_type(vr_die, pf->tvar);
551 /* *expr will be cached in libdw. Don't free it. */ 554 /* *expr will be cached in libdw. Don't free it. */
552 return ; 555 return ;
553error: 556error:
@@ -560,13 +563,16 @@ error:
560static void find_variable(Dwarf_Die *sp_die, struct probe_finder *pf) 563static void find_variable(Dwarf_Die *sp_die, struct probe_finder *pf)
561{ 564{
562 Dwarf_Die vr_die; 565 Dwarf_Die vr_die;
563 char buf[32]; 566 char buf[32], *ptr;
564 567
565 /* TODO: Support arrays */ 568 /* TODO: Support arrays */
566 if (pf->pvar->name) 569 if (pf->pvar->name)
567 pf->tvar->name = xstrdup(pf->pvar->name); 570 pf->tvar->name = xstrdup(pf->pvar->name);
568 else { 571 else {
569 synthesize_perf_probe_arg(pf->pvar, buf, 32); 572 synthesize_perf_probe_arg(pf->pvar, buf, 32);
573 ptr = strchr(buf, ':'); /* Change type separator to _ */
574 if (ptr)
575 *ptr = '_';
570 pf->tvar->name = xstrdup(buf); 576 pf->tvar->name = xstrdup(buf);
571 } 577 }
572 578