IOMonitor Plugin does not use optimal /proc parameter to find process PID
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
powernap |
Fix Released
|
Undecided
|
Andres Rodriguez | ||
powernap (Ubuntu) |
Fix Released
|
High
|
Andres Rodriguez |
Bug Description
Binary package hint: powernap
I have been looking at the forthcoming changes to powernap in natty and noticed something I think can be a significant enhancement for the IOMonitor Plugin.
The IOManager Plugin currently uses a regex search of '/proc/%s/cmdline' to find the process name pattern for a process it will be monitoring. Many processes that may be of interest to monitor with the IOManager do not have a command line. For example, NFS daemons processes, which would be very useful to monitor don't have a cmdline with the process name.
I suggest that instead the IOManager perform its regex search to find PIDs on the Name: field that is at the start of the /proc/PID/status record to search for process names. This would allow many more "interesting" processes to be monitored.
This would require a relatively simple modification to the Python script. Normally I'd code and test this myself before submitting the bug report, but I thought I'd report quickly in case there is any chance such a change can make it into Natty.
root@twilightzo
root 1638 2 0 Mar10 ? 00:00:00 [nfsd4]
root 1639 2 0 Mar10 ? 00:00:01 [nfsd]
root 1640 2 0 Mar10 ? 00:00:00 [nfsd]
root 1641 2 0 Mar10 ? 00:00:21 [nfsd]
root 1642 2 0 Mar10 ? 00:00:13 [nfsd]
root 1643 2 0 Mar10 ? 00:00:00 [nfsd]
root 1644 2 0 Mar10 ? 00:00:08 [nfsd]
root 1645 2 0 Mar10 ? 00:00:17 [nfsd]
root 1646 2 0 Mar10 ? 00:00:18 [nfsd]
root 3340 3129 0 08:46 pts/3 00:00:00 grep nfsd
root@twilightzo
root@twilightzo
Name: nfsd
State: S (sleeping)
Tgid: 1639
Pid: 1639
PPid: 2
TracerPid: 0
Uid: 0 0 0 0
Gid: 0 0 0 0
FDSize: 64
Groups:
Threads: 1
SigQ: 1/31638
SigPnd: 0000000000000000
ShdPnd: 0000000000000000
SigBlk: 0000000000000000
SigIgn: fffffffffffffef8
SigCgt: 0000000000000107
CapInh: 0000000000000000
CapPrm: ffffffffffffffff
CapEff: fffffffffffffeff
CapBnd: ffffffffffffffff
Cpus_allowed: 3
Cpus_allowed_list: 0-1
Mems_allowed: 00000000,00000001
Mems_allowed_list: 0
voluntary_
nonvoluntary_
Changed in powernap (Ubuntu): | |
assignee: | nobody → Andres Rodriguez (andreserl) |
status: | Triaged → In Progress |
Changed in powernap (Ubuntu): | |
status: | In Progress → Invalid |
Changed in powernap: | |
status: | New → In Progress |
Changed in powernap (Ubuntu): | |
assignee: | Andres Rodriguez (andreserl) → nobody |
Changed in powernap: | |
assignee: | nobody → Andres Rodriguez (andreserl) |
Changed in powernap (Ubuntu): | |
status: | Invalid → In Progress |
assignee: | nobody → Andres Rodriguez (andreserl) |
Changed in powernap (Ubuntu): | |
status: | In Progress → Fix Committed |
Changed in powernap: | |
status: | In Progress → Fix Committed |
Changed in powernap (Ubuntu): | |
status: | Fix Committed → Confirmed |
importance: | Low → Wishlist |
Changed in powernap (Ubuntu): | |
importance: | Wishlist → High |
Changed in powernap: | |
status: | Fix Committed → Fix Released |
One more piece of useful information. Processes without a /proc/PID/cmdline can be easily identified in the ps list, in that they have their process names placed inside square brackets. From the ps man page:
args COMMANDcommand with all its arguments as a string. Modifications to the arguments may be shown. The output in this column may contain spaces. A process marked <defunct> is partly dead, waiting to be fully destroyed by its parent. Sometimes the process args will be unavailable; when this happens, ps will instead print the executable name in brackets.