Age | Commit message (Collapse) | Author | Files | Lines |
|
Tuna checks if PF_NO_SETAFFINITY is set on /proc/PID/stat's 'flag' field
to verify if it is possible to migrate a process/thread. This is
working fine for process, but not for threads.
For threads, the file /proc/TID/stat is being checked, but this file
does not exist as the stat file of a thread is at
/proc/PID/task/TID/stat. Hence, the check was failing and threads were
not being migrated.
This patch adds a function to check thread's stat file, and this
function is called to verify the PF_NO_SETAFFINITY flag for threads.
Committer note:
Before, doing:
# tuna --cpu 3 --isolate
# tuna -t firefox -CP
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
14838 OTHER 0 0,1,2 873954 27498 firefox
14857 OTHER 0 0,1,2,3 3 1 Gecko_IOThread
14858 OTHER 0 0,1,2,3 1 0 Link Monitor
14859 OTHER 0 0,1,2,3 126717 12214 Socket Thread
<SNIP>
So it affected just the main thread, all the children remained with
their existing affinity mask.
After the patch:
# tuna --cpu 3 --isolate
# tuna -t firefox -CP
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
14838 OTHER 0 0,1,2 877488 27583 firefox
14857 OTHER 0 0,1,2 3 1 Gecko_IOThread
14858 OTHER 0 0,1,2 1 0 Link Monitor
14859 OTHER 0 0,1,2 126933 12235 Socket Thread
<SNIP>
Signed-off-by: Daniel Bristot de Oliveira <bristot@redhat.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Kastner <jkastner@redhat.com>
Cc: John Kacur <jkacur@redhat.com>
Cc: Luiz Capitulino <lcapitulino@redhat.com>
Cc: Tuna <tuna-devel@lists.fedorahosted.org>
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1286221
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
What should be "\n" is just "\"
Signed-off-by: Guy Streeter <streeter@redhat.com>
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
|
|
When /proc/sys/ path contain dot (for example netif name) and config
file using * for filename tuna fail with traceback:
Invalid item! file: /proc/sys/net/ipv6/conf/tuna/1/forwarding
Traceback (most recent call last):
File "/usr/bin/tuna", line 647, in <module>
main()
File "/usr/bin/tuna", line 641, in main
app = tuna_gui.main_gui(kthreads, uthreads, cpus_filtered)
File "/usr/lib/python2.7/site-packages/tuna/tuna_gui.py", line 64, in __init__
self.profileview.init_default_file()
File "/usr/lib/python2.7/site-packages/tuna/gui/profileview.py", line 146, in init_default_file
self.commonview.updateCommonView()
File "/usr/lib/python2.7/site-packages/tuna/gui/commonview.py", line 13, in updateCommonView
self.setup()
File "/usr/lib/python2.7/site-packages/tuna/gui/commonview.py", line 80, in setup
frameContent[catCntr]['texts'][contentCntr].set_value(int(self.config.ctlParams[catCntr][val]))
ValueError: invalid literal for int() with base 10: ''
This patch add support for escaping "." character.
Signed-off-by: Petr Oros <poros@redhat.com>
Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1178917
Signed-off-by: John Kacur <jkacur@redhat.com>
|
|
[root@felicio ~]# tuna -q en* -Q
# users affinity
54 enp1s0f0-TxRx-0 0,1,2 ixgbe
55 enp1s0f0-TxRx-1 0,1,2 ixgbe
56 enp1s0f0-TxRx-2 0,1,2 ixgbe
57 enp1s0f0-TxRx-3 0,1,2 ixgbe
58 enp1s0f0 0,1,2 ixgbe
59 enp1s0f1-TxRx-0 0,1,2 ixgbe
60 enp1s0f1-TxRx-1 0,1,2 ixgbe
61 enp1s0f1-TxRx-2 0,1,2 ixgbe
62 enp1s0f1-TxRx-3 0,1,2 ixgbe
63 enp1s0f1 0,1,2 ixgbe
66 enp7s0 0,1,2 atl1c
[root@felicio ~]# tuna -q en* -Q | head -4
54 enp1s0f0-TxRx-0 0,1,2 ixgbe
55 enp1s0f0-TxRx-1 0,1,2 ixgbe
56 enp1s0f0-TxRx-2 0,1,2 ixgbe
57 enp1s0f0-TxRx-3 0,1,2 ixgbe
[root@felicio ~]#
[root@felicio ~]# tuna -t xfs-d* -P
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
459 OTHER 0 0,1,2,3 2 1 xfs-data/dm-1
654 OTHER 0 0,1,2,3 2 0 xfs-data/sda1
669 OTHER 0 0,1,2,3 2 0 xfs-data/dm-2
[root@felicio ~]# tuna -t xfs-d* -P | head
459 OTHER 0 0,1,2,3 2 1 xfs-data/dm-1
654 OTHER 0 0,1,2,3 2 0 xfs-data/sda1
669 OTHER 0 0,1,2,3 2 0 xfs-data/dm-2
[root@felicio ~]#
Useful, for instance, when using wc to count how many IRQs or threadas match
some filters.
Signed-off-by: Arnaldo Carvalho de Melo <acme@felicio.ghostprotocols.net>
|
|
It is better to try accessing the fields catching exceptions, as just
checking if we have that key is not enough for, right after, that thread
having gone away and the populating of that dict entry not finding the
file on /proc/PID/.
Signed-off-by: Arnaldo Carvalho de Melo <acme@felicio.ghostprotocols.net>
|
|
We were avoiding moving kernel threads, for isolation purposes it is better
to check /perf/PID/stat's 'flag' big mask for PF_NO_SETAFFINITY instead.
Requested-by: Luiz Capitulino <lcapitulino@redhat.com>
Cc: Clark Williams <williams@redhat.com>
Cc: Guy Streeter <streeter@redhat.com>
Cc: Jeremy Eder <jeder@redhat.com>
Cc: Jiri Kastner <jkastner@redhat.com>
Cc: John Kacur <jkacur@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@felicio.ghostprotocols.net>
|
|
When isolating CPUs we affect the IRQ smp_affinity masks, but that will not
affect new devices, to make the isolation operation to stick for that case too we
need to remove the isolated CPUs from the /proc/irq/default_smp_affinity file,
that is what is used to set the initial affinity mask for new device IRQs.
E.g.:
[root@emilia git]# tuna -q enp21s0f0-* -Q
# users affinity
66 enp21s0f0-TxRx-0 0xff ixgbe
67 enp21s0f0-TxRx-1 0xff ixgbe
68 enp21s0f0-TxRx-2 0xff ixgbe
69 enp21s0f0-TxRx-3 0xff ixgbe
[root@emilia git]# cat /proc/irq/default_smp_affinity
ff
[root@emilia git]# tuna -S1 --isolate
[root@emilia git]# tuna -q enp21s0f0-* -Q
# users affinity
66 enp21s0f0-TxRx-0 0,2,4,6 ixgbe
67 enp21s0f0-TxRx-1 0,2,4,6 ixgbe
68 enp21s0f0-TxRx-2 0,2,4,6 ixgbe
69 enp21s0f0-TxRx-3 0,2,4,6 ixgbe
[root@emilia git]# cat /proc/irq/default_smp_affinity
55
>>> hex((1 << 0) | (1 << 2) | (1 << 4) | (1 << 6))
'0x55'
[root@emilia git]# tuna --cpu 6 --isolate
[root@emilia git]# tuna -q enp21s0f0-* -Q
# users affinity
66 enp21s0f0-TxRx-0 0,2,4 ixgbe
67 enp21s0f0-TxRx-1 0,2,4 ixgbe
68 enp21s0f0-TxRx-2 0,2,4 ixgbe
69 enp21s0f0-TxRx-3 0,2,4 ixgbe
[root@emilia git]# cat /proc/irq/default_smp_affinity
15
>>> hex((1 << 0) | (1 << 2) | (1 << 4))
'0x15'
[root@emilia git]# tuna --cpu 1 --include
[root@emilia git]# tuna -q enp21s0f0-* -Q
# users affinity
66 enp21s0f0-TxRx-0 0,1,2,4 ixgbe
67 enp21s0f0-TxRx-1 0,1,2,4 ixgbe
68 enp21s0f0-TxRx-2 0,1,2,4 ixgbe
69 enp21s0f0-TxRx-3 0,1,2,4 ixgbe
[root@emilia git]# cat /proc/irq/default_smp_affinity
17
>>> hex((1 << 0) | (1 << 1) | (1 << 2) | (1 << 4))
'0x17'
Requested-by: Luiz Capitulino <lcapitulino@redhat.com>
Cc: Clark Williams <williams@redhat.com>
Cc: Guy Streeter <streeter@redhat.com>
Cc: Jeremy Eder <jeder@redhat.com>
Cc: Jiri Kastner <jkastner@redhat.com>
Cc: John Kacur <jkacur@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
We should 'import gtk', not 'import pygtk', fixes bugs when the error
paths try to use gtk.messageDialog():
[root@ssdandy tuna]# tuna
Traceback (most recent call last):
File "/home/acme/git/tuna/tuna-cmd.py", line 654, in <module>
main()
File "/home/acme/git/tuna/tuna-cmd.py", line 648, in main
app = tuna_gui.main_gui(kthreads, uthreads, cpus_filtered)
File "/home/acme/git/tuna/tuna/tuna_gui.py", line 64, in __init__
self.profileview.init_default_file()
File "/home/acme/git/tuna/tuna/gui/profileview.py", line 141, in
init_default_file
not self.config.load(self.config.config['lastfile']):
File "/home/acme/git/tuna/tuna/config.py", line 48, in load
if(self.tuned2Tuna(profileName) < 0):
File "/home/acme/git/tuna/tuna/config.py", line 66, in tuned2Tuna
dialog = gtk.MessageDialog(None, 0, gtk.MESSAGE_ERROR,\
NameError: global name 'gtk' is not defined
[root@ssdandy tuna]#
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
This will set as the cpu list what was configured on the nohz_full=
kernel command line argument, allowing isolating these CPUs and then
moving to it some important app, i.e. all the other operations one
can do in tuna can apply to that cpu list.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
|
|
change the desktop icon
Signed-off-by: Guy Streeter <streeter@redhat.com>
Tested-by: Jiri Kastner <jkastner@redhat.com>
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
|
|
CLI: fix traceback when -p is used with unsupported value
$ tuna -t 4364 -p fif
Traceback (most recent call last):
File "/usr/bin/tuna", line 647, in <module>
main()
File "/usr/bin/tuna", line 531, in main
tuna.threads_set_priority(thread_list, a, affect_children)
File "/usr/lib/python2.7/site-packages/tuna/tuna.py", line 502, in threads_set_priority
rtprio = int(parms[0])
ValueError: invalid literal for int() with base 10: 'fif'
Signed-off-by: Petr Oros <poros@redhat.com>
Tested-by: Jiri Kastner <jkastner@redhat.com>
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
|
|
Signed-off-by: Petr Oros <poros@redhat.com>
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
|
|
Tuna showing traceback when user haven't set DISPLAY variable and using CLI with param -l.
This is caused by gtk library which try create "window", but in CLI mode is not neccesary.
Patch remove unnecesary library which cause this problem
Tested-by: Jiri Kastner <jkastner@redhat.com>
Signed-off-by: Petr Oros <poros@redhat.com>
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
|
|
Tuna throwing value error when not specified priority.
Example: tuna -t PID_OF_SOME_PROCESS -p OTHER
Here "other" not priority, but scheduler policy.
For RR and FIFO default 1. For OTHER and BATCH default 0.
After patch apply, tuna use first part of string as policy and remaining part as priority.
All unacceptable values cause exception in schedutils library and tuna show error
Tested-by: Jiri Kastner <jkastner@redhat.com>
Signed-off-by: Petr Oros <poros@redhat.com>
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
|
|
Tested-By: Jiri Kastner <jkastner@redhat.com>
Signed-off-by: Petr Oros <poros@redhat.com>
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
|
|
Remove a stray </a> without a paired <a>. This was probably left over from
an early edit. It doesn't cause any harm for html parsers that ignore it,
but can cause complaints by tools that look for problems in xml.
Signed-off-by: John Kacur <jkacur@redhat.com>
Signed-off-by: Jiri Kastner <jkastner@redhat.com>
|
|
Signed-off-by: Petr Oros <poros@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Petr Oros <poros@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Petr Oros <poros@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Petr Oros <poros@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Petr Oros <poros@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Petr Oros <poros@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Description of problem:
when tuna is launched on some custom kernel with missing /proc/sys
entry, configuration is not loaded.
Steps to Reproduce:
1. edit /etc/tuna/example.conf and put there nonsense /proc/sys entry
with some value (e.g. kernel.crap = 1000 to [kernel] section)
2. run runa
3. check results
Actual results:
dialog with warning 'File not found: /proc/sys/kernel.crap' appears
'Profile management' tab not loaded
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=974035
Signed-off-by: Petr Oros <poros@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
The user should be able to invoke the tuna GUI from the desktop. Since
running a desktop as root is inadvisable, the tuna GUI should be able to
ask for authorization and run as root.
Tested-by: Jiri Kastner <jkastner@redhat.com>
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=919212
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=974027
Signed-off-by: Petr Oros <poros@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Petr Oros <poros@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Petr Oros <poros@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Petr Oros <poros@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Petr Oros <poros@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Main window divided into 3 pages: Monitoring, Profile management, Profile
editing.
Signed-off-by: Petr Oros <poros@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Petr Oros <poros@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
-l list preloaded config files
-a apply changes from config to system -G only with -P param, modify -P
behavior -> append cgroup into process list
Signed-off-by: Petr Oros <poros@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
config
Signed-off-by: Petr Oros <poros@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Petr Oros <poros@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
When selecting a single thread we will no find it in the list of all
processes, so we need to figure out the parent thread and then find
the individual thread info in its threads member.
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=601234
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
I.e. don't consider all OSError as if the process went away, as this
trows away other errors we want to know about.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
The python-schedutils package incorrectly raise SystemError instead of
OSError when a specified PID did not exist. It has since been corrected,
but tuna is still looking for the SystemError exception everywhere.
Look for both, so that tuna works with old and new versions, a followup
patch will tighten the handling, checking if the error is '3', no such
process, if not, re-raise the exception.
Signed-off-by: Guy Streeter <streeter@redhat.com>
[ committer note: Don't replace SystemError with OSError, handle both ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Contributed by Guy Streeter.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
As:
[root@sandy tuna]# chrt --pid 8
pid 8's current scheduling policy: SCHED_FIFO
pid 8's current scheduling priority: 99
[root@sandy tuna]#
[root@sandy tuna]# tuna -t 8 -P
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
8 FIFO 99 0 59190 0 migration/0
[root@sandy tuna]#
[root@sandy tuna]# chrt --fifo --pid 99 8
chrt: failed to set pid 8's policy: Invalid argument
[root@sandy tuna]# chrt --fifo --pid 98 8
chrt: failed to set pid 8's policy: Invalid argument
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
On 3.6.0-rt1 we don't have events/*, don't try to change migration/*
scheduler policy, it'll fail.
Use watchdog/*, reducing its prio to current - 1, now it is back
working:
[root@sandy tuna]# ./testuna
PASS: Healthy tuna, no lead found, eat!
[root@sandy tuna]#
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
(i.e. ARM)
Signed-off-by: Chris Lockfort <clockfort@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
We need to present it in some better way, like its done in 'perf top',
decaying over time and providing a percentage, not just a raw cycles
count.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
To avoid these messages:
[root@felicio tuna]# cyclictest -t1 -n -p99 -i100 -o10 -v | oscilloscope -s1000 >/dev/null
/usr/lib64/python2.7/site-packages/matplotlib/font_manager.py:1242: UserWarning: findfont: Font family ['Bitstream Vera Sans'] not found. Falling back to Bitstream Vera Sans
(prop.get_family(), self.defaultFamily[fontext]))
/usr/lib64/python2.7/site-packages/matplotlib/font_manager.py:1252: UserWarning: findfont: Could not match :family=Bitstream Vera Sans:style=normal:variant=normal:weight=bold:stretch=normal:size=10.0. Returning /usr/share/fonts/un-core/UnDotum.ttf
UserWarning)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
The numpy package obsoletes Numeric, several distros are removing Numeric
or plain never included it, so switch to numpy.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Without this the oscilloscope classes don't get packaged.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Description of problem:
tuna skips some IRQ threads when applying CPU IRQ affinity with --move
option.
Version-Release number of selected component (if applicable):
tuna-0.9.4-1.el5rt
How reproducible:
always
Steps to Reproduce:
# users affinity
.... snip ....
64 eth0-0 0xffff bnx2
65 eth0-1 0xffff bnx2
66 eth0-2 0xffff bnx2
67 eth0-3 0xffff bnx2
68 eth0-4 0xffff bnx2
69 eth0-5 0xffff bnx2
70 eth0-6 0xffff bnx2
71 eth0-7 0xffff bnx2
Actual results:
.... snip ....
64 eth0-0 0xffff bnx2
65 eth0-1 0xff bnx2
66 eth0-2 0xffff bnx2
67 eth0-3 0xff bnx2
68 eth0-4 0xffff bnx2
69 eth0-5 0xff bnx2
70 eth0-6 0xffff bnx2
71 eth0-7 0xff bnx2
Expected results:
.... snip ....
64 eth0-0 0xff bnx2
65 eth0-1 0xff bnx2
66 eth0-2 0xff bnx2
67 eth0-3 0xff bnx2
68 eth0-4 0xff bnx2
69 eth0-5 0xff bnx2
70 eth0-6 0xff bnx2
71 eth0-7 0xff bnx2
Additional info:
tuna GUI can set IRQ affinity correctly.
Comment 1 Rogan Kyuseok Lee 2010-12-23 21:41:19 EST
elif o in ("-q", "--irqs"):
(op, a) = pick_op(a)
op_list = reduce(lambda i, j: i + j,
map(irq_mapper, list(set(a.split(",")))))
irq_list = do_list_op(op, irq_list, op_list)
# See comment above about thread_list_str
if not op_list and type(a) == type(''):
irq_list_str = do_list_op(op, irq_list_str,
a.split(","))
if not op:
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)
The given irqs from command-line are stored in irq_list variable. If
there is a relevant threaded irq of an IRQ, put the thread into
thread_list and remove the IRQ from irq_list. However, it
unintentionally makes skipping an element because an index in the for
statement has been already moved to a next element.
64 eth0-0 0xffff bnx2
65 eth0-1 0xff bnx2
66 eth0-2 0xffff bnx2
67 eth0-3 0xff bnx2
68 eth0-4 0xffff bnx2
69 eth0-5 0xff bnx2
70 eth0-6 0xffff bnx2
71 eth0-7 0xff bnx2
As a result, threads_list contains IRQ threads for 64, 66, 68, 70. The
rest of IRQs are remained in irq_list. So, CPU affinity only apply to
irq_list.
elif o in ("-m", "--move", "-x", "--spread"):
if not cpu_list:
print "tuna: --move " + _("requires a cpu list!")
sys.exit(2)
if not (thread_list or irq_list):
print "tuna: --move " + _("requires a list of threads/irqs!")
sys.exit(2)
spread = o in ("-x", "--spread")
if thread_list:
tuna.move_threads_to_cpu(cpu_list, thread_list,
spread = spread)
if irq_list:
tuna.move_irqs_to_cpu(cpu_list, irq_list,
spread = spread)
move_irqs_to_cpu calls set_irq_affinity to set IRQ's CPU affinity on a
given IRQ.
In case of move_threads_to_cpu, it sets process's CPU affinity mask on a
given thread using schedutils.set_affinity which is a wrapper for
sched_setaffinity(2). But it doesn't generally set IRQ's CPU affinity.
So, I've proposed a patch which basically makes IRQs remaining in
irq_list.
Reported on BZ: 665483
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Used to work in previous python versions, but since at least 2.6.5 doing
the import in one method and then trying to use perf.something on
another doesn't work:
File "/home/acme/git/tuna/tuna/gui/procview.py", line 317, in perf_init
self.cpu_map = perf.cpu_map()
NameError: global name 'perf' is not defined
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
I.e. fix the perf availability detection.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Now we pass cpus and maps to the evlist constructor, not to every other
method that needs it.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
So that we can have access to all sorts of hardware and software counters and
as well stop polling /proc to notice new threads and threads dying.
To check that it is using, see the signature one mmap per cpu mmaps + the
perf.so binding being dlopen'ed by the python interpreter when finding 'import
perf', etc.
# cat /proc/`pidof tuna`/maps
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
[root@emilia tuna]# cat /proc/1883/maps | grep perf
7fa583072000-7fa5830f3000 rw-s 00000000 00:09 4166 anon_inode:[perf_event]
7fa5830f3000-7fa583174000 rw-s 00000000 00:09 4166 anon_inode:[perf_event]
7fa583174000-7fa5831f5000 rw-s 00000000 00:09 4166 anon_inode:[perf_event]
7fa5831f5000-7fa583276000 rw-s 00000000 00:09 4166 anon_inode:[perf_event]
7fa583276000-7fa5832f7000 rw-s 00000000 00:09 4166 anon_inode:[perf_event]
7fa5832f7000-7fa583378000 rw-s 00000000 00:09 4166 anon_inode:[perf_event]
7fa583378000-7fa5833f9000 rw-s 00000000 00:09 4166 anon_inode:[perf_event]
7fa5833f9000-7fa58347a000 rw-s 00000000 00:09 4166 anon_inode:[perf_event]
7fa58347a000-7fa583483000 r-xp 00000000 fd:00 2229604 /home/acme/git/build/perf/lib.linux-x86_64-2.6/perf.so
7fa583483000-7fa583682000 ---p 00009000 fd:00 2229604 /home/acme/git/build/perf/lib.linux-x86_64-2.6/perf.so
7fa583682000-7fa583685000 rw-p 00008000 fd:00 2229604 /home/acme/git/build/perf/lib.linux-x86_64-2.6/perf.so
[root@emilia tuna]#
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
testuna needed a fix and I forgot to update the version strings to 0.9.3.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
RHBZ-Reference: https://bugzilla.redhat.com/show_bug.cgi?id=590897
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
[root@mica ~]# tuna -t 3876 -c +0x0-1,3 -m
[root@mica ~]# tuna -t nscd -CP
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
3862 OTHER 0 0,1,2,3 12997 409 nscd
3875 OTHER 0 0,1,2,3 1905 126 nscd
3876 OTHER 0 0,1,3 1940 106 nscd
3877 OTHER 0 0,1,2,3 2049 130 nscd
3878 OTHER 0 0,1,2,3 1271 88 nscd
3879 OTHER 0 0,1,2,3 1243 81 nscd
3880 OTHER 0 0,1,2,3 1250 94 nscd
[root@mica ~]# tuna -t 3876 -c +0x0-2 -m
[root@mica ~]# tuna -t nscd -CP
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
3862 OTHER 0 0,1,2,3 13000 409 nscd
3875 OTHER 0 0,1,2,3 1909 126 nscd
3876 OTHER 0 0,1,2 1944 106 nscd
3877 OTHER 0 0,1,2,3 2054 130 nscd
3878 OTHER 0 0,1,2,3 1272 88 nscd
3879 OTHER 0 0,1,2,3 1244 81 nscd
3880 OTHER 0 0,1,2,3 1250 94 nscd
[root@mica ~]#
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Reported-by: Guy Streeter <streeter@redhat.com>
RHBZ-Reference: https://bugzilla.redhat.com/show_bug.cgi?id=559770
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
[root@mica ~]# tuna -t agetty -p OTHE:0
tuna: Unknown scheduler
Reported-by: Guy Streeter <streeter@redhat.com>
RHBZ-Reference: https://bugzilla.redhat.com/show_bug.cgi?id=563350
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Reported-by: Guy Streeter <streeter@redhat.com>
RHBZ-Reference: https://bugzilla.redhat.com/show_bug.cgi?id=563352
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
tuna --help shows the --priority syntax as
-p, --priority=[POLICY]:RTPRIO
but the colon should only be present when the optional policy is supplied.
It should look like:
-p, --priority=[POLICY:]RTPRIO
RHBZ-Reference: https://bugzilla.redhat.com/show_bug.cgi?id=563355
Reported-by: Guy Streeter <streeter@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Needed to really fix https://bugzilla.redhat.com/show_bug.cgi?id=574950
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
This version makes sure that if you use the '0x' form, it's the first thing on
the line. We shouldn't allow mixing a bitmask and a list.
Patch taken from https://bugzilla.redhat.com/show_bug.cgi?id=574950
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Tested with:
while true ; do
modprobe ixgbe
ifup eth1
ifup eth2
for a in $(seq 200) ; do
pethtool -i > /dev/null
done
rmmod ixgbe > /dev/null
done
That is a multi-q rx/tx adapter and thus uses lots of IRQs.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
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>
|
|
Introduced in:
50f1a4234d03a7766d406f3ec53bf1fff2f0a644 "tuna: Handle 2.6.31 style threaded irq names"
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Next csets will try to transform an irq_list into a thread list if running on a
threaded interrupts kernel, so that 'tuna -q list -p fifo:90', for instance,
works.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
[root@emilia ~]# tuna -c0 -q eth2-* -Q
# users affinity
147 eth2-rx-0 0 ixgbe
211 eth2-tx-0 0 ixgbe
[root@emilia ~]#
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
To show the IRQs without thread details (pid, sched policy):
[root@emilia tuna]# tuna -q eth* -Q
# users affinity
51 eth1-rx-5 0xaf ixgbe
52 eth2-tx-4 2,4 ixgbe
59 eth1-rx-6 4,6 ixgbe
60 eth2-tx-5 0,2,6 ixgbe
67 eth1-rx-7 0,2,6 ixgbe
68 eth2-tx-6 2,6 ixgbe
75 eth1-tx-0 0,2,6 ixgbe
76 eth2-tx-7 0,2,6 ixgbe
83 eth1-tx-1 4,6 ixgbe
84 eth2:lsc 0xff
91 eth1-tx-2 0,2,6 ixgbe
92 eth0 0,2,4,6 tg3
98 eth4-tx-0 0xff igb
99 eth1-tx-3 0,2,6 ixgbe
106 eth4-rx-0 4,6 igb
107 eth1-tx-4 2,6 ixgbe
114 eth4-rx-1 2,4 igb
115 eth1-tx-5 0xaf ixgbe
122 eth4-rx-2 0xaf igb
123 eth1-tx-6 2,6 ixgbe
130 eth4-rx-3 0,2,6 igb
131 eth1-tx-7 2,4 ixgbe
138 eth4 0xff igb
139 eth1:lsc 0xff
147 eth2-rx-0 2,6 ixgbe
154 eth3-tx-0 0xff igb
155 eth2-rx-1 0,2,6 ixgbe
162 eth3-rx-0 0xae igb
163 eth2-rx-2 0xaf ixgbe
170 eth3-rx-1 0xea igb
171 eth2-rx-3 2,6 ixgbe
178 eth3-rx-2 2,4,6 igb
179 eth2-rx-4 0,2,6 ixgbe
186 eth3-rx-3 0xfe igb
187 eth2-rx-5 0xaf ixgbe
194 eth3 0xff igb
195 eth2-rx-6 2,6 ixgbe
202 eth1-rx-0 2,4 ixgbe
203 eth2-rx-7 2,4 ixgbe
210 eth1-rx-1 0,2,6 ixgbe
211 eth2-tx-0 4,6 ixgbe
218 eth1-rx-2 0,2,6 ixgbe
219 eth2-tx-1 2,4 ixgbe
226 eth1-rx-3 2,6 ixgbe
227 eth2-tx-2 0,2,6 ixgbe
234 eth1-rx-4 2,6 ixgbe
235 eth2-tx-3 2,6 ixgbe
[root@emilia tuna]#
Operations on IRQs also work well, on kernels with/without threaded IRQs:
[root@emilia tuna]# tuna -q eth3* -Q --cpu 3 --move -Q
# users affinity
154 eth3-tx-0 0xff igb
162 eth3-rx-0 0xae igb
170 eth3-rx-1 0xea igb
178 eth3-rx-2 2,4,6 igb
186 eth3-rx-3 0xfe igb
194 eth3 0xff igb
# users affinity
154 eth3-tx-0 0xff igb
162 eth3-rx-0 0xae igb
170 eth3-rx-1 0xea igb
178 eth3-rx-2 2,4,6 igb
186 eth3-rx-3 0xfe igb
194 eth3 0xff igb
[root@emilia tuna]# tuna -q eth3* -Q --cpu 3 --move -Q
# users affinity
154 eth3-tx-0 0xff igb
162 eth3-rx-0 3 igb
170 eth3-rx-1 3 igb
178 eth3-rx-2 3 igb
186 eth3-rx-3 3 igb
194 eth3 0xff igb
# users affinity
154 eth3-tx-0 0xff igb
162 eth3-rx-0 3 igb
170 eth3-rx-1 3 igb
178 eth3-rx-2 3 igb
186 eth3-rx-3 3 igb
194 eth3 0xff igb
[root@emilia tuna]#
As we can see there is the delay in updating the IRQ affinity mask in
/proc/irq/N/smp_affinity, I'll have to think about a way to generate an
interrupt after changing it, perhaps by calling some ethtool method to get
statistics just after changing the IRQ mask...
Also multi-q NICs such as the above ones probably deserve some special --spread
cmdline option so that NICs with the same number of RX and TX queues get rx-N
and tx-N on the same core for roundtrip workloads (aka benchmarks ;-)).
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Satoru SATOH <ssato@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Thanks to John Lau and the guys at the Red Hat GSS China team!
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Noticed when using tuna on a system with more than 9 sockets!
Reported-by: Darren Hart <dvhltc@us.ibm.com>
Tested-by: John Stultz <johnstul@us.ibm.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
ssh://master.kernel.org/pub/scm/linux/kernel/git/acme/tuna
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Before:
[acme@emilia tuna]$ tuna
Traceback (most recent call last):
File "./tuna-cmd.py", line 501, in ?
main()
File "./tuna-cmd.py", line 488, in main
from tuna import tuna_gui
File "/home/acme/git/tuna/tuna/tuna_gui.py", line 7, in ?
import gtk, gobject, os, procfs, sys
File "/usr/lib64/python2.4/site-packages/gtk-2.0/gtk/__init__.py", line 76, in ?
_init()
File "/usr/lib64/python2.4/site-packages/gtk-2.0/gtk/__init__.py", line 64, in _init
_gtk.init_check()
RuntimeError: could not open display
After:
[acme@emilia tuna]$ tuna
tuna: machine needs to be authorized via xhost or ssh -X?
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
And since it has the user encoded (acpi, usb-uhci, etc) avoid repeating it in
--show_threads/-P, showing only the driver name if it is a NIC (using ethtool).
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Suggested-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
So that we can convert samples in, say, milliseconds to microseconts,
using something like:
oscilloscope --sample_multiplier 1000 -uus
Reported-by: Tom Tracy <ttracy@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Use install -p and add BuildReq for gettext
Suggested-by: Jan Klepek <jan.klepek@hp.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
This regression was introduced in
691378600421fda478e3ac08946ce0d516f509ff.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
So that the glade translations can be properly rendered.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
As translations can get quite verbose. How to make the translations
reflow the window so that all of the are visible?
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
i18n/l10n of help texts originally in help/*/*.
This patch adds tuna/help.py converted from help/*/* and updates related
parts.
Cc: Jon Masters <jcm@redhat.com>
Cc: Clark Williams <clark@redhat.com>
Signed-off-by: Satoru SATOH <ssato@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Luis Claudio R. Gonçalves <lgoncalv@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Written by Carsten Emde <Carsten.Emde@osadl.org>, who allowed its use as
documentation in this package.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
It now just checks if it is present and if it isn't just doesn't
offer the -n/--show_sockets option.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
The --help one for instance helps making consistent the CPU-LIST, etc
translations. It should also help by not requiring adjusting the fuzzy
translation after adding a new command line option.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Its better to always generate it from the sources.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Patch and translation contributed by Satoru SATOH <ssato@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
The last hbox was not being added. I.e. on a 8 socket machine (virtual
machine with 8 VCPUs) only the first 6 sockets were being displayed.
Reported-by: Mark Wagner <mwagner@redhat.com>
Tested-by: Mark Wagner <mwagner@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Using the python-inet_diag package, that is now required. For now only
the inet_diag supported protocols are shown: TCP and DCCP.
To support the other protocols new classes will be added to the
python-linux-procfs to process the /proc/net/{udp,unix,etc} files.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
ssh://master.kernel.org/pub/scm/linux/kernel/git/acme/tuna
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Duh, I missed this one for 0.8.4, but never again! :)
Reported-by: David Sommerseth <davids@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
ssh://master.kernel.org/pub/scm/linux/kernel/git/acme/tuna
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
If the machine has at least two processors we:
1. Find out the rtprio for watchdog/0 (usually 99)
2. Decrement it
3. Use tuna to set watchdog/* to $(rtprio - 1)
4. Then using chrt we check if tuna correctly set the new rtprio
for all watchdog threads (one per CPU)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Reported-by: Guy Streeter <streeter@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
So that python setuptool can install it.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Examples:
[root@emilia tuna]# tuna -q eth? -P
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
7193 FIFO 85 0xff 120512 0 IRQ-2293 eth0(tg3)
[root@emilia tuna]#
[root@emilia tuna]# tuna -q *hcd* -P
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
583 FIFO 85 0xff 38 0 IRQ-23 ehci_hcd:usb1,uhci_hcd:usb2,uhci_hcd:usb3,uhci_hcd:usb4,uhci_hcd:usb5
[root@emilia tuna]#
So now its possible to have command line specified in such a way that can be
used in different machines, where eth0 may be a different driver and/or have a
different irq number, etc.
It is also possible to specify all interrupts by using:
[root@emilia tuna]# tuna -q '*' -P
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
182 FIFO 85 0xff 2 0 IRQ-9 acpi
556 FIFO 85 0xff 4 0 IRQ-1 i8042
566 FIFO 85 0xff 2 0 IRQ-8 rtc0
583 FIFO 85 0xff 38 0 IRQ-23 ehci_hcd:usb1,uhci_hcd:usb2,uhci_hcd:usb3,uhci_hcd:usb4,uhci_hcd:usb5
657 FIFO 85 0xff 176747 0 IRQ-19 aacraid
686 FIFO 85 0xff 48 0 IRQ-14 libata
687 FIFO 85 0xff 2 0 IRQ-15 libata
1713 FIFO 82 0xff 2 0 IRQ-7 parport0
7193 FIFO 85 0xff 121977 0 IRQ-2293 eth0(tg3)
7870 FIFO 50 0xff 7562817 3844945 IRQ-4 serial
[root@emilia tuna]#
That will also work on machines without threaded interrupt handlers, so that
one can now to move all the interrupts to a cpu core or to a cpu socket, etc.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
182 FIFO 85 0xff 2 0 IRQ-9 acpi
657 FIFO 85 0xff 172858 0 IRQ-19 aacraid
[root@emilia tuna]# tuna -t IRQ-1* -P
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
556 FIFO 85 0xff 4 0 IRQ-1 i8042
657 FIFO 85 0xff 172867 0 IRQ-19 aacraid
686 FIFO 85 0xff 48 0 IRQ-14 libata
687 FIFO 85 0xff 2 0 IRQ-15 libata
[root@emilia tuna]# tuna -t ss?d -P
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
7554 OTHER 0 0xff 39 33 sshd
31147 OTHER 0 0xff 184 81 sshd
31151 OTHER 0 0xff 3914 99 sshd
31460 OTHER 0 0xff 5477 277 sshd
[root@emilia tuna]#
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Example:
[root@doppio tuna]# tuna -t f.*,c.*,sshd -P
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
176 OTHER 0 0,1 2 0 cqueue
1054 OTHER 0 0,1 2244 71 crond
1079 OTHER 0 0,1 11080375 8288735 firefox
1093 OTHER 0 0,1 37 38 cupsd
2317 OTHER 0 0,1 4566 463 console-kit-dae
5521 OTHER 0 0,1 12515 1809 clock-applet
32286 OTHER 0 0,1 29 11 sshd
[root@doppio tuna]#
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Without this when we ran:
[root@doppio tuna]# tuna -t fire -CP
And there were no 'fire' named threads, all threads would be printed,
now:
[root@doppio tuna]# tuna -t fire -CP
[root@doppio tuna]# tuna -t firefox -CP
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
1079 OTHER 0 0,1 10970427 8259378 firefox
1133 OTHER 0 0,1 847 38 firefox
1095 OTHER 0 0,1 10436470 2426532 firefox
23722 OTHER 0 0,1 16 9 firefox
19341 OTHER 0 0,1 66253 6496 firefox
1134 OTHER 0 0,1 6 0 firefox
1135 OTHER 0 0,1 21500 7624 firefox
[root@doppio tuna]#
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Not a float as returned by self.sched_pri.get_value().
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Long standing bug...
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
And move things it and procview uses to tuna/gui/util.py, that have
its functions imported in tuna/gui/__init__.py, so that they are
accessible as gui.UTILITY_FUNCTION from tuna/gui/{irq,proc}view.py.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Its available since python-schedutils 0.2.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Breaking down the complexity by compatimentalizing classes, others will
follow.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
We have more coverage if we do it in the callers, as we should have been
also handling thread_info["stat"] calls, for instance, that may be only
at this point parsing /proc/<PID>/stat.
Also its too C-ish to handle errors with return values, python has
exceptions dammit. :-)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
ssh://master.kernel.org/pub/scm/linux/kernel/git/acme/tuna
|
|
Reported-by: Maurizio Galli <maurizio.galli@inwind.it>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Now, with later versions of python-matplotlib, a .draw() call is enough,
go figure...
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
In procview the rows are used while checking if new threads appeared and if old
ones died, but somehow with some pygtk2 releases we could end up with
duplicates, i.e. a thread that already was in the list_store would be added
again because the traversal of the existing rows wouldn't find it even with it
being there.
Add a workaround to remove the previous entry if it has the same pid.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Leaving the parsing to the last possible moment.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
As we were already using for cpus/sockets, so that if '-' or
'+' is not used the operation will reset both the thread and the
irq list, establishing the now selected components as the new list
and reseting the other list, so:
[root@emilia tuna]# tuna -t sshd -S 1 -m -q eth0 -S 0 -m
[root@emilia tuna]#
Will:
1. select all the sshd processes, setting the thread list
2. select the second CPU socket (cores 1,3,5,7)
3. move the selected processes to the selected cpus
4. select the eth0 IRQ, resetting the thread list
5. select the first CPU socket (cores 0,2,4,6)
6. move the selected IRQs (and threads, this time none) to the selected cpus
To see the results we can use:
[root@emilia tuna]# tuna -t sshd -q +eth0 -P
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
7178 FIFO 85 0,2,4,6 32620 3 IRQ-2293 eth0(tg3)
7538 FIFO 90 1,3,5,7 9 5 sshd
7926 FIFO 90 1,3,5,7 6293 288 sshd
7988 FIFO 90 1,3,5,7 194 80 sshd
7992 FIFO 90 1,3,5,7 27565 13 sshd
[root@emilia tuna]#
That is: select all "sshd" threads and also the IRQ "eth0".
Previously the above operation would move _both_ the sshd processes
and the eth0 IRQ to the first CPU socket (-S 0), i.e. it would be
equivalent now to:
[root@emilia tuna]# tuna -t sshd -S 1 -m -q +eth0 -S 0 -m
[root@emilia tuna]#
So now all the managed entities: cpus (and sockets), threads and irqs
use the '+' (add to the current list), '-' (remove from the current list)
or no prefix to mean "reset the current list, setting it to this instead".
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
As it will be used with --irq and --thread.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
It will also be used in --irq/-q and --threads/-t
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
When using --affect_children (-C) the --show_threads (-P) output
was confusing when the parent has, say, 4 digits and some of its
children 5 digits.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Example:
Move firefox, whatever is its pid, to the second CPU in a two core
system, move its children threads too:
[root@doppio tuna]# tuna -t firefox -CP -c 0 -m -P
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
10838 OTHER 0 0,1 11548949 8040411 firefox
10848 OTHER 0 0,1 12551 2 firefox
10850 OTHER 0 0,1 2761 1452 firefox
10854 OTHER 0 0,1 1810857 452177 firefox
10855 OTHER 0 0,1 1 0 firefox
10857 OTHER 0 0,1 46469 38581 firefox
10839 OTHER 0 0,1 56727 1561 firefox
10840 OTHER 0 0,1 6885809 2704 firefox
10844 OTHER 0 0,1 1776 21 firefox
10845 OTHER 0 0,1 5 0 firefox
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
10838 OTHER 0 0 11548977 8040415 firefox
10848 OTHER 0 0 12551 2 firefox
10850 OTHER 0 0 2761 1452 firefox
10854 OTHER 0 0 1810866 452177 firefox
10855 OTHER 0 0 1 0 firefox
10857 OTHER 0 0 46469 38581 firefox
10839 OTHER 0 0 56727 1561 firefox
10840 OTHER 0 0 6885819 2704 firefox
10844 OTHER 0 0 1776 21 firefox
10845 OTHER 0 0 5 0 firefox
[root@doppio tuna]#
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
So that when we don't pass a irq_list, it doesn't explodes later on:
[root@doppio tuna]# tuna -t 1,2 -P
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
Traceback (most recent call last):
File "./tuna-cmd.py", line 342, in <module>
main()
File "./tuna-cmd.py", line 272, in main
kthreads, affect_children)
File "./tuna-cmd.py", line 198, in do_ps
has_ctxt_switch_info)
File "./tuna-cmd.py", line 162, in ps_show
if irq_list_numbers:
UnboundLocalError: local variable 'irq_list_numbers' referenced before
assignment
[root@doppio tuna]#
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
With --cpus or --sockets, example:
[root@emilia tuna] tuna -q eth0,14 -P -S 1 -m -P -S 0 -m -P -c -0 -m -P -c +1 -m -P
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
686 FIFO 85 1,2,4,6 50 0 IRQ-14 libata
7178 FIFO 85 1,2,4,6 46378 0 IRQ-2293 eth0(tg3)
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
686 FIFO 85 1,3,5,7 50 0 IRQ-14 libata
7178 FIFO 85 1,3,5,7 46382 0 IRQ-2293 eth0(tg3)
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
686 FIFO 85 0,2,4,6 50 0 IRQ-14 libata
7178 FIFO 85 0,2,4,6 46386 0 IRQ-2293 eth0(tg3)
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
686 FIFO 85 2,4,6 50 0 IRQ-14 libata
7178 FIFO 85 2,4,6 46390 0 IRQ-2293 eth0(tg3)
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
686 FIFO 85 1,2,4,6 50 0 IRQ-14 libata
7178 FIFO 85 1,2,4,6 46394 0 IRQ-2293 eth0(tg3)
[root@emilia tuna]#
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
With irq_list.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Examples:
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
182 FIFO 85 0xff 2 0 IRQ-9 acpi
7178 FIFO 85 0xff 21973 0 IRQ-2293 eth0(tg3)
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
556 FIFO 85 0xff 4 0 IRQ-1 i8042
566 FIFO 85 0xff 2 0 IRQ-8 rtc0
686 FIFO 85 0xff 50 0 IRQ-14 libata
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
686 FIFO 85 0xff 50 0 IRQ-14 libata
7178 FIFO 85 0xff 22587 0 IRQ-2293 eth0(tg3)
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
686 FIFO 85 0,2,4,6 50 0 IRQ-14 libata
7178 FIFO 85 0,2,4,6 22592 0 IRQ-2293 eth0(tg3)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
[root@emilia tuna]# tuna --threads 7926,7927,7928,7929 --sockets 1 --spread --show_threads
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
7926 OTHER 0 1 14 2 mingetty
7927 OTHER 0 3 23 3 mingetty
7928 OTHER 0 5 21 4 mingetty
7929 OTHER 0 7 24 5 mingetty
[root@emilia tuna]#
This is on a machine with two CPU sockets where the second socket (1) has 4
cores (1, 3, 5, 7).
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Sometimes the refresh stopped due to threads disappearing and the schedutils
routines (get_affinity, set_affinity, etc) trowing SystemError exceptions,
handle them.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Include & isolate CPU sockets and move a thread to a socket
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
for cases such as 'tuna -P | head'
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
All the filters apply, i.e. one can show the threads on the
first CPU socket that are no kernel threads, etc.
Example:
Select socket 0 (that has the CPUs 0, 2, 4 and 6) and isolate it, then move the
init process to it and finally show only the threads on socket 0.
[root@emilia tuna]# tuna --sockets 0 --isolate --threads 1 --move --show_threads
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
1 OTHER 0 0,2,4,6 1403 2439 init
[root@emilia tuna]#
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
|
|
To specify a CPU socket to be isolated, included or to move specific threads to
it.
To isolate a cpu socket:
tuna --sockets 0 --isolate
Use --include to include the cores in the socket into the affinity mask of all
threads (except kernel threads).
To set the affinity mask of threads:
tuna --sockets 1 --threads 1,4,200 --move
If the children threads are to be moved too use:
tuna --affect_children --sockets 1 --threads 1,4,200 --move
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
In preparation for CPU socket operations.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Taking a list of cpus, as isolate_cpus.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Using drag'n'drop from the irq and process views to the
CPU socket frame, that will set the affinity mask to the
CPUs in the socket.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
This fixes a long standing bug that was uncovered when an unsorted list of cpus
was passed to this routine: the set_affinity_warning was moved to tuna_gui when
the gui code moved from tuna.py, but move_threads_to_cpu called it when it
compared the new affinity, and as it was unsorted...
So now just print to the standard output if it fails setting the new affinity
or call the provided routine, that will be what tuna_gui will do.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Because the new_affinity provided may be not sorted.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
One CPU socket:
[ ]
Two CPU sockets:
[ ] [ ]
Four:
[ ] [ ]
[ ] [ ]
...
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
On a two way system trying to isolate the first and last core doesn't make
sense...
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
To weed off things like cpuidle:
IOError: [Errno 2] No such file or directory: '/sys/devices/system/cpu/cpuidle/topology/physical_package_id'
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Now we can see which cores are in which socket, next steps will
allow socket operations: isolate, include, drag'n'drop, etc.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
So that we can get topology information and do CPU hotplug operations.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Should exercise all the command line options, and while doing that it tests the
underlying system components, mainly the kernel.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
And also doesn't have PF_THREAD_BOUND in its per process flags...
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
When the user changes the sched policy to SCHED_OTHER the rtprio entry is
grayed, later, when thread_set_attributes is called it was trying to set
SCHED_OTHER with the previous, SCHED_RR/FIFO rtprio.
That, of course doesn't works, so fix it by setting the rtprio to 0 when
changing to SCHED_OTHER.
Thanks to Jon Masters for pointing out this annoying problem that required that
first the user set the rtprio to 0, then the policy to OTHER and then hit OK to
have it working.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
And ask the user if he/she wants to save it in /etc/rtgroups if the user didn't
selected it already.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
Works like the --save command line option.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|
|
It obeys --threads and --cpus filters, so its possible to:
[root@doppio tuna]# ps ax | grep sirq-net-
7 ? S< 0:00 [sirq-net-tx/0]
8 ? S< 0:17 [sirq-net-rx/0]
20 ? S< 0:00 [sirq-net-tx/1]
21 ? S< 0:21 [sirq-net-rx/1]
3372 pts/1 R+ 0:00 grep sirq-net-
[root@doppio tuna]# ./tuna-cmd.py --threads=7,8,20,21 --save /tmp/sirq
[root@doppio tuna]# cat /tmp/sirq
Generated by tuna
#
# Use it with rtctl:
#
# rtctl --file /tmp/sirq reset
#
# Please use 'man rtctl' for more operations
#
# Associate processes into named groups with default priority and
# scheduling policy.
#
# Format is: <groupname>:<sched>:<prio>:<regex>
#
# groupname must start at beginning of line.
# sched must be one of: 'f' (fifo)
# 'b' (batch)
# 'r' (round-robin)
# 'o' (other)
# '*' (leave alone)
# regex is an awk regex
#
# The regex is matched against process names as printed by "ps -eo cmd".
kthreads:*:1:\[.*\]$
sirq-net-rx:f:80:\[(sirq|softirq)-net-rx\/.*\]$
sirq-net-tx:f:80:\[(sirq|softirq)-net-tx\/.*\]$
[root@doppio tuna]#
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
|