forked from xlab-uiuc/linux-mcdc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
patches: add notes about CONFIG_WERROR
- Loading branch information
1 parent
3ffae81
commit 1054cec
Showing
4 changed files
with
19 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
From d005c3b310f93a00709a82b51c897f869c8178c0 Mon Sep 17 00:00:00 2001 | ||
From 28b4ad5dfa7f77f490b6c321c131f7ea694d5e76 Mon Sep 17 00:00:00 2001 | ||
From: Wentao Zhang <[email protected]> | ||
Date: Mon, 16 Sep 2024 19:16:54 -0500 | ||
Date: Wed, 25 Sep 2024 14:39:04 -0500 | ||
Subject: [PATCH v3 0/4] Enable measuring the kernel's Source-based Code Coverage and MC/DC with Clang | ||
|
||
This series adds support for building x86-64 kernels with Clang's Source- | ||
|
@@ -128,7 +128,9 @@ due to kernel size. As of LLVM 19 the max number of conditions possible is | |
32767. | ||
|
||
As of LLVM 19, certain expressions are still not covered, and will produce | ||
build warnings when they are encountered: | ||
build warnings when they are encountered. Consequently, to measure kernel's | ||
MC/DC, CONFIG_WERROR has to be disabled at this moment for successfully | ||
build the kernel. | ||
|
||
"[...] if a boolean expression is embedded in the nest of another boolean | ||
expression but separated by a non-logical operator, this is also not | ||
|
@@ -150,7 +152,9 @@ build warnings when they are encountered: | |
--- | ||
v2 -> v3: | ||
|
||
* Rebased onto v6.11 from v6.11-rc7. | ||
* No functional changes. | ||
* Rebased onto v6.11 from v6.11-rc6. | ||
* Add notes about CONFIG_WERROR. | ||
|
||
--- | ||
|
||
|
@@ -167,13 +171,13 @@ Wentao Zhang (4): | |
arch/x86/kernel/vmlinux.lds.S | 2 + | ||
include/asm-generic/vmlinux.lds.h | 36 +++++ | ||
kernel/Makefile | 1 + | ||
kernel/llvm-cov/Kconfig | 100 ++++++++++++ | ||
kernel/llvm-cov/Kconfig | 101 ++++++++++++ | ||
kernel/llvm-cov/Makefile | 5 + | ||
kernel/llvm-cov/fs.c | 253 ++++++++++++++++++++++++++++++ | ||
kernel/llvm-cov/llvm-cov.h | 156 ++++++++++++++++++ | ||
scripts/Makefile.lib | 23 +++ | ||
scripts/mod/modpost.c | 2 + | ||
13 files changed, 592 insertions(+), 1 deletion(-) | ||
13 files changed, 593 insertions(+), 1 deletion(-) | ||
create mode 100644 kernel/llvm-cov/Kconfig | ||
create mode 100644 kernel/llvm-cov/Makefile | ||
create mode 100644 kernel/llvm-cov/fs.c | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
From 16c9591109564f353e31769f7775f38dca195496 Mon Sep 17 00:00:00 2001 | ||
From bd8e4b2282e4051b6f349c020e7ebff8e262dcab Mon Sep 17 00:00:00 2001 | ||
From: Wentao Zhang <[email protected]> | ||
Date: Fri, 30 Aug 2024 14:49:24 -0500 | ||
Subject: [PATCH v3 2/4] llvm-cov: add Clang's MC/DC support | ||
|
@@ -73,9 +73,9 @@ Reviewed-by: Chuck Wolber <[email protected]> | |
Tested-by: Chuck Wolber <[email protected]> | ||
--- | ||
Makefile | 6 ++++++ | ||
kernel/llvm-cov/Kconfig | 36 ++++++++++++++++++++++++++++++++++++ | ||
kernel/llvm-cov/Kconfig | 37 +++++++++++++++++++++++++++++++++++++ | ||
scripts/Makefile.lib | 12 ++++++++++++ | ||
3 files changed, 54 insertions(+) | ||
3 files changed, 55 insertions(+) | ||
|
||
diff --git a/Makefile b/Makefile | ||
index 323af7343..590e96532 100644 | ||
|
@@ -95,10 +95,10 @@ index 323af7343..590e96532 100644 | |
ifdef CONFIG_CC_IS_GCC | ||
CFLAGS_GCOV += -fno-tree-loop-im | ||
diff --git a/kernel/llvm-cov/Kconfig b/kernel/llvm-cov/Kconfig | ||
index 9241fdfb0..66259e1f2 100644 | ||
index 9241fdfb0..8482d94f0 100644 | ||
--- a/kernel/llvm-cov/Kconfig | ||
+++ b/kernel/llvm-cov/Kconfig | ||
@@ -61,4 +61,40 @@ config LLVM_COV_PROFILE_ALL | ||
@@ -61,4 +61,41 @@ config LLVM_COV_PROFILE_ALL | ||
Note that a kernel compiled with profiling flags will be significantly | ||
larger and run slower. | ||
|
||
|
@@ -115,7 +115,8 @@ index 9241fdfb0..66259e1f2 100644 | |
+ This will add Clang's Source-based Code Coverage MC/DC | ||
+ instrumentation to your kernel. As of LLVM 19, certain expressions | ||
+ are still not covered, and will produce build warnings when they are | ||
+ encountered. | ||
+ encountered. Consequently, this option should not coexist with | ||
+ CONFIG_WERROR=y that is the default of x86-64. | ||
+ | ||
+ "[...] if a boolean expression is embedded in the nest of another | ||
+ boolean expression but separated by a non-logical operator, this is | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
From 90bb13a445e95fade37930fd83322f9e2cf3202a Mon Sep 17 00:00:00 2001 | ||
From 5344da08af40fa40e634076084967e7ef7407d16 Mon Sep 17 00:00:00 2001 | ||
From: Wentao Zhang <[email protected]> | ||
Date: Fri, 30 Aug 2024 14:48:53 -0500 | ||
Subject: [PATCH v3 3/4] x86: disable llvm-cov instrumentation | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
From d005c3b310f93a00709a82b51c897f869c8178c0 Mon Sep 17 00:00:00 2001 | ||
From 28b4ad5dfa7f77f490b6c321c131f7ea694d5e76 Mon Sep 17 00:00:00 2001 | ||
From: Wentao Zhang <[email protected]> | ||
Date: Fri, 30 Aug 2024 14:49:06 -0500 | ||
Subject: [PATCH v3 4/4] x86: enable llvm-cov support | ||
|