Subject: Re: kgmon -b causes a reboot (no kernel profiling)
To: Gary Thorpe <gathorpe79@yahoo.com>
From: Bill Studenmund <wrstuden@netbsd.org>
List: current-users
Date: 09/07/2006 11:09:37
--bCsyhTFzCvuiizWE
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Aug 31, 2006 at 11:09:47PM -0400, Gary Thorpe wrote:
> Hi,
>=20
> I was recently attempting to profile a kernel under different
> conditions. However, each time I try to enable profiling using 'kgmon
> -b' the machine reliably reboots (no ddb or panic).
>=20
> At first, I though it was because 'kgmon' was from 3.0, but the current
> version produces the same result as well. Is this just something wrong
> with my source tree/actions or is this universally repeatable?

No idea about repro, but I'm going to guess that the problem is that a
routine is getting profiled that shouldn't. There are a few routines which
aren't profiled even when you're profiling. They are the routines involved
in profiling itself.

So my guess is that a routine called as part of profiling is getting=20
profiled, which triggers a recursion, which makes the stack explode, which=
=20
can cause the box to just reboot.

A main problem is that anything to fix this, such as a stack guard page,=20
will trigger uvm code which is itself profiled, which will continue the=20
recursion.

So the only suggestions I can come up with are: 1) make sure your source=20
tree is clean, 2) look at the call graph for profiling routines and see if=
=20
one of the routines in the graph is not marked as "no profiling", and 3)=20
try a date-based checkout to see when the change happened & examine the=20
change that killed things.

Good luck!

Take care,

Bill

--bCsyhTFzCvuiizWE
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (NetBSD)

iD8DBQFFAGBhWz+3JHUci9cRAqY9AJ4pufHfjEGVm05lzusGHYCV0G5Z/wCfXSju
ukhZGFSbnKCMDGZ6y8Ol9v8=
=hNd4
-----END PGP SIGNATURE-----

--bCsyhTFzCvuiizWE--