Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

sc_usage(1) [osx man page]

SC_USAGE(1)						    BSD General Commands Manual 					       SC_USAGE(1)

sc_usage -- show system call usage statistics SYNOPSIS
sc_usage [-c codefile] [-e] [-l] [-s interval] pid | cmd | -E execute DESCRIPTION
sc_usage displays an ongoing sample of system call and page fault usage statistics for a given process in a ``top-like'' fashion. It requires root privileges due to the kernel tracing facility it uses to operate. Page faults can be of the following types: PAGE_IN page had to read from disk ZERO_FILL page was created and zero filled COW page was copied from another page CACHE_HIT page was found in the cache The arguments are as follows: -c When the -c option is specified, it expects a path to a codefile that contains the mappings for the system calls. This option over- rides the default location of the system call codefile which is found in /usr/share/misc/ -e Specifying the -e option generates output that is sorted by call count. This overrides the default sort by time. -l The -l option causes sc_usage to turn off its continuous window updating style of output and instead output as a continuous scrolling of data. -s By default, sc_usage updates its output at one second intervals. This sampling interval may be changed by specifying the -s option. Enter the interval in seconds. pid | cmd | -E execute The last argument must be a process id, a running command name, or using the -E option, an execution path followed by optional argu- ments. The system call usage data for the process or command is displayed. If the -E flag is used, sc_usage will launch the exe- cutable, pass along any optional arguments and display system call usage date for that executable. The data columns displayed are as follows: TYPE the system call type NUMBER the system call count CPU_TIME the amount of cpu time consumed WAIT_TIME the absolute time the process is waiting CURRENT_TYPE the current system call type LAST_PATHNAME_WAITED_FOR for each active thread, the last pathname that was referenced by a system call that blocked CUR_WAIT_TIME the cumulative time that a thread has been blocked THRD# the thread number PRI current scheduling priority The sc_usage command also displays some global state in the first few lines of output, including the number of preemptions, context switches, threads, faults and system calls, found during the sampling period. The current time and the elapsed time that the command has been running is also displayed here. The sc_usage command is also SIGWINCH savvy, so adjusting your window geometry may change the list of system calls being displayed. Typing a 'q' will cause sc_usage to exit immediately. Typing any other character will cause sc_usage to reset its counters and the display. SAMPLE USAGE
sc_usage Finder -e -s2 sc_usage will sort the Finder process usage data according to system call count and update the output at 2 second intervals. SEE ALSO
fs_usage(1), latency(1), top(1) Mac OS X October 28, 2002 Mac OS X

Check Out this Related Man Page

FS_USAGE(1)						    BSD General Commands Manual 					       FS_USAGE(1)

fs_usage -- report system calls and page faults related to filesystem activity in real-time SYNOPSIS
fs_usage [-e] [-w] [-f mode] [-b] [-t seconds] [-R rawfile [-S start_time] [-E end_time]] [pid | cmd [pid | cmd] ...] DESCRIPTION
The fs_usage utility presents an ongoing display of system call usage information pertaining to filesystem activity. It requires root privi- leges due to the kernel tracing facility it uses to operate. By default, the activity monitored includes all system processes except the running fs_usage process, Terminal, telnetd, sshd, rlogind, tcsh, csh and sh. These defaults can be overridden such that output is limited to include or exclude a list of processes specified by the user. The output presented by fs_usage is formatted according to the size of your window. A narrow window will display fewer columns of data. Use a wide window for maximum data display. You may override the window formatting restrictions by forcing a wide display with the -w option. In this case, the data displayed will wrap when the window is not wide enough. The options are as follows: -e Specifying the -e option generates output that excludes sampling of the running fs_usage tool. If a list of process IDs or commands is also given, then those processes are also excluded from the sampled output. -w Specifying the -w option forces a wider, more detailed output, regardless of the window size. -f Specifying the -f option turns on output filtering based on the mode provided. Multiple filtering options can be specified. By default, no output filtering occurs. The supported modes are: network Network-related events are displayed. filesys Filesystem-related events are displayed. pathname Pathname-related events are displayed. exec Exec and spawn events are displayed. diskio Disk I/O events are displayed. cachehit In addition, show cache hits. -b Specifying the -b option annotates disk I/O events with BootCache info (if available). -t seconds Specifies a run timeout in seconds. fs_usage will run for no longer than the timeout specified. -R raw_file Specifies a raw trace file to process. -S start_time If -R is selected, specifies the start time in microseconds to begin processing entries from the raw trace file. Entries with time- stamps before the specified start time will be skipped. -E end_time If -R is selected, specifies the ending time in microseconds to stop processing entries from the raw trace file. Entries with time- stamps beyond the specified ending time will be skipped. pid | cmd The sampled data can be limited to a list of process IDs or commands. When a command name is given, all processes with that name will be sampled. Using the -e option has the opposite effect, excluding sampled data relating to the given list of process IDs or commands. If you set the DYLD_IMAGE_SUFFIX environment variable to ``_debug'', then an application will use the debug version of all libraries, includ- ing the Carbon FileManager. See dyld(1). When fs_usage is run against a Carbon Application launched in this environment, then the high- level Carbon FileManager calls will be displayed bracketing the system calls that they are built on. The data columns displayed are as follows: TIMESTAMP TOD when call occurred. Wide mode will have microsecond granularity. CALL The name of the network or filesystem related call, page-in, page-out, or physical disk access. FILE DESCRIPTOR Of the form F=x, x is a file descriptor. Depending on the type of system call, this will be either an input value or a return value. BYTE COUNT Of the form B=x, x is the number of bytes requested by the call. [ERRNO] On error, the errno is displayed in brackets. PATHNAME Pathname of the file accessed (up to the last 28 bytes). FAULT ADDRESS Of the form A=0xnnnnnnnn, where 0xnnnnnnnn is the address being faulted. DISK BLOCK NUMBER Of the form D=0xnnnnnnnn, where 0xnnnnnnnn is the block number of the physical disk block being read or written. OFFSET Of the form O=0xnnnnnnnn, where 0xnnnnnnnn is a file offset. SELECT RETURN Of the form S=x, x is the number of ready descriptors returned by the select() system call. If S=0, the time limit expired. TIME INTERVAL(W) The elapsed time spent in the system call. A 'W' after the elapsed time indicates the process was scheduled out during this file activity. In this case, the elapsed time includes the wait time. PROCESS NAME The process that made the system call. Wide mode will append the thread id to the process name (i.e Mail.nnn). SAMPLE USAGE
fs_usage -w -f filesys Mail fs_usage will display file system related data for all instances of processes named Mail. Maximum data output will be displayed in the win- dow. SEE ALSO
dyld(1), latency(1), sc_usage(1), top(1) Mac OS X November 7, 2002 Mac OS X
Man Page

Featured Tech Videos