[LTP] [PATCH v2 1/1] Fix compression ratio calculation in zram01
Cyril Hrubis
chrubis@suse.cz
Fri Nov 8 16:29:02 CET 2019
Hi!
> + if [ ! -f "/sys/block/zram$i/mm_stat" ]; then
> + if [ $i -eq 0 ]; then
> + tst_resm TCONF "zram compression ratio test requires zram mm_stat sysfs file"
> + fi
>
> - tst_resm TINFO "zram used ${used_mem}M, zram disk sizes ${total_size}M"
> + continue
> + fi
>
> - local v=$((100 * $total_size / $used_mem))
> + local compr_size=`cat "/sys/block/zram$i/mm_stat" | awk '{print $2}'`
Why not just:
awk '{print $2}' /sys/block/zram$i/mm_stat
Other than this it looks good. Also no need to send v3, I can fix this
when applying.
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list