I have an embedded x86 computer board which does not have any kind of I/O activity LED (e.g. HDD LED). I am not using SATA drives so the normal workaround of using SATA PIN 11 as an activity indicator is a no-go. I also cannot change the hardware design since it it out of my control.
Due to the lack of alternatives I want to create a software based busy indicator that basically draws and clears a red square on the framebuffer depending on disk I/O activity. Drawing on the framebuffer is no problem for me; that part is solved.
What are my options to get the Linux kernel to tell me that it is starting and stopping to perform disk I/O?
Is there a kernel interface that a userspace C program can subscribe to so that the kernel notifies/wakes it up when disk I/O operations start and stop?
I would like to avoid parsing strings like I/O counters in /proc/ or /sys/ and, if at all possible, any kind of loop/polling.
Ideally it would be great to limit notifications to a single block device but that's not a dealbreaker.