summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2009-12-07 16:13:49 -0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2009-12-07 16:18:21 -0200
commita3e85fe4e5cb43a99a81cb2cc5c56f3a430cd8ea (patch)
treea6443f6029051418965ac5f3aa49dd10234673f8
parent7d33dd16faaf8a58e85628f868a75f54d8bb3822 (diff)
downloadtuna-a3e85fe4e5cb43a99a81cb2cc5c56f3a430cd8ea.tar.gz
cmdline: On threaded irq kernels, map irqs to threads
So that all the operations will now accept receiving a list or irqs where they expected a list of threads. I.e.: [root@emilia tuna]# tuna -q eth0 -P -p fifo:91 -P thread ctxt_switches pid SCHED_ rtpri affinity voluntary nonvoluntary cmd 8102 FIFO 90 0xff 26602 0 IRQ-2241 eth0(tg3) thread ctxt_switches pid SCHED_ rtpri affinity voluntary nonvoluntary cmd 8102 FIFO 91 0xff 26607 0 IRQ-2241 eth0(tg3) [root@emilia tuna]# Now works, as well as the other operations, additional example: [root@emilia tuna]# tuna -t pcscd -q +eth0 -P -p fifo:92 -P --socket 0 -mP thread ctxt_switches pid SCHED_ rtpri affinity voluntary nonvoluntary cmd 8102 FIFO 90 0xff 31582 0 IRQ-2241 eth0(tg3) 8889 FIFO 90 0xff 16 40 pcscd thread ctxt_switches pid SCHED_ rtpri affinity voluntary nonvoluntary cmd 8102 FIFO 92 0xff 31589 0 IRQ-2241 eth0(tg3) 8889 FIFO 92 0xff 16 40 pcscd thread ctxt_switches pid SCHED_ rtpri affinity voluntary nonvoluntary cmd 8102 FIFO 92 0,2,4,6 31596 0 IRQ-2241 eth0(tg3) 8889 FIFO 92 0,2,4,6 16 40 pcscd [root@emilia tuna]# Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rwxr-xr-xtuna-cmd.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/tuna-cmd.py b/tuna-cmd.py
index 676c765..e362bdc 100755
--- a/tuna-cmd.py
+++ b/tuna-cmd.py
@@ -399,6 +399,8 @@ def i18n_init():
gettext.install(app, localedir)
def main():
+ global ps
+
i18n_init()
try:
short = "c:CfghiIKmp:PQq:s:S:t:UvWx"
@@ -423,7 +425,7 @@ def main():
cpu_list = None
irq_list = None
irq_list_str = None
- thread_list = None
+ thread_list = []
thread_list_str = None
filter = False
affect_children = False
@@ -538,7 +540,17 @@ def main():
irq_list_str = do_list_op(op, irq_list_str,
a.split(","))
if not op:
- thread_list = None
+ thread_list = []
+ if not ps:
+ ps = procfs.pidstats()
+ if tuna.has_threaded_irqs(ps):
+ for irq in irq_list:
+ irq_re = tuna.threaded_irq_re(irq)
+ irq_threads = ps.find_by_regex(irq_re)
+ if irq_threads:
+ thread_list += irq_threads
+ irq_list.remove(irq)
+
elif o in ("-U", "--no_uthreads"):
uthreads = False
elif o in ("-v", "--version"):