summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2015-11-27tuna: fix the check of PF_NO_SETAFFINITY flag for threadsHEADtuna.korg/mastermasterDaniel Bristot de Oliveira1-2/+11
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>
2015-06-24Correct a typo in the net.ipv4.ipfrag_time help stringGuy Streeter1-1/+1
What should be "\n" is just "\" Signed-off-by: Guy Streeter <streeter@redhat.com> Signed-off-by: Jiri Kastner <jkastner@redhat.com>
2015-06-24Fix behavior for dot inside /proc/sys/ pathPetr Oros1-10/+16
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>
2015-06-09CLI: Do not show column headers when not outputting to a tty:Arnaldo Carvalho de Melo1-2/+4
[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>
2015-06-09tuna: Fix race in is_hardirq_handlerArnaldo Carvalho de Melo1-3/+4
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>
2015-06-09tuna: Decide whether to isolate a thread based on PF_NO_SETAFFINITYArnaldo Carvalho de Melo1-4/+13
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>
2015-06-09tuna: Make --isolate/--include operations affect /proc/irq/default_smp_affinityArnaldo Carvalho de Melo1-2/+23
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>
2015-06-09tuna config: Fix pygtk importArnaldo Carvalho de Melo1-1/+1
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>
2015-06-09CLI: Introduce --nohz_full/-N entityArnaldo Carvalho de Melo2-2/+13
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>
2014-05-23rpm: Release 0.12Jiri Kastner3-3/+3
2014-03-26Add a tuna.desktop fileGuy Streeter2-0/+11
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>
2014-02-04CLI: fix traceback when -p is used with unsupported valuePetr Oros1-1/+4
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>
2014-02-04tuna: modified sysctl settings in example.confPetr Oros1-35/+40
Signed-off-by: Petr Oros <poros@redhat.com> Signed-off-by: Jiri Kastner <jkastner@redhat.com>
2014-01-30CLI: fix traceback due unavailable displayPetr Oros1-1/+1
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>
2014-01-30CLI: fix traceback where enter -p policy without prioPetr Oros1-2/+6
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>
2014-01-30CLI: fix ps_show_thread call with bad args countPetr Oros1-1/+1
Tested-By: Jiri Kastner <jkastner@redhat.com> Signed-off-by: Petr Oros <poros@redhat.com> Signed-off-by: Jiri Kastner <jkastner@redhat.com>
2013-12-02docs: Remove stray </a>John Kacur1-1/+1
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>
2013-07-24rpm: Release 0.11.1Petr Oros3-3/+3
Signed-off-by: Petr Oros <poros@redhat.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-07-24gui: Suggest file name in new,rename and copy dialogsPetr Oros1-3/+3
Signed-off-by: Petr Oros <poros@redhat.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-07-24tuna: Better snapshot naming (old_file_name+stamp.conf)Petr Oros1-1/+6
Signed-off-by: Petr Oros <poros@redhat.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-07-24gui: edittab - hide man. tab if profile contain errorsPetr Oros2-6/+28
Signed-off-by: Petr Oros <poros@redhat.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-07-24gui: mantab - update star immediately after changesPetr Oros1-1/+1
Signed-off-by: Petr Oros <poros@redhat.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-07-24gui: Filter temporary file from all outputsPetr Oros1-1/+1
Signed-off-by: Petr Oros <poros@redhat.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-07-24tuna: Auto Correction for config file errors BZ:974035Petr Oros3-8/+69
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>
2013-07-24tuna: Do polkit auth for GUI BZ:919212,974027Petr Oros3-14/+22
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>
2013-07-24tuna: Better exception handling for config filesPetr Oros1-27/+36
Signed-off-by: Petr Oros <poros@redhat.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-07-24gui: profileView warnings moved into one functionPetr Oros1-50/+16
Signed-off-by: Petr Oros <poros@redhat.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-05-22rpm: Release 0.11Petr Oros3-3/+3
Signed-off-by: Petr Oros <poros@redhat.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-05-22tuna: Added support for /proc/sys params and strings for itPetr Oros2-1/+370
Signed-off-by: Petr Oros <poros@redhat.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-05-22gui: Add profile related windowsPetr Oros6-221/+1619
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>
2013-05-22tuna: Support loading and saving tuned daemon profilesPetr Oros1-0/+83
Signed-off-by: Petr Oros <poros@redhat.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-05-22tuna-cmd: New command line params for tuning profilesPetr Oros2-12/+70
-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>
2013-05-22tuna: Added support for config files Added example config and default tuna ↵Petr Oros6-0/+348
config Signed-off-by: Petr Oros <poros@redhat.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-05-22procview: Added column for SystemD/CGroup monitoring over procfsPetr Oros1-20/+43
Signed-off-by: Petr Oros <poros@redhat.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-02-010.10.4Arnaldo Carvalho de Melo4-3/+15
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-02-01rpm: Install the man pageArnaldo Carvalho de Melo2-1/+4
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-02-01procview: Allow configuring a single threadArnaldo Carvalho de Melo3-15/+19
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>
2013-01-17tuna: Tighten "No such process" schedutils exception handlingArnaldo Carvalho de Melo3-43/+86
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>
2013-01-17tuna: Catch OSError exceptions from python-schedutilsGuy Streeter3-23/+23
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>
2012-12-04tuna: Add man page for command lineArnaldo Carvalho de Melo1-0/+78
Contributed by Guy Streeter. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-08-240.10.3Arnaldo Carvalho de Melo4-3/+13
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-08-24tuna: Don't touch the migration/* thread scheduler policy/prioArnaldo Carvalho de Melo1-2/+7
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>
2012-08-24testuna: Update some of the guinea pig kernel threadsArnaldo Carvalho de Melo1-4/+4
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>
2012-08-14sysfs: Fix crash on platforms that the kernel has little information on. ↵Chris Lockfort1-2/+8
(i.e. ARM) Signed-off-by: Chris Lockfort <clockfort@redhat.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-08-14procview: Remove 'cycles' column when using perf eventsArnaldo Carvalho de Melo1-11/+4
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>
2011-07-290.10.2Arnaldo Carvalho de Melo4-3/+19
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2011-07-28oscilloscope: Switch from "Bistream Vera Sans" to "Liberation Sans"Arnaldo Carvalho de Melo1-1/+1
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>
2011-07-28oscilloscope: Switch from Numeric to numpyArnaldo Carvalho de Melo2-3/+3
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>
2011-07-26MANIFEST: Add tuna/oscilloscope.pyArnaldo Carvalho de Melo1-0/+1
Without this the oscilloscope classes don't get packaged. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2011-06-06cmdline: Fix IRQ affinity settingRogan Kyuseok Lee1-1/+5
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>
2011-06-06procview gui: Load perf globallyArnaldo Carvalho de Melo1-1/+4
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>
2011-02-230.10.1Arnaldo Carvalho de Melo3-4/+7
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2011-02-23procview gui: Don't assume the perf binding is always availableArnaldo Carvalho de Melo1-1/+2
I.e. fix the perf availability detection. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2011-02-230.10Arnaldo Carvalho de Melo4-4/+15
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2011-02-01perf: Create the threads pidstat member when we notice the first threadArnaldo Carvalho de Melo1-1/+4
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2011-02-01gui: Fixup perf.evlist constructor callArnaldo Carvalho de Melo1-2/+2
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>
2011-01-29gui: Use perf if availableArnaldo Carvalho de Melo2-4/+75
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>
2010-06-09cmdline: Alert the user when GUI packages are not installedArnaldo Carvalho de Melo1-0/+2
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-05-17rpm: bump version to 0.9.4Arnaldo Carvalho de Melo3-4/+10
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>
2010-05-17testuna: Use events/* as watchdog/* isn't available in later kernelsArnaldo Carvalho de Melo1-2/+2
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-05-10rpm: 0.9.3Arnaldo Carvalho de Melo2-2/+23
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-05-10cmdline: Emit error when affinity operation can't be performedGuy Streeter1-4/+8
RHBZ-Reference: https://bugzilla.redhat.com/show_bug.cgi?id=590897 Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-05-10cmdline: Use tuna.cpustring_to_list in --cpusArnaldo Carvalho de Melo1-1/+1
[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>
2010-05-10tuna: Make is_hardirq_handler handle non thread group leadersArnaldo Carvalho de Melo1-0/+2
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>
2010-05-10cmdline: Handle unknown schedulers in -p/--priority:Arnaldo Carvalho de Melo1-1/+5
[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>
2010-05-10cmdline: Improve message about thread list being needed by -p/--priorityArnaldo Carvalho de Melo1-1/+1
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-05-10cmdline: Fix --priority error message when no threads are informedArnaldo Carvalho de Melo1-1/+1
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>
2010-05-10cmdline: Fix help line entry for --priorityArnaldo Carvalho de Melo1-1/+1
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>
2010-05-10tuna: Make cpustring_to_list understand 0x prefixed hexadecimal numbersArnaldo Carvalho de Melo1-3/+3
Needed to really fix https://bugzilla.redhat.com/show_bug.cgi?id=574950 Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2010-05-10gui: fix use of cpu rangesGuy Streeter1-2/+3
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>
2010-05-10irqview: Fix some race conditionsArnaldo Carvalho de Melo1-4/+14
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>
2009-12-07cmdline: On threaded irq kernels, map irqs to threadsArnaldo Carvalho de Melo1-2/+14
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>
2009-12-07cmdline: Fix threaded interrupt name bugArnaldo Carvalho de Melo1-1/+1
Introduced in: 50f1a4234d03a7766d406f3ec53bf1fff2f0a644 "tuna: Handle 2.6.31 style threaded irq names" Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-12-07cmdline: --priority/-p requires a thread listArnaldo Carvalho de Melo1-0/+3
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>
2009-11-12rpm: 0.9.2Arnaldo Carvalho de Melo6-39/+59
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-11-12cmdline: Take cpu_list into account in --show_irqs/-QArnaldo Carvalho de Melo1-14/+20
[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>
2009-11-06cmdline: Introduce --show_irqs/-QArnaldo Carvalho de Melo1-17/+75
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>
2009-10-14i18n: Add chinese translation to MANIFESTArnaldo Carvalho de Melo1-0/+1
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-10-14i18n: Updated japanese translationSatoru SATOH1-12/+11
Signed-off-by: Satoru SATOH <ssato@redhat.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-10-07i18n: Chinese translationJohn Lau2-0/+668
Thanks to John Lau and the guys at the Red Hat GSS China team! Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-10-07cpuview: Order socket frames numericallyArnaldo Carvalho de Melo1-2/+2
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>
2009-09-10tuna: Ignore non-existing threads in threads_set_priorityArnaldo Carvalho de Melo2-2/+10
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-09-03rpm: 0.9.1Arnaldo Carvalho de Melo4-4/+16
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-09-03Merge branch 'master' of ↵Arnaldo Carvalho de Melo1-0/+4
ssh://master.kernel.org/pub/scm/linux/kernel/git/acme/tuna
2009-09-03cmdline: --socket needs an argumentArnaldo Carvalho de Melo1-1/+1
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-09-03tuna: Present more graceful failure mode when machine can't start guiArnaldo Carvalho de Melo1-0/+4
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>
2009-08-31tuna: Handle 2.6.31 style threaded irq namesArnaldo Carvalho de Melo3-19/+34
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>
2009-08-26oscilloscope: Remove needless shebang and reword the package summaryArnaldo Carvalho de Melo2-3/+10
Suggested-by: Douglas Schilling Landgraf <dougsland@redhat.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-08-25oscilloscope: properly refresh all widgetsArnaldo Carvalho de Melo1-0/+2
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-08-25oscilloscope: Fix scaling bugs and add --sample_multiplierArnaldo Carvalho de Melo2-5/+20
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>
2009-08-17rpm: Follow fedora package reviewer adviceArnaldo Carvalho de Melo1-6/+10
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>
2009-08-02i18n: Restore the Brazilian Portuguese translations to the glade stringsArnaldo Carvalho de Melo1-47/+64
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-08-02i18n: Restore the Japanese translations to the glade stringsArnaldo Carvalho de Melo1-4/+64
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-08-02xgettext: remove -L python, so that the glade strings can be extracted tooArnaldo Carvalho de Melo1-1/+1
This regression was introduced in 691378600421fda478e3ac08946ce0d516f509ff. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-08-02glade: Call gtk.glade.[bind]textdomainArnaldo Carvalho de Melo1-0/+4
So that the glade translations can be properly rendered. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-08-02glade: Allow the set_{process,interrupt}_attributes windows to resizeArnaldo Carvalho de Melo1-1/+2
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>
2009-08-02tuna: help i18n/l10nSatoru SATOH9-323/+677
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>
2009-07-15Suppress the DeprecationWarning of sets moduleSatoru SATOH2-6/+5
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-07-15pt_BR: First brazilian portuguese translation revisionLuis Claudio R. Gonçalves1-18/+18
Signed-off-by: Luis Claudio R. Gonçalves <lgoncalv@redhat.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-07-14pt_BR: Translate one more messageArnaldo Carvalho de Melo1-1/+1
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-07-14oscilloscope: Add article about the oscilloscope and tunaArnaldo Carvalho de Melo4-1/+170
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>
2009-07-14tuna: Remove script shebangs and use more dicts on i18n stringsArnaldo Carvalho de Melo8-268/+430
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-07-11package structure: Changes done for compliance with Fedora packaging guidelinesArnaldo Carvalho de Melo11-100/+100
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-07-10i18n: Fix problem in string formatArnaldo Carvalho de Melo1-4/+4
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-07-10tuna: Remove the requires for python-inet_diagArnaldo Carvalho de Melo2-14/+21
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>
2009-07-10i18n: Add a brazilian portuguese initial translationArnaldo Carvalho de Melo2-0/+415
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-07-10i18n: Break some long strings into multiple messagesArnaldo Carvalho de Melo5-37/+51
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>
2009-07-10gettext: Remove po/tuna.potArnaldo Carvalho de Melo1-322/+0
Its better to always generate it from the sources. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-07-10tuna: Use gettext and add a japanese translationSatoru SATOH13-81/+792
Patch and translation contributed by Satoru SATOH <ssato@redhat.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-07-10git: ignore .pyc filesArnaldo Carvalho de Melo1-0/+1
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-06-30cpuview: Fix non multiple of columns caseArnaldo Carvalho de Melo1-1/+2
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>
2009-05-13cmdline: Add --show_sockets/-n to show thread's socketsArnaldo Carvalho de Melo3-14/+85
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>
2009-04-27Merge branch 'master' of ↵Arnaldo Carvalho de Melo3-2/+12
ssh://master.kernel.org/pub/scm/linux/kernel/git/acme/tuna
2009-04-27rpm: Mention CPU topology in the Description spec tag.Arnaldo Carvalho de Melo1-1/+2
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-03-23testuna: We should check if the version reported matches the rpm versionArnaldo Carvalho de Melo3-2/+12
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>
2009-02-13Merge branch 'master' of ↵Arnaldo Carvalho de Melo1-0/+13
ssh://master.kernel.org/pub/scm/linux/kernel/git/acme/tuna
2009-02-13rpm: v0.8.4Arnaldo Carvalho de Melo1-1/+16
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-02-03testuna: Add test case for --thread globbingArnaldo Carvalho de Melo1-0/+13
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>
2009-01-28tuna: Handle zombies in tuna.iskthreadArnaldo Carvalho de Melo1-2/+16
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-01-23Makefile: Add "clean" targetArnaldo Carvalho de Melo1-0/+11
Reported-by: Guy Streeter <streeter@redhat.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-01-15setup: Add "tuna/gui" to the package listArnaldo Carvalho de Melo1-1/+1
So that python setuptool can install it. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-01-09cmdline: Allow globbing --irqs/-qArnaldo Carvalho de Melo2-25/+39
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>
2009-01-09[root@emilia tuna]# tuna -t *9 -PArnaldo Carvalho de Melo1-2/+2
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>
2009-01-09cmdline: Support regex on --threadArnaldo Carvalho de Melo1-2/+5
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>
2009-01-09cmdline: Check if thread names resolved to TIDsArnaldo Carvalho de Melo1-0/+12
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>
2009-01-09all: Update copyright linesArnaldo Carvalho de Melo2-2/+2
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-01-08irqview: We have to pass an int to schedutils.setschedulerArnaldo Carvalho de Melo1-1/+1
Not a float as returned by self.sched_pri.get_value(). Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-01-08irqview: Initialize the rt_prio entry boxArnaldo Carvalho de Melo1-0/+1
Long standing bug... Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-01-08gui: move procview to a separate fileArnaldo Carvalho de Melo3-593/+601
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-01-08gui: Move irqview to a separate fileArnaldo Carvalho de Melo5-445/+466
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>
2009-01-08gui: remove the Set/set trick in tuna/tuna_gui.py, not used anymoreArnaldo Carvalho de Melo1-6/+0
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-01-08gui: Use schedutils.SCHED_{OTHER,FIFO,RR}Arnaldo Carvalho de Melo2-7/+4
Its available since python-schedutils 0.2. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-01-08gui: move cpuview classes to a separate fileArnaldo Carvalho de Melo5-360/+380
Breaking down the complexity by compatimentalizing classes, others will follow. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2009-01-08gui: Stop handling exceptions at procview.set_thread_columnsArnaldo Carvalho de Melo1-23/+26
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>
2008-12-28Merge branch 'master' of ↵Arnaldo Carvalho de Melo3-3/+3
ssh://master.kernel.org/pub/scm/linux/kernel/git/acme/tuna
2008-12-28oscilloscope: Ignore invalid samples, emitting just a warningArnaldo Carvalho de Melo1-18/+22
Reported-by: Maurizio Galli <maurizio.galli@inwind.it> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-12-17bump release to 0.8.3Arnaldo Carvalho de Melo3-3/+3
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-12-16oscilloscope_frame: Remove the hide/draw/show mysterious sequenceArnaldo Carvalho de Melo1-4/+0
Now, with later versions of python-matplotlib, a .draw() call is enough, go figure... Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-12-10gui: Set the model after adding the columns, its fasterArnaldo Carvalho de Melo1-5/+6
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-12-08gui: procview: update_rows should do a paranoia check on dup rowsArnaldo Carvalho de Melo1-0/+7
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>
2008-12-08gui: Stop reloading all /proc/pid/cmdline at every refreshArnaldo Carvalho de Melo2-4/+1
Leaving the parsing to the last possible moment. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-12-01rpm: v0.8.2Arnaldo Carvalho de Melo3-3/+3
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-11-28cmdline: Use '+'/'-' optional operations on threads and irqs tooArnaldo Carvalho de Melo1-4/+12
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>
2008-11-28cmdline: Rename do_cpu_list_op to do_list_opArnaldo Carvalho de Melo1-7/+7
As it will be used with --irq and --thread. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-11-28cmdline: Introduce pick_op, consolidating codeArnaldo Carvalho de Melo1-8/+7
It will also be used in --irq/-q and --threads/-t Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-11-28cmdline: Commands should affect both -q and -t if they are presentArnaldo Carvalho de Melo1-3/+7
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-11-28cmdline: align pids to the leftArnaldo Carvalho de Melo1-2/+2
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>
2008-11-28cmdline: Allow passing threads by name in addition to by pidArnaldo Carvalho de Melo1-1/+14
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>
2008-11-28cmdline: Always set irq_list_numbers to [] in ps_show_threadArnaldo Carvalho de Melo1-8/+9
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>
2008-11-27cmdline: Allow adding/subtracting/reseting the cpu listArnaldo Carvalho de Melo1-3/+24
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>
2008-11-27cmdline: Rename threads/cpus variables to {threads,cpus}_list for consistencyArnaldo Carvalho de Melo1-34/+34
With irq_list. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-11-27cmdline: Implement --irqs/-q to select IRQs by number or nameArnaldo Carvalho de Melo2-18/+97
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>
2008-10-30tuna-cmd: Add --version and --spread, that was missing in --helpArnaldo Carvalho de Melo1-3/+8
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-10-27rpm: 0.8 releaseArnaldo Carvalho de Melo1-1/+10
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-10-16tuna: Set the irq affinity mask when setting the IRQ thread affinityArnaldo Carvalho de Melo1-0/+14
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-10-16tuna: Add a "spread" parameter to move_threads_to_cpuArnaldo Carvalho de Melo2-3/+22
[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>
2008-10-15tuna: fixup getopt long option for --priority, it requires an argArnaldo Carvalho de Melo1-1/+1
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-10-15tuna: handle schedutils SystemError exceptionsArnaldo Carvalho de Melo3-24/+81
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>
2008-10-10tuna_gui: Don't automatically expand the cpuview when resizingArnaldo Carvalho de Melo1-1/+1
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-09-30testuna: Add per CPU socket testsArnaldo Carvalho de Melo1-0/+25
Include & isolate CPU sockets and move a thread to a socket Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-09-17tuna-cmd: Catch IOError in --show_threadsArnaldo Carvalho de Melo1-3/+7
for cases such as 'tuna -P | head' Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-09-16tuna_gui: [Non]VolCtxtSwitch must be gobject.TYPE_UINTArnaldo Carvalho de Melo1-2/+2
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-09-16all: spelling fixesArnaldo Carvalho de Melo2-5/+5
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-09-15rpm: 0.7 releaseArnaldo Carvalho de Melo2-1/+8
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-09-15tuna_gui: cpu_socket_frame: no need to have a title if there is just oneArnaldo Carvalho de Melo1-1/+4
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-09-15tuna_gui: Isolate/Include socket doesn't make sense when we have just one socketArnaldo Carvalho de Melo1-14/+18
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-09-15tuna-cmd: Implement --show_threads/-PArnaldo Carvalho de Melo1-3/+90
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>
2008-09-15Merge branch 'sockets'Arnaldo Carvalho de Melo5-123/+360
2008-09-15tuna-cmd: Introduce --sockets/-SArnaldo Carvalho de Melo1-3/+17
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>
2008-09-15tuna_gui: Add isolate/include CPU socket menu entryArnaldo Carvalho de Melo1-0/+20
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-09-15tuna_gui: cpuview: make {isolate,include}_cpu into _cpusArnaldo Carvalho de Melo1-6/+6
In preparation for CPU socket operations. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-09-15tuna: turn include_cpu into include_cpusArnaldo Carvalho de Melo3-10/+9
Taking a list of cpus, as isolate_cpus. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-09-14tuna_gui: Allow moving threads/irqs to a CPU socketArnaldo Carvalho de Melo1-0/+18
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>
2008-09-13tuna_gui: Pass GUI set_affinity_warning in drop_handler_move_threads_to_cpuArnaldo Carvalho de Melo1-1/+2
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-09-13tuna_gui: Allow dnd of threads/irqs to all CPUs in a socketArnaldo Carvalho de Melo1-16/+9
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-09-13tuna: Allow passing a custom warning routine to move_threads_to_cpuArnaldo Carvalho de Melo1-3/+7
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>
2008-09-13tuna: move_threads_to_cpu should use sets when comparing the affinitiesArnaldo Carvalho de Melo1-4/+4
Because the new_affinity provided may be not sorted. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-09-11tuna_gui: Automatically adjust the cpuview area to show all socketsArnaldo Carvalho de Melo1-2/+15
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-09-11tuna_gui: Arrange the sockets in a matrixArnaldo Carvalho de Melo1-2/+20
One CPU socket: [ ] Two CPU sockets: [ ] [ ] Four: [ ] [ ] [ ] [ ] ... Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-09-11tuna_gui: Show a horizontal scrollbar on the cpuview if neededArnaldo Carvalho de Melo1-1/+1
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-08-21testuna: Don't try to isolate all the processorsArnaldo Carvalho de Melo1-7/+9
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>
2008-08-19MANIFEST: Add tuna/tuna_gui.pyArnaldo Carvalho de Melo1-0/+1
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-08-19Makefile: use $(PACKAGE) when extracting the versionArnaldo Carvalho de Melo1-1/+1
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-08-15sysfs: sort socket list of cores at cpus.reload() timeArnaldo Carvalho de Melo1-0/+6
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-08-15sysfs: cpu entries are the ones with a number in the 4th charArnaldo Carvalho de Melo1-1/+1
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>
2008-08-15tuna_gui: Add support for CPU topologyArnaldo Carvalho de Melo2-91/+146
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>
2008-08-15sysfs: classes for /sys/devices/system/cpu/Arnaldo Carvalho de Melo1-0/+96
So that we can get topology information and do CPU hotplug operations. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-08-14testuna: Regression testsArnaldo Carvalho de Melo1-0/+180
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>
2008-08-12rpm: we need at least python-linux-procfs 0.4 due to per process flagsArnaldo Carvalho de Melo1-1/+1
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-08-12rpm: v0.6Arnaldo Carvalho de Melo1-1/+7
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-08-12Makefile: add rpmdev and bz2dev targetsArnaldo Carvalho de Melo1-0/+8
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-08-12MANIFEST: add missing fileArnaldo Carvalho de Melo1-0/+1
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-08-12tuna: posix_cpu_timer is percpu but its too long to have '/' in the cmdlineArnaldo Carvalho de Melo1-1/+4
And also doesn't have PF_THREAD_BOUND in its per process flags... Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-08-12tuna: Fixup the message about what filename was really used (rtgroups)Arnaldo Carvalho de Melo1-3/+3
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-08-12tuna: Save the affinity mask for non-percpu kthreadsArnaldo Carvalho de Melo3-10/+22
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-08-09tuna: Ignore rtprio when changing sched policy to SCHED_OTHERArnaldo Carvalho de Melo1-0/+2
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>
2008-08-07rpm: 0.5 releaseArnaldo Carvalho de Melo1-1/+7
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-08-07tuna_gui: Provide instructions on how to use the generated rtctl fileArnaldo Carvalho de Melo1-0/+25
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>
2008-08-07tuna_gui: Add "Save kthreads tunings" menu entry in the process list boxArnaldo Carvalho de Melo1-0/+43
Works like the --save command line option. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2008-08-07tuna: Implement saving current kthread sched policy and rtprio as an rtctl fileArnaldo Carvalho de Melo2-2/+99
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>