Skip to contentSkip to conversation

perf probe: Fix to copy the type for raw parameters

PATCH In review Masami Hiramatsu 2 participants 4 messages Aug 3, 2010 – Aug 7, 2010 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 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 <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Frederic Weisbecker <[email protected]>

---

 tools/perf/util/probe-finder.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
tools/perf/util/probe-finder.c +6 -2
index 840f1aa..b69d194 100644
@@ -706,8 +706,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",
Signature · 4 lines
Masami HIRAMATSU
2nd Research Dept.
Hitachi, Ltd., Systems Development Laboratory
E-mail: [email protected]
#1 lore raw
Quoted 3 lines · Masami Hiramatsu

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).

Hi Arnaldo,

Could you pick these patches?

Thank you,

Quoted 34 lines
Cc Peter Zijlstra <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Frederic Weisbecker <[email protected]>

---

 tools/perf/util/probe-finder.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
tools/perf/util/probe-finder.c +6 -2
index 840f1aa..b69d194 100644
@@ -706,8 +706,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",
#2 lore raw

Em Fri, Aug 06, 2010 at 04:17:59PM +0900, Masami Hiramatsu escreveu:

Quoted 7 lines
Quoted 3 lines · Masami Hiramatsu

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).

Hi Arnaldo,

Could you pick these patches?

Sure.

- Arnaldo

#3 lore raw
In reply to Masami Hiramatsu
Commit-ID:  58432e1f3625ef22b347ec8f9487e1852aa9ad67
Gitweb:     http://git.kernel.org/tip/58432e1f3625ef22b347ec8f9487e1852aa9ad67
Author:     Masami Hiramatsu <[email protected]>
AuthorDate: Tue, 3 Aug 2010 11:11:36 +0900
Committer:  Arnaldo Carvalho de Melo <[email protected]>
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 <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Frederic Weisbecker <[email protected]>

LKML-Reference: <[email protected]>

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