Does Proc::Interrupts() have a broken interface?
It looks like /proc/interrupts support was added in https://github.com/prometheus/procfs/pull/475 .
But it's unclear how this interface works or if it ever worked.
For example:
Interrupts()calls intop.path()to get the path to theinterruptsfile- https://github.com/prometheus/procfs/blob/bb7727a9ca9b3cd1559b42ffa74e13ef7efb6283/proc_interrupts.go#L45
- But
p.path()prepends a pid to the path- https://github.com/prometheus/procfs/blob/bb7727a9ca9b3cd1559b42ffa74e13ef7efb6283/proc.go#L288
/proc/<pid>/interrupts does not exist. There is only /proc/interrupts.
/proc/foo is associated with the kernel (all files one level under /proc). On an fresh docker container, with no userland processes running, find /proc -maxdepth 2 -name foo will return nothing for the second level, but doing a sleep 100& followed by cat /proc/$(pgrep sleep)/foo will show you the details about foo associated with the process of PID $(pgrep sleep).
I believe this can be closed now.
This is actually a bug. It should probably be p.proc.Path().
I believe I assumed the issue to only target /proc/<pid>/interrupts, rather than /proc/interrupts too, my bad. We do support the former, but not the latter, as @SuperQ pointed out above. I'll patch this up. :)