[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 07/10] tools: Use -Og for debug builds when available


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Fri, 12 Feb 2021 16:09:18 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=j+LRUSpwIrw8tx0aiADHj3ZAhtrgGCphqQrMBT1Pqwo=; b=R55pNphujnWw7rHZuIuWkL4JWZLgFS+c3HBZKZhQX5+AlXRZvIWbKuPP6uRVmHYJQCecANKCFRzl11+r/YO4J9Sr8xVYp3/qBzocOdz+6kMxyT45BRadh8xSGVgIyhuApXyqq5u4ZbRUWdM5NzS2Fek3mss1PQTJ3udXzkqDI3x85mTadkQpfv43GARBhRBwegXu8Z9Lj5vIgYifLvfUIHiScsQfzUgAOwbw2PU2te4fLMkQ+ID70T9wlJoY0Hycp4ZNMqUR8E+WxRSJPkoGD2y39gRkwcXaPCXWiVU5zErViuDw0jz/zbpVKrC5UP1+UQeeFIGsja718VU4kihhyQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ja77gf+Xyshu94faMRdlkt0yqlcJLR7gMakyak69Ris2P9WUjXPzRkX5D19j0c994w2g/zaxKb9zTQqwiSrhsl63o9jHohRfrnL4cvWvwaLQi3YkFT1NxmIYQ2T+uYU5zCJEsxAP0aNsoKNDbrMTOF1ChCgidoMWfBOFTmm27oSmbxcdrtu1Yg9P7pC2hO7iA6BXH9P8zn8/VlgtrZ6TiQDNrnY1gxQjr/4JnPM4GWNItv0G9NyrMJvtddH5jdDh4bs3ViPMG+aZco90zADlz3MTakwxRF8JFtlCVBGVUNxCqFe0nPBKdxjI7NFAg6C2g2ZvhZKmt80hcDpvofBIjg==
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Delivery-date: Fri, 12 Feb 2021 16:09:35 +0000
  • Ironport-sdr: IpiVNqxszCKcX/2LAt0UcCjkiwBHjtIqA27gnV8X8Ty03+05BICZcsZ4LM+xpFGTe0K0jNbBxY qt1RAW8XNzZ2ARsXFWJ0cObCe1RSMJd7iuvtNkIw+sK9Op0J2BgHAuD6utY8bD9wPNUy+Q7HtX ez5qnSTVG1LhYBH8VJHKjxsgWgEAAHQZiFkgzwBMkD5+UhFFfrQj9yConsBCHwMx4ezDuCKN5V FslUR50yVH8Z+dOJSUc1ng2U8Vs8PQ66KdfjbZbvngQgsyrljVNyQCAXETiU9AbnXsESTpH0Wq UXw=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 12/02/2021 16:04, Jan Beulich wrote:
> On 12.02.2021 16:39, Andrew Cooper wrote:
>> The recommended optimisation level for debugging is -Og, and is what tools
>> such as gdb prefer.  In practice, it equates to -01 with a few specific
>> optimisations turned off.
>>
>> abi-dumper in particular wants the libraries it inspects in this form.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Thanks,

>
>> --- a/tools/Rules.mk
>> +++ b/tools/Rules.mk
>> @@ -106,8 +106,9 @@ endif
>>  CFLAGS_libxenlight += $(CFLAGS_libxenctrl)
>>  
>>  ifeq ($(debug),y)
>> -# Disable optimizations
>> -CFLAGS += -O0 -fno-omit-frame-pointer
>> +# Use -Og if available, -O0 otherwise
>> +dbg_opt_level := $(call cc-option,$(CC),-Og,-O0)
>> +CFLAGS += $(dbg_opt_level) -fno-omit-frame-pointer
> I wonder if we shouldn't do something similar for the hypervisor,
> where we use -O1 for debug builds right now. At least when
> DEBUG_INFO is also enabled, -Og may be better.

I also made that work... its rather more invasive in terms of changes -
all for "maybe uninitialised" warnings.

$ git diff e2bab84984^ --stat
 xen/Makefile                    | 3 ++-
 xen/arch/arm/domain_build.c     | 2 +-
 xen/arch/x86/irq.c              | 2 +-
 xen/arch/x86/mm/shadow/common.c | 2 +-
 xen/arch/x86/pv/shim.c          | 6 +++---
 xen/arch/x86/sysctl.c           | 4 ++--
 xen/common/efi/boot.c           | 2 +-
 7 files changed, 11 insertions(+), 10 deletions(-)

is what is required to make Gitlab happy.  I was planning to defer it to
4.16 at this point.

~Andrew



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.