Skip to content

Commit

Permalink
tracing/hwlat: Don't ignore outer-loop duration when calculating max_…
Browse files Browse the repository at this point in the history
…latency

max_latency is intended to record the maximum ever observed hardware
latency, which may occur in either part of the loop (inner/outer). So
we need to also consider the outer-loop sample when updating
max_latency.

Link: http://lkml.kernel.org/r/157073345463.17189.18124025522664682811.stgit@srivatsa-ubuntu

Fixes: e7c15cd ("tracing: Added hardware latency tracer")
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>
  • Loading branch information
Srivatsa S. Bhat (VMware) authored and Steven Rostedt (VMware) committed Oct 13, 2019
1 parent 98dc19c commit fc64e4a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kernel/trace/trace_hwlat.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@ static int get_sample(void)
/* Keep a running maximum ever recorded hardware latency */
if (sample > tr->max_latency)
tr->max_latency = sample;
if (outer_sample > tr->max_latency)
tr->max_latency = outer_sample;
}

out:
Expand Down

0 comments on commit fc64e4a

Please sign in to comment.