diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2009-01-09 15:52:45 -0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2009-01-09 15:52:45 -0200 |
commit | 27edc242ef4fb934068d207f8a9e7f6da6a58f9a (patch) | |
tree | 43bbad5e6f87e8e820c545b2b9675d97d2ee5f8e | |
parent | 6f10fcb15911aec0d49c1426433e77228ccc38a4 (diff) | |
download | python-linux-procfs-27edc242ef4fb934068d207f8a9e7f6da6a58f9a.tar.gz |
interrupts: Add find_by_user_regexv0.4.2
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rwxr-xr-x | procfs/procfs.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/procfs/procfs.py b/procfs/procfs.py index 7b27f31..9621c4e 100755 --- a/procfs/procfs.py +++ b/procfs/procfs.py @@ -4,7 +4,7 @@ import os, time, utilist -VERSION="0.2" +VERSION="0.3" def process_cmdline(pid_info): if pid_info["cmdline"]: @@ -343,6 +343,17 @@ class interrupts: return i return None + def find_by_user_regex(self, regex): + irqs = [] + for i in self.interrupts.keys(): + if not self.interrupts[i].has_key("users"): + continue + for user in self.interrupts[i]["users"]: + if regex.match(user): + irqs.append(i) + break + return irqs + class cmdline: def __init__(self): self.options = {} |