From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Clark Williams <williams@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Jon Masters <jcm@redhat.com>, Daniel Wagner <wagi@monom.org>,
Carsten Emde <C.Emde@osadl.org>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Subject: [RFC][PATCH 2/3] tracing: Add documentation for hwlat_detector tracer
Date: Thu, 04 Aug 2016 10:57:10 -0400 [thread overview]
Message-ID: <20160804145840.044642364@goodmis.org> (raw)
In-Reply-To: 20160804145708.158968389@goodmis.org
[-- Attachment #1: 0002-tracing-Add-documentation-for-hwlat_detector-tracer.patch --]
[-- Type: text/plain, Size: 4251 bytes --]
From: Jon Masters <jcm@redhat.com>
Added the documentation on how to use th hwlat_detector.
Signed-off-by: Jon Masters <jcm@redhat.com>
[ Various updates and modified to show hwlat as a tracer ]
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
Documentation/trace/hwlat_detector.txt | 73 ++++++++++++++++++++++++++++++++++
1 file changed, 73 insertions(+)
create mode 100644 Documentation/trace/hwlat_detector.txt
diff --git a/Documentation/trace/hwlat_detector.txt b/Documentation/trace/hwlat_detector.txt
new file mode 100644
index 000000000000..c02e8ef800cf
--- /dev/null
+++ b/Documentation/trace/hwlat_detector.txt
@@ -0,0 +1,73 @@
+Introduction:
+-------------
+
+The tracer hwlat_detector is a special purpose tracer that 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 this patchset. It was
+originally written for use by the "RT" patch since the Real Time
+kernel is highly latency sensitive.
+
+SMIs are not serviced by the Linux kernel, which means that it does not
+even know that they are occuring. SMIs are instead 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 hardware latency detector works by hogging one of the cpus for configurable
+amounts of time (with interrupts disabled), 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 interrupts are disabled,
+the only thing that could do that would be an SMI or other hardware hiccup
+(or an NMI, but those can be tracked).
+
+Note that the hwlat detector should *NEVER* be used in a production environment.
+It is intended to be run manually to determine if the hardware platform has a
+problem with long system firmware service routines.
+
+Usage:
+------
+
+Write the ASCII text "hwlat" into the current_tracer file of the tracing system
+(mounted at /sys/kernel/tracing or /sys/kernel/tracing). It is possible to
+redefine the threshold in microseconds (us) above which latency spikes will
+be taken into account.
+
+Example:
+
+ # echo hwlat > /sys/kernel/tracing/current_tracer
+ # echo 100 > /sys/kernel/tracing/tracing_thresh
+
+The /sys/kernel/tracing/hwlat_detector interface contains the following files:
+
+width - time period to sample with CPUs held (usecs)
+ must be less than the total window size (enforced)
+window - total period of sampling, width being inside (usecs)
+
+By default the width is set to 500,000 and window to 1,000,000, meaning that
+for every 1,000,000 usecs (1s) the hwlat detector will spin for 500,000 usecs
+(0.5s). If tracing_thresh contains zero when hwlat tracer is enabled, it will
+change to a default of 10 usecs. If any latencies that exceed the threshold is
+observed then the data will be written to the tracing ring buffer.
+
+The minimum sleep time between periods is 1 millisecond. Even if width
+is less than 1 millisecond apart from window, to allow the system to not
+be totally starved.
+
+If tracing_thresh was zero when hwlat detector was started, it will be set
+back to zero if another tracer is loaded. Note, the last value in
+tracing_thresh that hwlat detector had will be saved and this value will
+be restored in tracing_thresh if it is still zero when hwlat detector is
+started again.
+
+The following tracing directory files are used by the hwlat_detector:
+
+in /sys/kernel/tracing:
+
+ tracing_threshold - minimum latency value to be considered (usecs)
+ tracing_max_latency - maximum hardware latency actually observed (usecs)
+ hwlat_detector/width - specified amount of time to spin within window (usecs)
+ hwlat_detector/window - amount of time between (width) runs (usecs)
--
2.8.1
next prev parent reply other threads:[~2016-08-04 15:06 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-04 14:57 [RFC][PATCH 0/3] tracing: Add Hardware Latency detector tracer Steven Rostedt
2016-08-04 14:57 ` [RFC][PATCH 1/3] tracing: Added hardware latency tracer Steven Rostedt
2016-08-05 14:25 ` Sebastian Andrzej Siewior
2016-08-05 14:44 ` Steven Rostedt
2016-08-05 15:28 ` Sebastian Andrzej Siewior
2016-08-05 15:36 ` Steven Rostedt
2016-08-04 14:57 ` Steven Rostedt [this message]
2016-08-10 14:12 ` [RFC][PATCH 2/3] tracing: Add documentation for hwlat_detector tracer Jon Masters
2016-08-04 14:57 ` [RFC][PATCH 3/3] tracing: Have hwlat trace migrate across tracing_cpumask CPUs Steven Rostedt
2016-08-04 15:30 ` [RFC][PATCH 0/3] tracing: Add Hardware Latency detector tracer Steven Rostedt
2016-08-09 18:15 ` Clark Williams
2016-08-09 18:30 ` Steven Rostedt
2016-08-04 16:56 ` [RFC][PATCH 4/3] tracing: Add NMI tracing in hwlat detector Steven Rostedt
2016-08-04 17:16 ` Steven Rostedt
2016-08-05 14:35 ` Sebastian Andrzej Siewior
2016-08-05 14:52 ` Steven Rostedt
2016-08-05 15:40 ` Sebastian Andrzej Siewior
2016-08-05 16:17 ` Steven Rostedt
2016-08-09 17:22 ` Steven Rostedt
2016-08-10 14:10 ` Jon Masters
2016-08-09 18:05 ` [RFC][PATCH 5/3] tracing: Add smi counting to HWLAT Steven Rostedt
2016-08-09 18:28 ` Daniel Bristot de Oliveira
2016-08-09 18:35 ` Steven Rostedt
2016-08-09 21:25 ` Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160804145840.044642364@goodmis.org \
--to=rostedt@goodmis.org \
--cc=C.Emde@osadl.org \
--cc=akpm@linux-foundation.org \
--cc=bigeasy@linutronix.de \
--cc=jcm@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
--cc=wagi@monom.org \
--cc=williams@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox