[tip:perf/core] perf probe: Fix to copy the type for raw parameters

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: tip-bot for Masami Hiramatsu
Date: Saturday, August 7, 2010 - 12:00 am

Commit-ID:  58432e1f3625ef22b347ec8f9487e1852aa9ad67
Gitweb:     http://git.kernel.org/tip/58432e1f3625ef22b347ec8f9487e1852aa9ad67
Author:     Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
AuthorDate: Tue, 3 Aug 2010 11:11:36 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 6 Aug 2010 16:25:56 -0300

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>
---
 tools/perf/util/probe-finder.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index 6c7750d..5251366 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -705,8 +705,12 @@ static int find_variable(Dwarf_Die *sp_die, struct probe_finder *pf)
 		pf->tvar->value = strdup(pf->pvar->var);
 		if (pf->tvar->value == NULL)
 			return -ENOMEM;
-		else
-			return 0;
+		if (pf->pvar->type) {
+			pf->tvar->type = strdup(pf->pvar->type);
+			if (pf->tvar->type == NULL)
+				return -ENOMEM;
+		}
+		return 0;
 	}
 
 	pr_debug("Searching '%s' variable in context.\n",
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 1/2] [BUGFIX] perf probe: Fix to copy the type ..., Masami Hiramatsu, (Fri Aug 6, 12:17 am)
Re: [PATCH 1/2] [BUGFIX] perf probe: Fix to copy the type ..., Arnaldo Carvalho de Melo, (Fri Aug 6, 7:10 am)
[tip:perf/core] perf probe: Fix to copy the type for raw p ..., tip-bot for Masami H ..., (Sat Aug 7, 12:00 am)