git: d59a8f27fc07 - stable/13 - tslog: Move sysinit_tslog_shim() into kern_tslog.c
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 04 Oct 2025 16:44:40 UTC
The branch stable/13 has been updated by zlei:
URL: https://cgit.FreeBSD.org/src/commit/?id=d59a8f27fc07cd52797b7d0974f5958d1fc21819
commit d59a8f27fc07cd52797b7d0974f5958d1fc21819
Author: Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2025-09-10 14:44:36 +0000
Commit: Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2025-10-04 16:43:24 +0000
tslog: Move sysinit_tslog_shim() into kern_tslog.c
struct sysinit's func pointer requires its address, thus a real function
is generated in every translation unit when the source file has SYSINITs
declared. That results in plenty of identical sysinit_tslog_shim in the
final kernel file, in which only one is used and others are left useless.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D52413
(cherry picked from commit 5f9a05e574050c8b3f6b444311a12e8fb293ad1a)
(cherry picked from commit bd721f6e8040f0b9d0546c293954290844b6a070)
(cherry picked from commit 112d1a5f5df0edb1e530348143413407b2659325)
---
sys/kern/kern_tslog.c | 10 ++++++++++
sys/sys/kernel.h | 11 ++---------
2 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/sys/kern/kern_tslog.c b/sys/kern/kern_tslog.c
index bb4f24c631e3..a9158c887050 100644
--- a/sys/kern/kern_tslog.c
+++ b/sys/kern/kern_tslog.c
@@ -217,3 +217,13 @@ SYSCTL_PROC(_debug, OID_AUTO, tslog_user,
CTLTYPE_STRING|CTLFLAG_RD|CTLFLAG_MPSAFE|CTLFLAG_SKIP,
0, 0, sysctl_debug_tslog_user,
"", "Dump recorded userland event timestamps");
+
+void
+sysinit_tslog_shim(const void *data)
+{
+ const struct sysinit_tslog *x = data;
+
+ tslog(curthread, TS_ENTER, "SYSINIT", x->name);
+ (x->func)(x->data);
+ tslog(curthread, TS_EXIT, "SYSINIT", x->name);
+}
diff --git a/sys/sys/kernel.h b/sys/sys/kernel.h
index e1ef7ff10dfa..63846950215e 100644
--- a/sys/sys/kernel.h
+++ b/sys/sys/kernel.h
@@ -242,15 +242,8 @@ struct sysinit_tslog {
const void *data;
const char *name;
};
-static inline void
-sysinit_tslog_shim(const void *data)
-{
- const struct sysinit_tslog *x = data;
-
- TSRAW(curthread, TS_ENTER, "SYSINIT", x->name);
- (x->func)(x->data);
- TSRAW(curthread, TS_EXIT, "SYSINIT", x->name);
-}
+void sysinit_tslog_shim(const void *);
+
#define C_SYSINIT(uniquifier, subsystem, order, func, ident) \
static struct sysinit_tslog uniquifier ## _sys_init_tslog = { \
func, \