| 1 |
.\" Hey, EMACS: -*- nroff -*- |
| 2 |
.TH HWLATDETECT 8 "May 12, 2009" |
| 3 |
# SPDX-License-Identifier: GPL-2.0-only |
| 4 |
.\" Please adjust this date whenever revising the manpage. |
| 5 |
.\" |
| 6 |
.\" Some roff macros, for reference: |
| 7 |
.\" .nh disable hyphenation |
| 8 |
.\" .hy enable hyphenation |
| 9 |
.\" .ad l left justify |
| 10 |
.\" .ad b justify to both left and right margins |
| 11 |
.\" .nf disable filling |
| 12 |
.\" .fi enable filling |
| 13 |
.\" .br insert line break |
| 14 |
.\" .sp <n> insert n+1 empty lines |
| 15 |
.\" for manpage-specific macros, see man(7) |
| 16 |
.SH NAME |
| 17 |
hwlatdetect \- program to control the ftrace kernel hardware latency detection |
| 18 |
.SH SYNOPSIS |
| 19 |
.B hwlatdetect |
| 20 |
.RI "[ \-\-duration=<time> ] [\-\-threshold=<usecs> ] \ |
| 21 |
[\-\-window=<time interval> ] [\-\-width=<time interval> ] \ |
| 22 |
[\-\-hardlimit=<microsecond value> ] [\-\-report=<path> ] \ |
| 23 |
[\-\-debug ] [\-\-quiet ] [--watch] |
| 24 |
|
| 25 |
.\" .SH DESCRIPTION |
| 26 |
.\" This manual page documents briefly the |
| 27 |
.\" .B hwlatdetect commands. |
| 28 |
.\" .PP |
| 29 |
.\" \fI<whatever>\fP escape sequences to invoke bold face and italics, respectively. |
| 30 |
.\" \fBhwlatdetect\fP is a program that... |
| 31 |
.SH DESCRIPTION |
| 32 |
\fBhwlatdetect\fP is a program that controls the ftrace kernel hardware |
| 33 |
latency detector (hwlatdetector).hwlatdetector is used to detect large |
| 34 |
system latencies induced by the behavior of certain underlying hardware |
| 35 |
or firmware, independent of Linux itself. |
| 36 |
The code was developed originally to detect SMIs (System Management Interrupts) |
| 37 |
on x86 systems, however there is nothing x86 specific about it. |
| 38 |
It was originally written for use by the "RT" patch set |
| 39 |
since the Real Time kernel is highly latency sensitive. |
| 40 |
|
| 41 |
SMIs are usually not serviced by the Linux kernel, which typically does not |
| 42 |
even know that they are occurring. SMIs are instead are set up by BIOS code |
| 43 |
and are serviced by BIOS code, usually for "critical" events such as |
| 44 |
management of thermal sensors and fans. Sometimes though, SMIs are used for |
| 45 |
other tasks and those tasks can spend an inordinate amount of time in the |
| 46 |
handler (sometimes measured in milliseconds). Obviously this is a problem if |
| 47 |
you are trying to keep event service latencies down in the microsecond range. |
| 48 |
|
| 49 |
The ftrace hardware latency detector works by hogging all of the cpus |
| 50 |
for configurable amounts of time (by calling stop_machine()), polling |
| 51 |
the CPU Time Stamp Counter for some period, then looking for gaps in |
| 52 |
the TSC data. Any gap indicates a time when the polling was |
| 53 |
interrupted and since the machine is stopped and interrupts turned off |
| 54 |
the only thing that could do that would be an SMI. |
| 55 |
|
| 56 |
The hwlatdetector script manages the mounting/unmounting of the |
| 57 |
debugfs as well as interacting with the ftrace hwlatdetector |
| 58 |
If the debugfs is already mounted then hwlatdetector will not |
| 59 |
unmount it after a run. |
| 60 |
|
| 61 |
.SH OPTIONS |
| 62 |
.TP |
| 63 |
.B \-\-duration=<time>{s,m,d} |
| 64 |
Run the detector logic in for the specified duration. The duration is |
| 65 |
a base 10 integer number that defaults to a value in seconds. An |
| 66 |
optional suffix may be specified to indicate minutes, hours or days. |
| 67 |
|
| 68 |
.TP |
| 69 |
.B \-\-threshold=<microsecond value> |
| 70 |
Specify the TSC gap used to detect an SMI. Any gap value greater than |
| 71 |
<threshold> is considered to be the result of an SMI occurring. |
| 72 |
|
| 73 |
.TP |
| 74 |
.B \-\-hardlimit=<microsecond value> |
| 75 |
The test is considered to fail if a value above the hardlimit occurs. |
| 76 |
This affects the exit value of hwlatdetect |
| 77 |
|
| 78 |
.TP |
| 79 |
.B \-\-window=<time value>{us,ms,s,m,d} |
| 80 |
specify the size of the sample window. Converted to microseconds when |
| 81 |
passed to the kernel. |
| 82 |
|
| 83 |
.TP |
| 84 |
.B \-\-width=<time value>{us,ms,s,m,d} |
| 85 |
The amount of time within the sample window where the detector is |
| 86 |
actually sampling. Must be less than the \-\-window value. |
| 87 |
.TP |
| 88 |
.B \-\-report=FILENAME |
| 89 |
Specify the output filename of the detector report. Default |
| 90 |
behavior is to print to standard output |
| 91 |
.TP |
| 92 |
.B \-\-cpu-list=CPU-LIST |
| 93 |
Specify the CPUs for hwlat thread to move across. |
| 94 |
.TP |
| 95 |
.B \-\-debug |
| 96 |
Turn on debug prints |
| 97 |
.TP |
| 98 |
.B \-\-quiet |
| 99 |
Turn off all information prints |
| 100 |
.TP |
| 101 |
.B \-\-watch |
| 102 |
print sample data to stdout as it arrives |
| 103 |
|
| 104 |
.\" .SH SEE ALSO |
| 105 |
.\" .BR bar (1), |
| 106 |
.\" .BR baz (1). |
| 107 |
.\" .br |
| 108 |
.\" The programs are documented fully by |
| 109 |
.\" .IR "The Rise and Fall of a Fooish Bar" , |
| 110 |
.\" available via the Info system. |
| 111 |
.SH AUTHOR |
| 112 |
.B hwlatdetect |
| 113 |
was written by Clark Williams <[email protected]> |
| 114 |
.br |
| 115 |
.B hwlat_detector.ko |
| 116 |
was written by Jon Masters <[email protected]> |