Skip to contentSkip to conversation

metadata: Ignore system macros

PATCH In review Cyril Hrubis 3 participants 4 messages Nov 5, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 metadata: Ignore system macros

Ingore all macros that start with underscore. Unless we do that we get several thousands of __NR_foo macros and the hash table cannot keep up.

---
 metadata/metaparse.c | 3 +++
 1 file changed, 3 insertions(+)
metadata/metaparse.c +3 -0
index b38550550..f71d8628d 100644
@@ -624,6 +624,9 @@ static void parse_macro(FILE *f)
 
 	macro_get_val(f, val, sizeof(val));
 
+	if (name[0] == '_')
+		return;
+
 	ENTRY e = {
 		.key = strdup(name),
 		.data = strdup(val),
Signature · 5 lines
2.32.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by on v1 1/1
#1 lore raw

Hi Cyril,

Quoted 4 lines

Ingore all macros that start with underscore. Unless we do that we get several thousands of __NR_foo macros and the hash table cannot keep up.

Good catch. Suppose skipping many tests does not need print info under verbose.

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#2 lore raw

Hi!
Thank you both for the quick review, pushed.

Signature · 5 lines
Cyril Hrubis
[email protected]

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by on v1 1/1
#3 lore raw
In reply to Cyril Hrubis

Hello,

Quoted 4 lines · Cyril Hrubis

Ingore all macros that start with underscore. Unless we do that we get several thousands of __NR_foo macros and the hash table cannot keep up.

Quoted 20 lines
---
 metadata/metaparse.c | 3 +++
 1 file changed, 3 insertions(+)
metadata/metaparse.c +3 -0
index b38550550..f71d8628d 100644
@@ -624,6 +624,9 @@ static void parse_macro(FILE *f)
 
 	macro_get_val(f, val, sizeof(val));
 
+	if (name[0] == '_')
+		return;
+
 	ENTRY e = {
 		.key = strdup(name),
 		.data = strdup(val),
Signature · 1 line
2.32.0
Signature · 5 lines
Thank you,
Richard.

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp