Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Nov 2019 13:09:44 -0800
From:      Enji Cooper <yaneurabeya@gmail.com>
To:        Peter Eriksson <pen@lysator.liu.se>
Cc:        freebsd-current@freebsd.org
Subject:   Re: Best way to print something from the kernel at 1s intervals?
Message-ID:  <DA769610-A087-40C4-B903-ACF34388CDE8@gmail.com>
In-Reply-To: <E6B8A0DA-5F4D-4B08-A376-0AE65575A6F9@lysator.liu.se>
References:  <E6B8A0DA-5F4D-4B08-A376-0AE65575A6F9@lysator.liu.se>

next in thread | previous in thread | raw e-mail | index | archive | help

> On Nov 28, 2019, at 12:52, Peter Eriksson <pen@lysator.liu.se> wrote:
>=20
> =EF=BB=BFI=E2=80=99ve been looking into the =E2=80=9Ckernel looks to be hu=
ng at reboot=E2=80=9D problem at bit. Adding a lot of printf() calls to the r=
elevant parts it looks like it actually isn=E2=80=99t hung but busy unmounti=
ng filesystems (which we have thousands of), flushing disk caches, calling r=
egistered callbacks and stuff and sometimes it takes a bit longer than usual=
 - probably due to ZFS having stuff queued up that needs to be written to di=
sk before it finishes=E2=80=A6
>=20
> Anyway, I=E2=80=99d like to propose that we add some kind of counter/print=
f() calls in that code area so we can see that things are indeed progressing=
. However, I=E2=80=99d probably prefer not to print _every_ filesystem (or r=
egistered callbacks - a lot of those...) - that generates a lot of output (t=
ried that :-) but something like:
>=20
> Unmounting filesystems:
> 1234 done
> (With the "1234 done=E2=80=9D updated something like once per second).
>=20
> What=E2=80=99s the right/best way to do that from the kernel? In user spac=
e I=E2=80=99d just call time(&t) at some convenient points and only print so=
mething if =E2=80=9Ct=E2=80=9D has changed. :-)

Can you use DTrace instead to get the information you need?
Cheers,
-Enji=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?DA769610-A087-40C4-B903-ACF34388CDE8>