public inbox for dwarves@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Brennan <stephen.s.brennan@oracle.com>
To: Alan Maguire <alan.maguire@oracle.com>, acme@kernel.org
Cc: ojeda@kernel.org, andrii.nakryiko@gmail.com, jolsa@kernel.org,
	dwarves@vger.kernel.org, Alan Maguire <alan.maguire@oracle.com>
Subject: Re: [PATCH dwarves] btf_encoder: filter var names before btf name check
Date: Tue, 22 Oct 2024 15:17:09 -0700	[thread overview]
Message-ID: <87v7xjrdei.fsf@oracle.com> (raw)
In-Reply-To: <20241018094301.1550149-1-alan.maguire@oracle.com>

Alan Maguire <alan.maguire@oracle.com> writes:
> ...as this means we avoid seeing multiple messages of the form
>
> PAHOLE: Warning: Found invalid variable name when encoding btf, ignored (sym: '__UNIQUE_ID___addressable__RNvXsa_NtCs2vSfyxKMEZc_4core4charNtB5_11EscapeDebugNtNtNtNtB7_4iter6traits10exact_size17ExactSizeIterator3len57').

a beautiful variable name :P

> Such symbols are filtered anyway due to the __UNIQUE_ID prefix, so
> warning about them is not necessary; simply reordering the checks
> should ensure we will not see these warnings.
>
> Reported-by: Arnaldo Carvalho de Melo <acme@kernel.org>
> Signed-off-by: Alan Maguire <alan.maguire@oracle.com>

Sorry I'm late to review. This is a good catch and is clearly correct
to me.

Reviewed-by: Stephen Brennan <stephen.s.brennan@oracle.com>

> ---
>  btf_encoder.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/btf_encoder.c b/btf_encoder.c
> index 5954238..e507e60 100644
> --- a/btf_encoder.c
> +++ b/btf_encoder.c
> @@ -2241,6 +2241,9 @@ static int btf_encoder__encode_cu_variables(struct btf_encoder *encoder)
>  		if (!name)
>  			continue;
>  
> +		if (filter_variable_name(name))
> +			continue;
> +
>  		/* Check for invalid BTF names */
>  		if (!btf_name_valid(name)) {
>  			dump_invalid_symbol("Found invalid variable name when encoding btf",
> @@ -2251,9 +2254,6 @@ static int btf_encoder__encode_cu_variables(struct btf_encoder *encoder)
>  				return -1;
>  		}
>  
> -		if (filter_variable_name(name))
> -			continue;
> -
>  		if (var->ip.tag.type == 0) {
>  			fprintf(stderr, "error: found variable '%s' in CU '%s' that has void type\n",
>  				name, cu->name);
> -- 
> 2.43.5

  parent reply	other threads:[~2024-10-22 22:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-18  9:43 [PATCH dwarves] btf_encoder: filter var names before btf name check Alan Maguire
2024-10-22 18:21 ` Miguel Ojeda
2024-10-22 18:39   ` Arnaldo Carvalho de Melo
2024-10-22 22:17 ` Stephen Brennan [this message]
2024-10-23 14:24   ` Arnaldo Carvalho de Melo

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=87v7xjrdei.fsf@oracle.com \
    --to=stephen.s.brennan@oracle.com \
    --cc=acme@kernel.org \
    --cc=alan.maguire@oracle.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=dwarves@vger.kernel.org \
    --cc=jolsa@kernel.org \
    --cc=ojeda@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox