Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762383Ab0HGBe3 (ORCPT ); Fri, 6 Aug 2010 21:34:29 -0400 Received: from bombadil.infradead.org ([18.85.46.34]:53029 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752849Ab0HGBe0 (ORCPT ); Fri, 6 Aug 2010 21:34:26 -0400 From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, Masami Hiramatsu , Peter Zijlstra , Paul Mackerras , Ingo Molnar , Frederic Weisbecker , Arnaldo Carvalho de Melo Subject: [PATCH 1/4] perf probe: Fix to copy the type for raw parameters Date: Fri, 6 Aug 2010 22:34:06 -0300 Message-Id: <1281144849-22896-2-git-send-email-acme@infradead.org> X-Mailer: git-send-email 1.6.2.5 In-Reply-To: <1281144849-22896-1-git-send-email-acme@infradead.org> References: <1281144849-22896-1-git-send-email-acme@infradead.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1503 Lines: 44 From: 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). Cc: Peter Zijlstra Cc: Paul Mackerras Cc: Ingo Molnar Cc: Frederic Weisbecker Signed-off-by: Masami Hiramatsu LKML-Reference: <4C577AD8.50808@hitachi.com> Signed-off-by: Arnaldo Carvalho de Melo --- 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", -- 1.6.2.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/