Rework task selection
Fix #926 (closed)
Make the task selection/resolution methods more consistent and strict when used with task name or task PID. This assumes that the simple comm/PID interface is only meant for non-ambigous cases.
Introduce a new way of selecting tasks by using TaskID(pid, comm)
named tuples. It allows disambiguation in tricky cases. This include:
- when just specifying a comm or a PID is ambiguous, you can specify both to remove ambiguity
- when a specific PID is of interest regardless its task comm (or the opposit), the irrelevant field can be set to
None
. This gives an explicit way of avoiding the exception that would be raised when specifying an PID or comm alone (i.e. not in a tuple).