aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>2010-08-27 07:38:59 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-09-08 10:47:19 -0400
commit367e94c10092469c896a226a77ef13cf6da757e4 (patch)
treedd1df542ce140a08a9c742c6f1843af31be72a21 /tools
parent04ddd04b044d8896a4f8a921b23ba09d365df196 (diff)
perf probe: Fix handling of arguments names
Don't make argument names from raw parameters (means the parameters are written in kprobe-tracer syntax), because the argument syntax may include special characters. Just leave it, then kprobe-tracer gives a new name. Reported-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> LKML-Reference: <20100827113859.22882.75598.stgit@ltc236.sdl.hitachi.co.jp> Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/util/probe-finder.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index 9b0e1b1f9755..32b81f707ff5 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -686,6 +686,25 @@ static int find_variable(Dwarf_Die *sp_die, struct probe_finder *pf)
686 char buf[32], *ptr; 686 char buf[32], *ptr;
687 int ret, nscopes; 687 int ret, nscopes;
688 688
689 if (!is_c_varname(pf->pvar->var)) {
690 /* Copy raw parameters */
691 pf->tvar->value = strdup(pf->pvar->var);
692 if (pf->tvar->value == NULL)
693 return -ENOMEM;
694 if (pf->pvar->type) {
695 pf->tvar->type = strdup(pf->pvar->type);
696 if (pf->tvar->type == NULL)
697 return -ENOMEM;
698 }
699 if (pf->pvar->name) {
700 pf->tvar->name = strdup(pf->pvar->name);
701 if (pf->tvar->name == NULL)
702 return -ENOMEM;
703 } else
704 pf->tvar->name = NULL;
705 return 0;
706 }
707
689 if (pf->pvar->name) 708 if (pf->pvar->name)
690 pf->tvar->name = strdup(pf->pvar->name); 709 pf->tvar->name = strdup(pf->pvar->name);
691 else { 710 else {
@@ -700,19 +719,6 @@ static int find_variable(Dwarf_Die *sp_die, struct probe_finder *pf)
700 if (pf->tvar->name == NULL) 719 if (pf->tvar->name == NULL)
701 return -ENOMEM; 720 return -ENOMEM;
702 721
703 if (!is_c_varname(pf->pvar->var)) {
704 /* Copy raw parameters */
705 pf->tvar->value = strdup(pf->pvar->var);
706 if (pf->tvar->value == NULL)
707 return -ENOMEM;
708 if (pf->pvar->type) {
709 pf->tvar->type = strdup(pf->pvar->type);
710 if (pf->tvar->type == NULL)
711 return -ENOMEM;
712 }
713 return 0;
714 }
715
716 pr_debug("Searching '%s' variable in context.\n", 722 pr_debug("Searching '%s' variable in context.\n",
717 pf->pvar->var); 723 pf->pvar->var);
718 /* Search child die for local variables and parameters. */ 724 /* Search child die for local variables and parameters. */