[RFC PATCH v2 17/19] dyndbg: rearrange struct ddebug_callsites

From: Jim Cromie
Date: Fri Dec 25 2020 - 15:22:37 EST


move static-key field to top of struct. It is the biggest field, and
most alignment constrained (I believe), so this improves ambient
pahole conditions.

It doesn't actually improve the packing, it only simplifies and
shrinks the pahole reporting.

probably drop during rebase, cleanup.

Signed-off-by: Jim Cromie <jim.cromie@xxxxxxxxx>
---
include/linux/dynamic_debug.h | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h
index 0fcbe96736f3..e7b5e7664e51 100644
--- a/include/linux/dynamic_debug.h
+++ b/include/linux/dynamic_debug.h
@@ -25,7 +25,14 @@ struct _ddebug_callsite {
};

struct _ddebug {
+#ifdef CONFIG_JUMP_LABEL
+ union {
+ struct static_key_true dd_key_true;
+ struct static_key_false dd_key_false;
+ } key;
+#endif
struct _ddebug_callsite *site;
+
/* format is always needed, lineno shares word with flags */
const char *format;
const unsigned lineno:18;
@@ -56,12 +63,6 @@ struct _ddebug {
#define _DPRINTK_FLAGS_DEFAULT 0
#endif
unsigned int flags:8;
-#ifdef CONFIG_JUMP_LABEL
- union {
- struct static_key_true dd_key_true;
- struct static_key_false dd_key_false;
- } key;
-#endif
} __aligned(8);


--
2.29.2