From owner-freebsd-hackers@freebsd.org Wed Aug 3 06:25:37 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39EBCBAB176 for ; Wed, 3 Aug 2016 06:25:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 922AE164F for ; Wed, 3 Aug 2016 06:25:36 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id JAA15278; Wed, 03 Aug 2016 09:25:34 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1bUpcU-000MjS-9e; Wed, 03 Aug 2016 09:25:34 +0300 Subject: Re: How to get better debugging for the kernel. To: Zaphod Beeblebrox , FreeBSD Hackers References: From: Andriy Gapon Message-ID: Date: Wed, 3 Aug 2016 09:24:15 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Aug 2016 06:25:37 -0000 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