[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 7/7] xen: Use -Og for debug builds when available
- To: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- Date: Mon, 19 Apr 2021 15:01:32 +0100
- Authentication-results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
- Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
- Delivery-date: Mon, 19 Apr 2021 14:01:52 +0000
- Ironport-hdrordr: A9a23:Rd5jdKopNcXHAQ2UlMnTX4YaV5u6KtV00zAX/kB9WHVpW+SivY SHgOkb2RjoiDwYRXEnnpS6NLOdRG7HnKQZ3aA4Bp3neAX9omOnIMVZ7YXkyyD9ACGWzIRg/I 9aWexFBNX0ZGIQse/T6gO1Cstl5dGB/ryhi+u29QYUcShBbaZ84wBlTiOSFUNrTAdLbKBJb6 a0zMxBujamZDArft22b0N1FNTriv/qsNbdYRAADwM68wXmt1+VwZPzDhTw5GZ7bxph2rEnmF KlryXY4eGZv+i/2lvg0Qbonu1rsf/A7vcGO8CWkMgSLVzX+0yVTaBsQaeLsjxwgMzH0idMrP D2rx0tP9t+5hrqFwnbzyfF4AXu3C0j7HXv0zaj8B3eiPbkTzE3Adcpv/M7TjLl6lEttNw58K VH03PxjeszMTr8nT/w79WNahdylkDcmwtBrccviRVkMbc2Wft0l8gy7UlVGJAPEGbR84Y8Ct RjC8na+bJ/bU6aR2qxhBgi/PWcGlAIWjuWSEkLvcKYlxJMmmpi8kcezMsD2l8d6ZMGTYVe7e isCNUmqJh+CustKY5tDuYIRsW6Tk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bkwfbsNKlzkkgsk2y0GJO9PKnn4=
- Ironport-sdr: nKAw0paORZWMn2xzxBZJ2gUU4K0T24s3gCftZ+WLUFp7Wc7pFBsBftdOgcZEd9J0sgnBF31DiR SSIyoOJ4OQ/xIwm/ShX4wGAFGRFnhtH2svdemK1CK9cBWQqxtrFhKq5waGiPTf81k3ZyfsRusH EIm0FKVkByrusRU7vH4wKhyEvIbfkP5GP8E6AgC6NUMO2JYXfGKoGsJPYDiIHPin0YZFvMHqjO AC/ApiRRfIvXlLFENcv6m5ExEpvGhVW4r2ZbKikcRreLDiilHvpK33F4BQbYJ1NZaXLavKNV6D E5s=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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.
While the use of gdb isn't necessarily very helpful for Xen, the disassembly
will have fewer structural transformations vs C, and therefore will be easier
to follow.
Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
CC: Wei Liu <wl@xxxxxxx>
CC: Stefano Stabellini <sstabellini@xxxxxxxxxx>
CC: Julien Grall <julien@xxxxxxx>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
CC: Juergen Gross <jgross@xxxxxxxx>
Successful CI runs:
https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/287769787
https://cirrus-ci.com/build/5086280275984384
---
xen/Makefile | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/xen/Makefile b/xen/Makefile
index 9f3be7766d..128de93f5e 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -195,7 +195,9 @@ include/config/%.conf include/config/%.conf.cmd:
$(KCONFIG_CONFIG)
$(MAKE) $(kconfig) syncconfig
ifeq ($(CONFIG_DEBUG),y)
-CFLAGS += -O1
+# Use -Og if available, -O1 otherwise
+dbg_opt_level := $(call cc-option,$(CC),-Og,-O1)
+CFLAGS += $(dbg_opt_level)
else
CFLAGS += -O2
endif
--
2.11.0
|