Date: Sun, 31 Dec 2017 09:23:02 +0000 (UTC) From: Colin Percival <cperciva@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327427 - head/sys/sys Message-ID: <201712310923.vBV9N2eG046656@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: cperciva Date: Sun Dec 31 09:23:02 2017 New Revision: 327427 URL: https://svnweb.freebsd.org/changeset/base/327427 Log: Use the TSLOG framework to record SYSINIT entry/exit timestamps. Modified: head/sys/sys/kernel.h Modified: head/sys/sys/kernel.h ============================================================================== --- head/sys/sys/kernel.h Sun Dec 31 09:22:31 2017 (r327426) +++ head/sys/sys/kernel.h Sun Dec 31 09:23:02 2017 (r327427) @@ -54,6 +54,9 @@ /* for intrhook below */ #include <sys/queue.h> +/* for timestamping SYSINITs; other files may assume this is included here */ +#include <sys/tslog.h> + /* Global variables for the kernel. */ /* 1.1 */ @@ -229,14 +232,44 @@ struct sysinit { * correct warnings when -Wcast-qual is used. * */ +#ifdef TSLOG +struct sysinit_tslog { + sysinit_cfunc_t func; + 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); +} #define C_SYSINIT(uniquifier, subsystem, order, func, ident) \ + static struct sysinit_tslog uniquifier ## _sys_init_tslog = { \ + func, \ + (ident), \ + #uniquifier \ + }; \ static struct sysinit uniquifier ## _sys_init = { \ subsystem, \ order, \ + sysinit_tslog_shim, \ + &uniquifier ## _sys_init_tslog \ + }; \ + DATA_SET(sysinit_set,uniquifier ## _sys_init) +#else +#define C_SYSINIT(uniquifier, subsystem, order, func, ident) \ + static struct sysinit uniquifier ## _sys_init = { \ + subsystem, \ + order, \ func, \ (ident) \ }; \ DATA_SET(sysinit_set,uniquifier ## _sys_init) +#endif #define SYSINIT(uniquifier, subsystem, order, func, ident) \ C_SYSINIT(uniquifier, subsystem, order, \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201712310923.vBV9N2eG046656>