You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For many processes on Linux, reading /proc/<pid>/exe or /proc/<pid>/cmdline does not yield any values, making it impossible to say "what" was it that consumed some energy.
Solution
At least as a workaround, reading /proc/<pid>/comm always yields something.
Alternatives
I am not aware of alternative ways to determine the executable or "name" of a process.
Additional context
Example Prometheus metrics query that prints out the comm value for every PID where there was no associated cmdline:
Problem
For many processes on Linux, reading
/proc/<pid>/exe
or/proc/<pid>/cmdline
does not yield any values, making it impossible to say "what" was it that consumed some energy.Solution
At least as a workaround, reading
/proc/<pid>/comm
always yields something.Alternatives
I am not aware of alternative ways to determine the executable or "name" of a process.
Additional context
Example Prometheus metrics query that prints out the
comm
value for every PID where there was no associatedcmdline
:As you can see, a lot of processes are managed by the Kernel itself, not any executable.
Also note PID 7101 above, bringing up "bash", which essentially is an actual process but a zombie, so reading
comm
helps here as well:The text was updated successfully, but these errors were encountered: