LKML Archive on
 help / color / Atom feed
From: "Srivatsa S. Bhat" <>
Subject: [PATCH 1/3] tracing/hwlat: Report total time spent in all NMIs during the sample
Date: Thu, 10 Oct 2019 11:50:46 -0700
Message-ID: <157073343544.17189.13911783866738671133.stgit@srivatsa-ubuntu> (raw)

From: Srivatsa S. Bhat (VMware) <>

nmi_total_ts is supposed to record the total time spent in *all* NMIs
that occur on the given CPU during the (active portion of the)
sampling window. However, the code seems to be overwriting this
variable for each NMI, thereby only recording the time spent in the
most recent NMI. Fix it by accumulating the duration instead.

Fixes: 7b2c86250122 ("tracing: Add NMI tracing in hwlat detector")
Signed-off-by: Srivatsa S. Bhat (VMware) <>

 kernel/trace/trace_hwlat.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/trace_hwlat.c b/kernel/trace/trace_hwlat.c
index fa95139..a0251a7 100644
--- a/kernel/trace/trace_hwlat.c
+++ b/kernel/trace/trace_hwlat.c
@@ -150,7 +150,7 @@ void trace_hwlat_callback(bool enter)
 		if (enter)
 			nmi_ts_start = time_get();
-			nmi_total_ts = time_get() - nmi_ts_start;
+			nmi_total_ts += time_get() - nmi_ts_start;
 	if (enter)

             reply index

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-10 18:50 Srivatsa S. Bhat [this message]
2019-10-10 18:51 ` [PATCH 2/3] tracing/hwlat: Don't ignore outer-loop duration when calculating max_latency Srivatsa S. Bhat
2019-10-10 18:51 ` [PATCH 3/3] tracing/hwlat: Fix a few trivial nits Srivatsa S. Bhat
2019-10-10 21:34   ` Joe Perches
2019-10-10 21:44     ` Steven Rostedt
2019-10-14 19:24   ` Steven Rostedt
2019-10-14 19:26     ` Srivatsa S. Bhat

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=157073343544.17189.13911783866738671133.stgit@srivatsa-ubuntu \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LKML Archive on

Archives are clonable:
	git clone --mirror lkml/git/0.git
	git clone --mirror lkml/git/1.git
	git clone --mirror lkml/git/2.git
	git clone --mirror lkml/git/3.git
	git clone --mirror lkml/git/4.git
	git clone --mirror lkml/git/5.git
	git clone --mirror lkml/git/6.git
	git clone --mirror lkml/git/7.git
	git clone --mirror lkml/git/8.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ \
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone