[LTP] [PATCH v2] tst_dev_bytes_written: parsing /proc/diskstats instead of sys file

Cyril Hrubis chrubis@suse.cz
Wed Jan 8 14:12:31 CET 2020


Hi!
> Now, tst_dev_bytes_written api can get the whole disk stat correctly(such as /dev/sda),
> but can not get partition stat correctly(such as /dev/sda5).
> fail as below:
> export LTP_DEV=/dev/sda5
> tst_device.c:388: CONF: Test device stat file: /sys/block/sda5/stat not found

It seems that in case of partitions the stat file is available under
/sys/block/sda/sda5/stat.

For NVME it's similar as:

/sys/block/nvme0n1/nvme0n1p1/stat

I do wonder if it wouldn't be easier to try to match the prefix of the
device name first, then try a directory with a full name after that.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list