All of lore.kernel.org
 help / color / mirror / Atom feed
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>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Carsten Emde <C.Emde@osadl.org>, Daniel Wagner <wagi@monom.org>,
	Jon Masters <jcm@redhat.com>,
	Clark Williams <williams@redhat.com>
Subject: [RFC][PATCH 3/4] tracing: Add documentation for hwlat_detector tracer
Date: Thu, 23 Apr 2015 15:08:28 -0400	[thread overview]
Message-ID: <20150423191725.158120617@goodmis.org> (raw)
In-Reply-To: 20150423190825.714359844@goodmis.org

[-- Attachment #1: 0003-tracing-Add-documentation-for-hwlat_detector-tracer.patch --]
[-- Type: text/plain, Size: 3627 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>
[ Updated to show move from module to tracer ]
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 Documentation/trace/hwlat_detector.txt | 61 ++++++++++++++++++++++++++++++++++
 1 file changed, 61 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..db98dd1fa4ed
--- /dev/null
+++ b/Documentation/trace/hwlat_detector.txt
@@ -0,0 +1,61 @@
+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 usually not serviced by the Linux kernel, which typically does not
+even know that they are occuring. 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 hardware latency detector works by hogging all 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.
+
+Note that the SMI 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_detector" into the current_tracer file of the
+tracing system (mounted at /sys/kernel/debug/tracing). It is possible to
+redefine the threshold in microseconds (us) above which latency spikes will
+be taken into account.
+
+Example:
+
+	# echo hwlat_detector > /sys/kernel/debug/tracing/current_tracer
+	# echo 100 > /sys/kernel/debug/tracing/tracing_thresh
+
+The /sys/kernel/debug/tracing/hwlat_detector interface contains the following files:
+
+count			- number of latency spikes observed since last reset
+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 we will set width to 500,000 and window to 1,000,000, meaning that
+we will sample every 1,000,000 usecs (1s) for 500,000 usecs (0.5s). If we
+observe any latencies that exceed the threshold (initially 100 usecs),
+then we write to a global sample ring buffer of 8K samples, which is
+consumed by reading from the "sample" (pipe) debugfs file interface.
+
+Also the following tracing directory files are used by the hwlat_detector:
+
+in /sys/kernel/debug/tracing:
+
+tracing_threshold	- minimum latency value to be considered (usecs)
+tracing_max_latency	- maximum hardware latency actually observed (usecs)
-- 
2.1.4



  parent reply	other threads:[~2015-04-23 19:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-23 19:08 [RFC][PATCH 0/4] tracing: Add new hwlat_detector tracer Steven Rostedt
2015-04-23 19:08 ` [RFC][PATCH 1/4] tracing: Initial hwlat_detector code from the -rt patch Steven Rostedt
2015-04-23 19:08 ` [RFC][PATCH 2/4] tracing: Add hwlat_detector tracer Steven Rostedt
2015-04-23 19:08 ` Steven Rostedt [this message]
2015-04-23 19:08 ` [RFC][PATCH 4/4] hwlat: Add per cpu mask for hwlat_detector Steven Rostedt
2015-04-23 19:51 ` [RFC][PATCH 0/4] tracing: Add new hwlat_detector tracer Thomas Gleixner
2015-04-23 20:09   ` Steven Rostedt
2015-04-23 20:21     ` Thomas Gleixner
2015-04-23 20:40       ` Steven Rostedt
2015-04-23 20:56         ` Steven Rostedt
2015-04-23 20:43       ` Daniel Bristot de Oliveira
2015-04-23 22:50       ` Linus Torvalds
2015-04-23 23:23         ` Steven Rostedt

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=20150423191725.158120617@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=C.Emde@osadl.org \
    --cc=akpm@linux-foundation.org \
    --cc=jcm@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.