diff options
author | Masami Hiramatsu <mhiramat@redhat.com> | 2010-04-12 13:17:22 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-04-14 17:28:09 -0300 |
commit | 11a1ca3554b377d2a8a318a3cbf8ce10a7a2a8e4 (patch) | |
tree | 36483c56ee6b7148247ef6fbe349b09ee8cfcb25 /tools/perf/util/probe-finder.c | |
parent | 4984912eb23113a4007940cd09c8351c0623ea5f (diff) | |
download | linux-11a1ca3554b377d2a8a318a3cbf8ce10a7a2a8e4.tar.bz2 |
perf probe: Support basic type casting
Add basic type casting for arguments to perf probe. This allows
users to specify the actual type of arguments. Of course, if
user sets invalid types, kprobe-tracer rejects that.
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <20100412171722.3790.50372.stgit@localhost6.localdomain6>
Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/probe-finder.c')
-rw-r--r-- | tools/perf/util/probe-finder.c | 10 |
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) &die_mem); vr_die = &die_mem; } - convert_variable_type(vr_die, pf->tvar); + if (pf->pvar->type) + pf->tvar->type = xstrdup(pf->pvar->type); + else + convert_variable_type(vr_die, pf->tvar); /* *expr will be cached in libdw. Don't free it. */ return ; error: @@ -560,13 +563,16 @@ error: static void find_variable(Dwarf_Die *sp_die, struct probe_finder *pf) { Dwarf_Die vr_die; - char buf[32]; + char buf[32], *ptr; /* TODO: Support arrays */ if (pf->pvar->name) pf->tvar->name = xstrdup(pf->pvar->name); else { synthesize_perf_probe_arg(pf->pvar, buf, 32); + ptr = strchr(buf, ':'); /* Change type separator to _ */ + if (ptr) + *ptr = '_'; pf->tvar->name = xstrdup(buf); } |