Skip to content

Commit fc64e4a

Browse files
srivatsabhatrostedt
authored andcommitted
tracing/hwlat: Don't ignore outer-loop duration when calculating max_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: [email protected] Signed-off-by: Srivatsa S. Bhat (VMware) <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent 98dc19c commit fc64e4a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

kernel/trace/trace_hwlat.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,8 @@ static int get_sample(void)
256256
/* Keep a running maximum ever recorded hardware latency */
257257
if (sample > tr->max_latency)
258258
tr->max_latency = sample;
259+
if (outer_sample > tr->max_latency)
260+
tr->max_latency = outer_sample;
259261
}
260262

261263
out:

0 commit comments

Comments
 (0)