SC_USAGE(1)
π sc_usage(1), straight outta the General Commands Manual π
β¨ NAME β¨
sc_usage β show system call usage statistics. thatβs the whole assignment, bestie.
π SYNOPSIS π
sc_usage [-c codefile] [-e] [-l] [-s interval] pid | cmd | -E execute
π«Ά DESCRIPTION π«Ά
okay so sc_usage gives you an ongoing sample of system call and page fault usage statistics for a given process, in a βtop-likeβ fashion. itβs giving very main character monitoring energy.
π¨ bestie, this one requires root privileges because of the kernel tracing facility it uses to operate. no cap, donβt skip that part.
Page faults can be of the following types:
PAGE_INβ the page had to read from diskZERO_FILLβ the page was created and zero filledCOWβ the page was copied from another pageCACHE_HITβ the page was found in the cache
The arguments are as follows:
-cβ when the-coption is specified, it expects a path to acodefilethat contains the mappings for the system calls. this option overrides the default location of the system call codefile, which is found in/usr/share/misc/trace.codes.-eβ specifying the-eoption generates output that is sorted by call count. this overrides the default sort by time.-lβ the-loption causessc_usageto turn off its continuous window updating style of output and instead output as a continuous scrolling of data.-sβ by default,sc_usageupdates its output at one second intervals. this sampling interval may be changed by specifying the-soption. enter the interval in seconds.pid|cmd|-E executeβ the last argument must be a process id, a running command name, or using the-Eoption, an execution path followed by optional arguments. the system call usage data for the process or command is displayed. if the-Eflag is used,sc_usagewill launch the executable, 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 typeNUMBERβ the system call countCPU_TIMEβ the amount of cpu time consumedWAIT_TIMEβ the absolute time the process is waitingCURRENT_TYPEβ the current system call typeLAST_PATHNAME_WAITED_FORβ for each active thread, the last pathname that was referenced by a system call that blockedCUR_WAIT_TIMEβ the cumulative time that a thread has been blockedTHRD#β the thread numberPRIβ 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. sc_usage 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. slay.
π¦ SEE ALSO π¦
go bother fs_usage(1), latency(1), and top(1) next, iykyk.
xoxo, source/version: macOS π date: October 28, 2002 β¨ page: SC_USAGE(1) β¨
π¦ where this page comes from
- nixpkgs unstable: system_cmds 1042.100.6.0.1
- Copyright (c) 2000, Apple Computer, Inc. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms