HWLATDETECT(8) | System Manager's Manual | HWLATDETECT(8) |
hwlatdetect - program to control the ftrace kernel hardware latency detection
hwlatdetect [ --duration=<time> ] [--threshold=<usecs> ] [--window=<time interval> ] [--width=<time interval> ] [--hardlimit=<microsecond value> ] [--report=<path> ] [--debug ] [--quiet ] [--watch]
hwlatdetect is a program that controls the ftrace kernel hardware latency detector (hwlatdetector).hwlatdetector is used to detect large system latencies induced by the behavior of certain underlying hardware or firmware, independent of Linux itself. The code was developed originally to detect SMIs (System Management Interrupts) on x86 systems, however there is nothing x86 specific about it. It was originally written for use by the "RT" patch set since the Real Time kernel is highly latency sensitive.
SMIs are usually not serviced by the Linux kernel, which typically does not even know that they are occurring. SMIs are instead are set up by BIOS code and are serviced by BIOS code, usually for "critical" events such as management of thermal sensors and fans. Sometimes though, SMIs are used for other tasks and those tasks can spend an inordinate amount of time in the handler (sometimes measured in milliseconds). Obviously this is a problem if you are trying to keep event service latencies down in the microsecond range.
The ftrace hardware latency detector works by hogging all of the cpus for configurable amounts of time (by calling stop_machine()), polling the CPU Time Stamp Counter for some period, then looking for gaps in the TSC data. Any gap indicates a time when the polling was interrupted and since the machine is stopped and interrupts turned off the only thing that could do that would be an SMI.
The hwlatdetector script manages the mounting/unmounting of the debugfs as well as interacting with the ftrace hwlatdetector If the debugfs is already mounted then hwlatdetector will not unmount it after a run.
hwlatdetect was written by Clark Williams
<williams@redhat.com>
hwlat_detector.ko was written by Jon Masters <jcm@redhat.com>
May 12, 2009 |