All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
To: Hyeoncheol Lee <hyc.lee@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
	LKML <linux-kernel@vger.kernel.org>,
	Srikar Dronamraju <srikar@linux.vnet.ibm.com>,
	yrl.pp-manager.tt@hitachi.com
Subject: Re: [PATCH] perf probe: Allow of casting an array of char to string
Date: Thu, 20 Sep 2012 18:37:55 +0900	[thread overview]
Message-ID: <505AE3F3.1040305@hitachi.com> (raw)
In-Reply-To: <1348117932-786-1-git-send-email-hyc.lee@gmail.com>

(2012/09/20 14:12), Hyeoncheol Lee wrote:
> Before casting a type of a variable to string,
> convert_variable_type() confirms that the type is a pointer or
> an array. if it is a pointer to char, it is casted to string.
> but in case of an array of char, it isn't

Oops, right! I missed the array case. This must be fixed.

Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>

Thank you!

> 
> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
> Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
> Signed-off-by: Hyeoncheol Lee <hyc.lee@gmail.com>
> ---
>  tools/perf/util/probe-finder.c |   10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
> index 1daf5c1..be03293 100644
> --- a/tools/perf/util/probe-finder.c
> +++ b/tools/perf/util/probe-finder.c
> @@ -413,12 +413,12 @@ static int convert_variable_type(Dwarf_Die *vr_die,
>  				   dwarf_diename(vr_die), dwarf_diename(&type));
>  			return -EINVAL;
>  		}
> +		if (die_get_real_type(&type, &type) == NULL) {
> +			pr_warning("Failed to get a type"
> +				   " information.\n");
> +			return -ENOENT;
> +		}
>  		if (ret == DW_TAG_pointer_type) {
> -			if (die_get_real_type(&type, &type) == NULL) {
> -				pr_warning("Failed to get a type"
> -					   " information.\n");
> -				return -ENOENT;
> -			}
>  			while (*ref_ptr)
>  				ref_ptr = &(*ref_ptr)->next;
>  			/* Add new reference with offset +0 */
> 


-- 
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com



      reply	other threads:[~2012-09-20  9:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-20  5:12 [PATCH] perf probe: Allow of casting an array of char to string Hyeoncheol Lee
2012-09-20  9:37 ` Masami Hiramatsu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=505AE3F3.1040305@hitachi.com \
    --to=masami.hiramatsu.pt@hitachi.com \
    --cc=acme@ghostprotocols.net \
    --cc=hyc.lee@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=srikar@linux.vnet.ibm.com \
    --cc=yrl.pp-manager.tt@hitachi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.