The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=5f9a05e574050c8b3f6b444311a12e8fb293ad1a
commit 5f9a05e574050c8b3f6b444311a12e8fb293ad1a Author: Zhenlei Huang <z...@freebsd.org> AuthorDate: 2025-09-10 14:44:36 +0000 Commit: Zhenlei Huang <z...@freebsd.org> CommitDate: 2025-09-10 14:44:36 +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 --- 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 fbf81d423b95..09070eea284f 100644 --- a/sys/kern/kern_tslog.c +++ b/sys/kern/kern_tslog.c @@ -220,3 +220,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 675d1195043b..417afd4dbbe4 100644 --- a/sys/sys/kernel.h +++ b/sys/sys/kernel.h @@ -249,15 +249,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, \