linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] tracing/hwlat: Report total time spent in all NMIs during the sample
@ 2019-10-10 18:50 Srivatsa S. Bhat
  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
  0 siblings, 2 replies; 7+ messages in thread
From: Srivatsa S. Bhat @ 2019-10-10 18:50 UTC (permalink / raw)
  To: linux-kernel, rostedt, mingo
  Cc: amakhalov, akaher, anishs, bordoloih, srivatsab, srivatsa

From: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu>

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")
Cc: stable@vger.kernel.org
Signed-off-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu>
---

 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();
 		else
-			nmi_total_ts = time_get() - nmi_ts_start;
+			nmi_total_ts += time_get() - nmi_ts_start;
 	}
 
 	if (enter)


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-10-14 19:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-10 18:50 [PATCH 1/3] tracing/hwlat: Report total time spent in all NMIs during the sample Srivatsa S. Bhat
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).