diff options
| author | ivan-boikov <ik.boikov.public@protonmail.com> | 2023-01-22 17:05:30 +0100 |
|---|---|---|
| committer | ivan-boikov <ik.boikov.public@protonmail.com> | 2023-01-22 17:05:30 +0100 |
| commit | f4ff2f79d2b7cbc691a1ebecd3919d4cc618da3b (patch) | |
| tree | 309557ae1299e8ea5e8ad1e7c093fffce22004d2 /scripts/.local/bin/checkzswap | |
| parent | f8070225744ddcae7ed861fd515f37784b878911 (diff) | |
1
Diffstat (limited to 'scripts/.local/bin/checkzswap')
| -rwxr-xr-x | scripts/.local/bin/checkzswap | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/scripts/.local/bin/checkzswap b/scripts/.local/bin/checkzswap deleted file mode 100755 index d6a4a00..0000000 --- a/scripts/.local/bin/checkzswap +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh - -# https://gist.github.com/phizev/31185a30e7d4984724f1fbbf9c2afe19 - -ENABLED=$(cat /sys/module/zswap/parameters/enabled) -COMPRESSOR=$(cat /sys/module/zswap/parameters/compressor) -ZPOOL=$(cat /sys/module/zswap/parameters/zpool) -PAGE_SIZE=$(getconf PAGE_SIZE) -STORED_PAGES=$(cat /sys/kernel/debug/zswap/stored_pages) -POOL_TOTAL_SIZE=$(cat /sys/kernel/debug/zswap/pool_total_size) - -POOL_SIZE=$(numfmt --to=iec-i $POOL_TOTAL_SIZE) - -if [ "$POOL_TOTAL_SIZE" = "0" ] -then - DECOMPRESSED_SIZE="N/A" - RATIO="N/A" -else - DECOMPRESSED_SIZE=$(echo "$STORED_PAGES * $PAGE_SIZE" | bc | numfmt --to=iec-i) - RATIO=$(echo "scale=3; $STORED_PAGES * $PAGE_SIZE / $POOL_TOTAL_SIZE" | bc -l) -fi - -echo "Zswap enabled: $ENABLED" -echo "Compressor: $COMPRESSOR" -echo "Zpool: $ZPOOL" -echo -echo "Page size: $PAGE_SIZE" -echo "Stored pages: $STORED_PAGES" -echo "Pool size: $POOL_SIZE" -echo "Decompressed size: $DECOMPRESSED_SIZE" -echo "Page compression ratio: $RATIO" - -if [ "$1" = "-v" ] -then - echo - grep -R . /sys/kernel/debug/zswap/ - grep -R . /sys/module/zswap/parameters/ -fi |
