Edition 1
1801 Varsity Drive
Raleigh, NC 27606-2072 USA
Phone: +1 919 754 3700
Phone: 888 733 4281
Fax: +1 919 754 3701
Mono-spaced Bold
To see the contents of the filemy_next_bestselling_novelin your current working directory, enter thecat my_next_bestselling_novelcommand at the shell prompt and press Enter to execute the command.
Press Enter to execute the command.Press Ctrl+Alt+F2 to switch to the first virtual terminal. Press Ctrl+Alt+F1 to return to your X-Windows session.
mono-spaced bold. For example:
File-related classes includefilesystemfor file systems,filefor files, anddirfor directories. Each class has its own associated set of permissions.
Choose → → from the main menu bar to launch Mouse Preferences. In the Buttons tab, click the Left-handed mouse check box and click to switch the primary mouse button from the left to the right (making the mouse suitable for use in the left hand).To insert a special character into a gedit file, choose → → from the main menu bar. Next, choose → from the Character Map menu bar, type the name of the character in the Search field and click . The character you sought will be highlighted in the Character Table. Double-click this highlighted character to place it in the Text to copy field and then click the button. Now switch back to your document and choose → from the gedit menu bar.
Mono-spaced Bold Italic or Proportional Bold Italic
To connect to a remote machine using ssh, typesshat a shell prompt. If the remote machine isusername@domain.nameexample.comand your username on that machine is john, typessh john@example.com.Themount -o remountcommand remounts the named file system. For example, to remount thefile-system/homefile system, the command ismount -o remount /home.To see the version of a currently installed package, use therpm -qcommand. It will return a result as follows:package.package-version-release
Publican is a DocBook publishing system.
mono-spaced roman and presented thus:
books Desktop documentation drafts mss photos stuff svn books_tests Desktop1 downloads images notes scripts svgs
mono-spaced roman but add syntax highlighting as follows:
package org.jboss.book.jca.ex1; import javax.naming.InitialContext; public class ExClient { public static void main(String args[]) throws Exception { InitialContext iniCtx = new InitialContext(); Object ref = iniCtx.lookup("EchoBean"); EchoHome home = (EchoHome) ref; Echo echo = home.create(); System.out.println("Created Echo"); System.out.println("Echo.echo('Hello') = " + echo.echo("Hello")); } }
python-linux-procfs
python-schedutils
python-ethtool
pygtk2
pygtk2-libglade
yum command. This will install all the necessary dependencies:
# yum install tuna
# tuna
sudo command:
$ sudo tuna





SCHED_OTHER is the default policy. SCHED_FIFO is a first in/first out realtime policy. A SCHED_FIFO policy with a priority of 1 will always run ahead of SCHED_OTHER. SCHED_RR is a policy where threads of equal priority are treated in a round-robin fashion.
SCHED_FIFO or SCHED_RR policies.
0, 2-4, 7, 8. This would instruct the IRQ to run on CPUs 0, 2, 3, 4, 7 and 8.
Ox in order to be recognized and interpreted correctly. Hex masks that do not use that format will be interpreted as a decimal CPU number.

* and ? wildcards, and will match the entire command line. The task list will update to show only those tasks that match the regex.
Foo and Bar. The applications need to be run on dedicated processors - processor 0 for Foo and processor 1 for Bar.
CPU 0 in the CPU list and select from the menu. Repeat for CPU 1. The task list shows that no tasks are running on those processors.
Foo is a single task with several threads. The task and all its threads need to run on CPU 0. Find Foo in the process list, right-click on it and choose from the menu. In the dialog, select the radio button for . In the text box, change the text to 0. The scheduling policy and scheduler priority can also be adjusted if required. Click on to save the changes and close the dialog box.
Bar is an application that has --none as its first command line argument. Right-click anywhere in the task list and choose from the menu. In the dialog, select the radio-button for . Type bar --none * in the text box. The task list in the dialog box will update to include the matching processes and any associated threads. Change the to 0. Make any changes for the scheduler and priority. Click on to save your changes and close the dialog box.

--help option to see all the available options:
# tuna --help
Usage: tuna [OPTIONS]
-h, --help Give this help list
-g, --gui Start the GUI
-c, --cpus=CPU-LIST CPU-LIST affected by commands
-C, --affect_children Operation will affect children threads
-f, --filter Display filter the selected entities
-i, --isolate Move all threads away from CPU-LIST
-I, --include Allow all threads to run on CPU-LIST
-K, --no_kthreads Operations will not affect kernel threads
-m, --move Move selected entities to CPU-LIST
-p, --priority=[POLICY]:RTPRIO Set thread scheduler tunables: POLICY and RTPRIO
-P, --show_threads Show thread list
-Q, --show_irqs Show IRQ list
-q, --irqs=IRQ-LIST IRQ-LIST affected by commands
-s, --save=FILENAME Save kthreads sched tunables to FILENAME
-S, --sockets=CPU-SOCKET-LIST CPU-SOCKET-LIST affected by commands
-t, --threads=THREAD-LIST THREAD-LIST affected by commands
-U, --no_uthreads Operations will not affect user threads
-v, --version Show version
-W, --what_is Provides help about selected entities
-x, --spread Spread selected entities over CPU-LIST
tuna --socket 0 --isolate \ --thread my_real_time_app --move \ --irq serial --socket 1 --move \ --irq eth* --socket 2 --spread \ --show_threads --show_irqsThe above command will distribute load across a four socket system. Commands such as this can be added to the initialization scripts of applications to serve as a configuration command.
| Tuna Options | |
|---|---|
--help
| Display the help list |
--gui
| Start the graphical user interface |
--cpus=
| The CPUs to be controlled by Tuna. The list will remain in effect until a new list is specified |
--affect_children
| Operation will affect children threads as well as the parent threads |
--filter
| Filter the display to only show the affected entities |
--isolate
| Move all threads away from the specified CPUs |
--include
| Allow all threads to run on the specified CPUs |
--no_kthreads
| Operation will not effect kernel threads |
--move
| Move selected entities to the specified CPUs |
--priority=
| Set the thread to have the specified scheduler policy and priority |
--show_threads
| Show the thread list |
--show_irqs
| Show the IRQ list |
--irqs
|
Specify the list of IRQs that are to be affected by commands. The list will remain in effect until a new list is specified. IRQs can be added to the list by using + and removed from the list by using -
|
--save
|
Save the kernel threads schedules to a file called FILENAME
|
--sockets=
| The CPU sockets to be controlled by Tuna. This option takes into account the CPU topology, such as the cores that share a single processor cache, and that are on the same physical chip. |
--threads=
|
The threads to be controlled by Tuna. The list will remain in effect until a new list is specified. Threads can be added to the list by using + and removed from the list by using -
|
--no_uthreads
| Operation will not affect user threads |
--version
| Show the current version of the Tuna package |
--what_is
| To see further help on selected entities |
--spread
| Spread the specified threads evenly between the selected CPUs |
--show_threads command to view the current policies and priorities:
# tuna --show_threads thread pid SCHED_ rtpri affinity cmd 1 OTHER 0 0,1 init 2 FIFO 99 0 migration/0 3 OTHER 0 0 ksoftirqd/0 4 FIFO 99 0 watchdog/0
--show_irqs command to view the current interrupts and their affinity:
# tuna --show_irqs # users affinity 0 timer 0 1 i8042 0 7 parport0 0
# tuna --cpus=CPU-LIST--COMMAND
# tuna --cpus=CPU-LIST --isolate
This command will cause all tasks currently running on that CPU to move to the next available CPU.
# tuna --cpus=CPU-LIST --include
This command will allow threads to run on the specified CPU.
# tuna --irqs=IRQ-LIST--COMMAND
# tuna --irqs=IRQ-LIST--cpus=CPU--move
--priority=[POLICY]:RTPRIO command, where POLICY is the new policy and RTPRIO is the new priority:
# tuna --threads 7861 --priority=RR:40
RR for round-robin, FIFO for first in/first out, or OTHER for the default policy.
--show_threads command to check the changes:
# tuna --threads 7861 --show_threads pid SCHED_ rtpri affinity voluntary nonvoluntary cmd 7861 RR 40 0xff 33318 16957 IRQ-4 serial
ssh threads need to run on CPUs 0 and 1. All http threads need to run on CPUs 2 and 3.
# tuna --cpus=0,1 --threads ssh* --move --cpus 2,3 --threads http* --move
ssh
ssh to the appropriate CPUs. The CPUs can be expressed numerically as 0 and 1; hex mask as 0x3; binary as 11
http
http to the appropriate CPUs. The CPUs can be expressed numerically as 2 and 3; hex mask as 0xC; binary as 1100
show_threads Command to View the Current Configurationsshow_threads command to display the current configuration, and test if the requested changes have worked as expected.
# tuna -t gnome-sc* -P -c0 -mP -c1 -mP -c+0 -mP
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
3861 OTHER 0 0,1 33997 58 gnome-screensav
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
3861 OTHER 0 0 33997 58 gnome-screensav
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
3861 OTHER 0 1 33997 58 gnome-screensav
thread ctxt_switches
pid SCHED_ rtpri affinity voluntary nonvoluntary cmd
3861 OTHER 0 0,1 33997 58 gnome-screensav
gnome-sc
gnome-sc threads to the selected CPU (CPU 0)
gnome-sc threads to the selected CPU (CPU 1)
gnome-sc threads to the selected CPUs (CPUs 0 and 1)
--save or -s parameter with a descriptive filename to save the current configuration:
# tuna --save=FILENAME
rt-tests package. Ensure you are registered with the Red Hat Network, and subscribed to the appropriate MRG Realtime channel. See Chapter 1, Installing Tuna. The package can then be installed using the following command:
# yum install rt-tests
oscilloscope package. It requires the following dependencies:
pygtk2
python-matplotlib
python-numeric
# yum install oscilloscope
--help option to see all the available options:
# cyclictest --help
cyclictest V 0.66
Usage:
cyclictest <options>
-a [NUM] --affinity run thread #N on processor #N, if possible
with NUM pin all threads to the processor NUM
-b USEC --breaktrace=USEC send break trace command when latency > USEC
-B --preemptirqs both preempt and irqsoff tracing (used with -b)
-c CLOCK --clock=CLOCK select clock
0 = CLOCK_MONOTONIC (default)
1 = CLOCK_REALTIME
-C --context context switch tracing (used with -b)
-d DIST --distance=DIST distance of thread intervals in us default=500
-D --duration=t specify a length for the test run
default is in seconds, but 'm', 'h', or 'd' maybe added
to modify value to minutes, hours or days
-E --event event tracing (used with -b)
-f --ftrace function trace (when -b is active)
-h --histogram=US dump a latency histogram to stdout after the run
(with same priority about many threads)
US is the max time to be be tracked in microseconds
-i INTV --interval=INTV base interval of thread in us default=1000
-I --irqsoff Irqsoff tracing (used with -b)
-l LOOPS --loops=LOOPS number of loops: default=0(endless)
-m --mlockall lock current and future memory allocations
-M --refresh_on_max delay updating the screen until a new max latency is hit
-n --nanosleep use clock_nanosleep
-N --nsecs print results in ns instead of us (default us)
-o RED --oscope=RED oscilloscope mode, reduce verbose output by RED
-O TOPT --traceopt=TOPT trace option
-p PRIO --prio=PRIO priority of highest prio thread
-P --preemptoff Preempt off tracing (used with -b)
-q --quiet print only a summary on exit
-r --relative use relative timer instead of absolute
-s --system use sys_nanosleep and sys_setitimer
-t --threads one thread per available processor
-t [NUM] --threads=NUM number of threads:
without NUM, threads = max_cpus
without -t default = 1
-T TRACE --tracer=TRACER set tracing function
configured tracers: unavailable (debugfs not mounted)
-u --unbuffered force unbuffered output for live processing
-v --verbose output values on stdout for statistics
format: n:c:v n=tasknum c=count v=value in us
-w --wakeup task wakeup tracing (used with -b)
-W --wakeuprt rt task wakeup tracing (used with -b)
-y POLI --policy=POLI policy of realtime thread (1:FIFO, 2:RR)
format: --policy=fifo(default) or --policy=rr
-S --smp Standard SMP testing (equals -a -t -n -m -d0)
same priority on all threads.
-U --numa Standard NUMA testing (similar to SMP option)
thread data structures allocated from local node
# cyclictest policy: other: loadavg: 0.07 0.19 0.29 3/260 27939 T: 0 (27939) P: 0 I:1000 C: 3279 Min: 1538 Act:1059544 Avg:881375 Max: 1059876
# cyclictest --smp -p75 -m policy: fifo: loadavg: 0.01 0.05 0.08 1/338 30074 T: 0 (30073) P:75 I:1000 C: 821 Min: 6 Act: 39 Avg: 22 Max: 44 T: 1 (30074) P:75 I:1500 C: 542 Min: 7 Act: 64 Avg: 48 Max: 73
# cyclictest --numa -p75 -m policy: fifo: loadavg: 0.00 0.00 0.00 1/173 25319 T: 0 (25318) P:75 I:1000 C: 2046 Min: 7 Act: 9 Avg: 8 Max: 12 T: 1 (25319) P:75 I:1500 C: 1363 Min: 8 Act: 10 Avg: 9 Max: 24
-v (verbose) parameter. Then use a | (pipe) to send the output to the oscilloscope:
# cyclictest -t1 -n -p99 -v | oscilloscope >/dev/null


| Revision History | |||
|---|---|---|---|
| Revision 1-1 | Thu Sep 22 2011 | ||
| |||
| Revision 1-0 | Thu Jun 23 2011 | ||
| |||
| Revision 0.1-1 | Wed Feb 23 2011 | ||
| |||
| Revision 0.1-0 | Wed Feb 23 2011 | ||
| |||