Skip to content

Commit

Permalink
tracing/hwlat: Report total time spent in all NMIs during the sample
Browse files Browse the repository at this point in the history
commit 98dc19c upstream.

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: stable@vger.kernel.org
Signed-off-by: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Srivatsa S. Bhat (VMware) authored and Greg Kroah-Hartman committed Oct 17, 2019
1 parent 30ec415 commit 2d058b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/trace/trace_hwlat.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,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)
Expand Down

0 comments on commit 2d058b1

Please sign in to comment.