Performance Tools - hewigovens/hewigovens.github.com GitHub Wiki

many from Mac OS X for Unix Geeks Chapter11

  • dtruss

    • process syscall details. Uses DTrace.
    • dtruss [-acdeflhoLs] [-t syscall] { -p PID | -n name | command }
  • sysdiagnose

    • gathers system-wide diagnostic information helpful in investigating system perfor- mance issues
    • run: fs_usage/spindump/top/zprint/kextstat/netstat/lsof/pmset diagnostics/allmemory/ioreg/df/system profiler/
  • spindump

    • Profile entire system during a time interval
  • netstat

    • show network status
    • e.g. netstat -an | grep CLOSE_WAIT
  • opensnoop

    • snoop file opens as they occur. Uses DTrace.
    • e.g. sudo opensnoop -p pid
  • iotop

    • display top disk I/O events by process. Uses DTrace.
    • e.g. sudo iotop -C 5 10
  • Activity Monitor

    • A GUI application, located in /Applications/Utilities, that displays infor- mation on memory and CPU usage for running processes. This application is similar to the command-line utility top, which is also included with Tiger and later.
  • atos

    • Converts to and from symbol names and the numeric addresses of symbols in running programs.
  • c2ph

    • Displays information on C structures in object files.
  • dtrace

    • An open source command-line monitoring utility, developed by Sun Microsystems. 
  • fs_usage

    • Displays information on filesystem activity.
    • e.g. sudo fs_usage -f filesys
  • gprof

    • Profiles execution of programs by reporting information such as execution times and the number of calls for individual functions.
  • heap

    • Analyzes memory usage.
  • Instruments

    • A timeline-based performance visualization application to monitor CPU usage, disk I/O, memory usage, garbage collection, and events (Mac OS X 10.5 only). Instruments is built on top of the open source DTrace utility.
  • leaks

    • Lists the addresses and sizes of unreferenced malloc buffers.
  • malloc_history

    • Lists the malloc allocation history of a given process.
  • nm

    • Displays a symbol table for object files.
  • otool

    • A command-line utility used to display information associated with object files or libraries. Earlier, we used it with the -L option, which displays the names and version numbers of the shared libraries used by the given object file. For more details, see the otool manpage.
  • pagestuff

    • Displays information about the logical pages of a Mach-O executable file.
  • Pixie

    • A magnifying-glass tool for checking graphics. * pstruct
    • Same as c2ph.
  • sample

    • A command-line tool used to profile a process over a time interval.
  • Sampler

    • Performs a statistical analysis of where an application spends its time by providing information such as how often allocation routines, system calls, or other functions are called. (Replaced by Instruments template Sampler.tracetemplate in Mac OS X 10.5.)
  • sc_usage

    • Displays information on system calls and page faults.
  • Shark

    • Provides instruction-level profiling of the execution time of a program, using statistical sampling. Advice on optimization is also provided. (A command-line version, /usr/bin/shark, is also provided.)
  • Spin Control

    • Monitors programs that become unresponsive and cause the spinning cursor.
  • top

    • display and update sorted information about processes
  • vmmap

    • Displays a virtual memory map in a process, including the attributes of memory regions such as starting addresses, sizes, and permissions.
  • lsof

    • The lsof utility shows information about open files, including regular files, directories, block special files, character special files, executing text references, libraries, streams, and network files.
  • latency

    • latency measures the number of context switches and interrupts and reports on the resulting delays, updating the display once per second.
  • vm_stat

    • The vm_stat utility displays virtual memory statistics. Unlike implementations on other Unix systems, on Mac OS X vm_stat does not default to continuous display; instead, it displays accumulated statistics.
  • sysctl

    • sysctl is a standard BSD facility for configuring kernel state variables. Use sysctlname to display a variable name, as in sysctl kern.ostype. Use sysctl -a to display all variables.
  • nvram

    • The nvram utility modifies firmware variables, which control the boot-time behavior of your Macintosh.