[Previous] [Contents] [Next]

sac

Display system activity at each priority level (QNX)

Syntax:

sac [-i factor] [-n node] [-p priority] [-s seconds]
    [<file] [>file]

Options:

-i factor
Use this integration factor (0 to 12; disable = 0).
-n node
Gather statistics on node (default is the local node).
-p priority
Run at this priority (default is 10).
-s seconds
Use this interval between snapshots (default is 1.0).
<file
Run previously saved log file.
>file
Save data to a log file.

Description:

The sac utility is a system activity monitor. It displays a bar graph showing the amount of processor activity at each priority level. If you run sac on an idle system, you would see one large bar at priority 0 (priority 1 if clock is running).

The Kernel collects statistics on processor activity at each priority level. These statistics are integrated over time. The -i option sets the integration factor for the system. Smaller values average over shorter periods, resulting in a faster response to changes in system activity. Larger values let you monitor average activity over a longer period of time. If you set the integration factor to 0, then statistics won't be gathered. If you don't specify the -i option, then the current integration factor will be used. If a node is not gathering statistics, you will be told to set a value for the integration factor. In this case, re-run sac with a nonzero value for the -i option.


Note: Note that the -i option doesn't affect process scheduling. It affects only the statistics gathered for display.

By default, sac takes a snapshot of the system statistics once every second. You can adjust this using the -s option, which takes an argument in seconds and fractions of seconds. For example, -s 0.5 would snap every half second. To stop sac after the next snap, press Enter.

If you specify a file for the standard output, sac will write a log of system activity to the file. You may play the log back by invoking sac with its standard input redirected.

Examples:

Take a snapshot of an active system with an integration factor of 8:

    sac -i 8

Start a realtime monitor of the dynamics of the system:

    sac -i 3 -s .1

Monitor node 8 using its current integration factor:

    sac -n 8

Caveats:

On slow machines, sac may itself affect priority loading when it runs.

Note that playback data saved and re-displayed using standard output and standard input are not timestamped. If identical -s option settings are not used for both the recording and playback invocations of sac, the timing of the playback may vary greatly from the timing of the original data. Additional variation in playback versus recording can occur due to variations in the time taken to write the data versus the time taken to read the data back. For this reason, playback should be used only to show what sequence of events occurred and should not be relied on to indicate the exact timing of those events.

See also:

sin, ps


[Previous] [Contents] [Next]