Commit 58432e1f3625ef22b347ec8f9487e1852aa9ad67

Authored by Masami Hiramatsu
Committed by Arnaldo Carvalho de Melo
1 parent e66b688c64

perf probe: Fix to copy the type for raw parameters

Copy type field if it is for raw parameters.
Without this fix, perf probe drops the type if user passes it
for raw parameters (e.g. %ax:u32 will be converted to %ax).

Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
LKML-Reference: <4C577AD8.50808@hitachi.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Showing 1 changed file with 6 additions and 2 deletions Side-by-side Diff

tools/perf/util/probe-finder.c
... ... @@ -705,8 +705,12 @@
705 705 pf->tvar->value = strdup(pf->pvar->var);
706 706 if (pf->tvar->value == NULL)
707 707 return -ENOMEM;
708   - else
709   - return 0;
  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;
710 714 }
711 715  
712 716 pr_debug("Searching '%s' variable in context.\n",