Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Aug 2016 09:24:15 +0300
From:      Andriy Gapon <avg@FreeBSD.org>
To:        Zaphod Beeblebrox <zbeeble@gmail.com>, FreeBSD Hackers <freebsd-hackers@FreeBSD.org>
Subject:   Re: How to get better debugging for the kernel.
Message-ID:  <d3c8ec3b-9b91-9f79-c7cf-ad1f6660a3bf@FreeBSD.org>
In-Reply-To: <CACpH0Mcw1oTatUX3d7gJ4ys=dAj_y9C9vF_g110MrHVEup4mjQ@mail.gmail.com>
References:  <CACpH0Mcw1oTatUX3d7gJ4ys=dAj_y9C9vF_g110MrHVEup4mjQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 03/08/2016 00:35, Zaphod Beeblebrox wrote:
> I have just filed bug 211535.  I'd like to be more helpful, but I'm having
> some trouble with the level of optimization in the kernel.  Much of kgdb's
> output tells me that the value I'm looking for has been optimized away.
> 
> So... how do I compile a kernel or a module without optimization

I have this in my kernel configuration:
makeoptions     CONF_CFLAGS="-O1"

Also I have to use amd64-gcc to build the kernel because of a problem
that happens when using clang to compile amd64 kernel modules
(particularly zfs) at that optimization level.
It's as simple as:
- pkg install amd64-xtoolchain-gcc
- add CROSS_TOOLCHAIN=amd64-gcc to the buildkernel invocation

> _and_ how
> badly will that affect the runtime of a lightly loaded server?

I think that nobody would be able to tell you that in advance.
But I expect that you won't see any difference.
Why don't you try and report back? :-)

> My kernel is already compiled with -g.  That tells me that I'm looking in
> zap_leaf.c (part of ZFS).  Can I simply compile zap_leaf.c without
> optimization?


-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d3c8ec3b-9b91-9f79-c7cf-ad1f6660a3bf>