aboutsummaryrefslogtreecommitdiffstats
path: root/bash-completion
diff options
context:
space:
mode:
authorMatteo Croce <teknoraver@meta.com>2025-05-23 03:59:36 +0200
committerMatteo Croce <teknoraver@meta.com>2025-05-29 16:15:01 +0200
commit36965bbfb36328e80e3511a11b85b63e8a41d998 (patch)
tree4b61a752ec0d6b9da305091b5b426142c6710ffa /bash-completion
parente4071d496fdbd8b2f1ae8d44a19888f8bbd60f5e (diff)
downloadutil-linux-36965bbfb36328e80e3511a11b85b63e8a41d998.tar.gz
add option to force cachestat() usage
When cachestat() is not available, mmap() and fincore() are used to get cache statistics. This fallback returns less data than cachestat, and potentially hides read errors by reporting that the file is all mapped in memory: $ fincore /usr/bin/java fincore: failed to do cachestat: /usr/bin/java: Operation not permitted RES PAGES SIZE FILE 208K 13 198,1K /usr/bin/java $ echo $? 0 $ sudo fincore /usr/bin/java RES PAGES SIZE FILE 0B 0 198,1K /usr/bin/java Add a --cachestat argument which forces cachestat usage and fails if it's not available: $ fincore -C /usr/bin/java fincore: failed to do cachestat: /usr/bin/java: Operation not permitted $ echo $? 1 Also, on huge files the fallback is very slow and memory consuming, so this flag can be user to avoid doing it by mistake.
Diffstat (limited to 'bash-completion')
-rw-r--r--bash-completion/fincore1
1 files changed, 1 insertions, 0 deletions
diff --git a/bash-completion/fincore b/bash-completion/fincore
index 5f073b4ec0..34007e04d8 100644
--- a/bash-completion/fincore
+++ b/bash-completion/fincore
@@ -33,6 +33,7 @@ _fincore_module()
--output-all
--raw
--recursive
+ --cachestat
--help
--version
"