All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH dwarves] btf_encoder: filter var names before btf name check
@ 2024-10-18  9:43 Alan Maguire
  2024-10-22 18:21 ` Miguel Ojeda
  2024-10-22 22:17 ` Stephen Brennan
  0 siblings, 2 replies; 5+ messages in thread
From: Alan Maguire @ 2024-10-18  9:43 UTC (permalink / raw)
  To: acme
  Cc: ojeda, andrii.nakryiko, jolsa, dwarves, stephen.s.brennan,
	Alan Maguire

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

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-10-23 14:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2024-10-23 14:24   ` Arnaldo Carvalho de Melo

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.