summaryrefslogtreecommitdiffstats
path: root/coccinelle/run-coccinelle.sh
diff options
context:
space:
mode:
authorFrantisek Sumsal <frantisek@sumsal.cz>2023-12-26 19:39:12 +0100
committerFrantisek Sumsal <frantisek@sumsal.cz>2023-12-27 11:15:48 +0100
commitc633361f063b6ee2675b2075ff327ec2530fa21a (patch)
tree78544fed2fe4be6832df0af06bd887bb45fa3483 /coccinelle/run-coccinelle.sh
parentcoccinelle: help Coccinelle with some more complex macros (diff)
downloadsystemd-c633361f063b6ee2675b2075ff327ec2530fa21a.tar.xz
systemd-c633361f063b6ee2675b2075ff327ec2530fa21a.zip
coccinelle: dial back warnings about performance
Turns out I _really_ underestimated the impact of --include-headers-for-types, as it significantly reduces both runtime and storage penalties. For example, on my machine the runtime of uncached run goes down from ~15 minutes to ~2 minutes, and similarly the total storage needed by the cache goes from ~15 GiB down to ~3 GiB.
Diffstat (limited to 'coccinelle/run-coccinelle.sh')
-rwxr-xr-xcoccinelle/run-coccinelle.sh10
1 files changed, 2 insertions, 8 deletions
diff --git a/coccinelle/run-coccinelle.sh b/coccinelle/run-coccinelle.sh
index cc2bfc14c5..79536b3895 100755
--- a/coccinelle/run-coccinelle.sh
+++ b/coccinelle/run-coccinelle.sh
@@ -43,10 +43,6 @@ fi
mkdir -p "$CACHE_DIR"
echo "--x-- Using Coccinelle cache directory: $CACHE_DIR"
-echo "--x--"
-echo "--x-- Note: running spatch for the first time without populated cache takes"
-echo "--x-- a _long_ time (15-30 minutes). Also, the cache is quite large"
-echo "--x-- (~15 GiB), so make sure you have enough free space."
echo
for script in "${SCRIPTS[@]}"; do
@@ -69,10 +65,8 @@ for script in "${SCRIPTS[@]}"; do
#
# 4) Explicitly undefine the SD_BOOT symbol, so Coccinelle ignores includes guarded by #if SD_BOOT
#
- # 5) Use cache, since generating the full AST is _very_ expensive, i.e. the uncached run takes 15 - 30
- # minutes (for one rule(!)), vs 30 - 90 seconds when the cache is populated. One major downside of the
- # cache is that it's quite big - ATTOW the cache takes around 15 GiB, but the performance boost is
- # definitely worth it
+ # 5) Use cache, since generating the full AST is expensive. With cache we can do that only once and then
+ # reuse the cached ASTs for other rules. This cuts down the time needed to run each rule by ~60%.
parallel --halt now,fail=1 --keep-order --noswap --max-args=10 \
spatch --cache-prefix "$CACHE_DIR" \
-I src \