Skip to content

Commit 98dc19c

Browse files
srivatsabhatrostedt
authored andcommitted
tracing/hwlat: Report total time spent in all NMIs during the sample
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. Link: http://lkml.kernel.org/r/157073343544.17189.13911783866738671133.stgit@srivatsa-ubuntu Fixes: 7b2c862 ("tracing: Add NMI tracing in hwlat detector") Cc: [email protected] Signed-off-by: Srivatsa S. Bhat (VMware) <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent 7f8557b commit 98dc19c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/trace/trace_hwlat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ void trace_hwlat_callback(bool enter)
150150
if (enter)
151151
nmi_ts_start = time_get();
152152
else
153-
nmi_total_ts = time_get() - nmi_ts_start;
153+
nmi_total_ts += time_get() - nmi_ts_start;
154154
}
155155

156156
if (enter)

0 commit comments

Comments
 (0)