Date: Thu, 18 Sep 2025 16:18:07 GMT From: Zhenlei Huang <zlei@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: bd721f6e8040 - stable/15 - tslog: Move sysinit_tslog_shim() into kern_tslog.c Message-ID: <202509181618.58IGI72X050929@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/15 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=bd721f6e8040f0b9d0546c293954290844b6a070 commit bd721f6e8040f0b9d0546c293954290844b6a070 Author: Zhenlei Huang <zlei@FreeBSD.org> AuthorDate: 2025-09-10 14:44:36 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> CommitDate: 2025-09-18 16:15:53 +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) --- 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 380099092107..81efeff527f5 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, \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202509181618.58IGI72X050929>