multiload-ng icon indicating copy to clipboard operation
multiload-ng copied to clipboard

Fix sysfs path detection for /dev/nvme* and /dev/dm-*

Open nylen opened this issue 6 years ago • 0 comments

Before this PR, multiload_graph_disk_get_filter and multiload_graph_disk_get_data attempt to read from the following sysfs paths on my computer. Both are invalid, which leads to no devices or data in the disk graph:

/sys/block/nvme/nvme0n1p1/stat
/sys/block/dm-/dm-1/stat

After my changes, the block device prefixes are calculated correctly for nvme and dm- devices:

/sys/block/nvme0n1/nvme0n1p1/stat
/sys/block/dm-1/stat

There is probably a better way to get this sysfs path than by doing string manipulation, but I don't know it.

nylen avatar Apr 25 '18 04:04 nylen