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

[UNIKRAFT PATCH 1/3] build: Add PGO and ASAN to MENUCONFIG



From: alicesuiu <alicesuiu17@xxxxxxxxx>

Signed-off-by: Alice Suiu <alicesuiu17@xxxxxxxxx>
---
 Config.uk   | 40 ++++++++++++++++++++++++++++++++++++++++
 Makefile.uk |  8 ++++++++
 2 files changed, 48 insertions(+)

diff --git a/Config.uk b/Config.uk
index 3235b91..0e21fa2 100644
--- a/Config.uk
+++ b/Config.uk
@@ -86,6 +86,46 @@ config OPTIMIZE_LTO
                will increase overall building time but creates more efficient
                Unikraft binaries.
 
+config OPTIMIZE_PGO
+       bool "PGO - Profile-guided optimization"
+       default n
+       help
+               Enables GCC to do code optimizations through PGO.
+
+if OPTIMIZE_PGO
+       choice PGO_PHASES
+       prompt "PGO Options"
+       default NO_PGO
+       help
+               Enables GCC to do code optimizations through PGO.
+
+
+       config OPTIMIZE_PGO_GENERATE
+               bool "profile-generate"
+               help
+                       Enables GCC to generate data for code optimization 
through PGO.
+
+       config OPTIMIZE_PGO_USE
+               bool "profile-use"
+               help
+                       Enables GCC to do code optimizations using 
profile-guided
+                       accomplished with PGO.
+
+       config NO_PGO
+               bool "NO-PGO"
+               help
+                       Do not optimize with PGO.
+
+       endchoice
+
+endif
+
+config OPTIMIZE_ASAN
+       bool "ASAN - AddressSanitizer"
+       default n
+       help
+               Enables GCC to detects memory corruption bugs.
+
 choice
        prompt "Debug information level"
        default DEBUG_SYMBOLS_LVL3
diff --git a/Makefile.uk b/Makefile.uk
index a78afc0..abc5475 100644
--- a/Makefile.uk
+++ b/Makefile.uk
@@ -36,6 +36,14 @@ COMPFLAGS-$(CONFIG_OPTIMIZE_LTO)          += -flto
 LIBLDFLAGS-$(CONFIG_OPTIMIZE_LTO)         += $(COMPFLAGS) $(COMPFLAGS-y) 
$(ARCHFLAGS) $(ARCHFLAGS-y)
 LDFLAGS-$(CONFIG_OPTIMIZE_LTO)            += $(COMPFLAGS) $(COMPFLAGS-y) 
$(ARCHFLAGS) $(ARCHFLAGS-y)
 
+# PGO
+COMPFLAGS-$(CONFIG_OPTIMIZE_PGO_GENERATE)          += -fprofile-generate
+LDFLAGS-$(CONFIG_OPTIMIZE_PGO_GENERATE)            += $(COMPFLAGS) 
$(COMPFLAGS-y) $(ARCHFLAGS) $(ARCHFLAGS-y) -fprofile-generate
+
+# ASAN
+COMPFLAGS-$(CONFIG_OPTIMIZE_ASAN)          += -fsanitize=address
+LDFLAGS-$(CONFIG_OPTIMIZE_ASAN)            += $(COMPFLAGS) $(COMPFLAGS-y) 
$(ARCHFLAGS) $(ARCHFLAGS-y) -fsanitize=address
+
 DBGFLAGS-$(CONFIG_DEBUG_SYMBOLS_LVL0)     += -g0
 DBGFLAGS-$(CONFIG_DEBUG_SYMBOLS_LVL1)     += -g1
 DBGFLAGS-$(CONFIG_DEBUG_SYMBOLS_LVL2)     += -g2
-- 
2.17.1




 


Rackspace

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