All of lore.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Hyeoncheol Lee <hyc.lee@gmail.com>
Cc: acme@ghostprotocols.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -tip/perf/core] perf probe: Add union member access support
Date: Wed, 12 Sep 2012 17:35:59 +0900	[thread overview]
Message-ID: <877grzab9s.fsf@sejong.aot.lge.com> (raw)
In-Reply-To: <CANFS6baeuSBxPGQ8SUZWZErJ2bWs-Nojg+FSo138E1QK8bJJig@mail.gmail.com> (Hyeoncheol Lee's message of "Wed, 12 Sep 2012 16:57:45 +0900")

Hi Hyeoncheol,

It seems you don't use git send-email which adds people on Cc: lines of
changelog into actual CC list automatically.  Or did you send the email
to Masami and Srikar privately?

Thanks,
Namhyung


On Wed, 12 Sep 2012 16:57:45 +0900, Hyeoncheol Lee wrote:
> Union members can be accessed with '.' or '->' like data structure
> member access
>
> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
> Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
> Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com>
> ---
>  tools/perf/util/probe-finder.c |   24 ++++++++++++++++--------
>  1 file changed, 16 insertions(+), 8 deletions(-)
>
> diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
> index 94a00de..cc2b856 100644
> --- a/tools/perf/util/probe-finder.c
> +++ b/tools/perf/util/probe-finder.c
> @@ -525,8 +525,10 @@ static int convert_variable_fields(Dwarf_Die
> *vr_die, const char *varname,
>  			return -ENOENT;
>  		}
>  		/* Verify it is a data structure  */
> -		if (dwarf_tag(&type) != DW_TAG_structure_type) {
> -			pr_warning("%s is not a data structure.\n", varname);
> +		tag = dwarf_tag(&type);
> +		if (tag != DW_TAG_structure_type && tag != DW_TAG_union_type) {
> +			pr_warning("%s is not a data structure nor an union.\n",
> +				   varname);
>  			return -EINVAL;
>  		}
>
> @@ -539,8 +541,9 @@ static int convert_variable_fields(Dwarf_Die
> *vr_die, const char *varname,
>  			*ref_ptr = ref;
>  	} else {
>  		/* Verify it is a data structure  */
> -		if (tag != DW_TAG_structure_type) {
> -			pr_warning("%s is not a data structure.\n", varname);
> +		if (tag != DW_TAG_structure_type && tag != DW_TAG_union_type) {
> +			pr_warning("%s is not a data structure nor an union.\n",
> +				   varname);
>  			return -EINVAL;
>  		}
>  		if (field->name[0] == '[') {
> @@ -567,10 +570,15 @@ static int convert_variable_fields(Dwarf_Die
> *vr_die, const char *varname,
>  	}
>
>  	/* Get the offset of the field */
> -	ret = die_get_data_member_location(die_mem, &offs);
> -	if (ret < 0) {
> -		pr_warning("Failed to get the offset of %s.\n", field->name);
> -		return ret;
> +	if (tag == DW_TAG_union_type) {
> +		offs = 0;
> +	} else {
> +		ret = die_get_data_member_location(die_mem, &offs);
> +		if (ret < 0) {
> +			pr_warning("Failed to get the offset of %s.\n",
> +				   field->name);
> +			return ret;
> +		}
>  	}
>  	ref->offset += (long)offs;

  reply	other threads:[~2012-09-12  8:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-12  7:57 [PATCH -tip/perf/core] perf probe: Add union member access support Hyeoncheol Lee
2012-09-12  8:35 ` Namhyung Kim [this message]
2012-09-12 15:15 ` Masami Hiramatsu
2012-09-12 17:09 ` Arnaldo Carvalho de Melo
2012-09-19 15:10 ` [tip:perf/core] " tip-bot for Hyeoncheol Lee

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=877grzab9s.fsf@sejong.aot.lge.com \
    --to=namhyung@kernel.org \
    --cc=acme@ghostprotocols.net \
    --cc=hyc.lee@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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.