]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
tracing/hwlat: Don't ignore outer-loop duration when calculating max_latency
authorSrivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu>
Thu, 10 Oct 2019 18:51:01 +0000 (11:51 -0700)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 23 Oct 2019 13:04:35 +0000 (15:04 +0200)
BugLink: https://bugs.launchpad.net/bugs/1848750
commit fc64e4ad80d4b72efce116f87b3174f0b7196f8e upstream.

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: e7c15cd8a113 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Connor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
kernel/trace/trace_hwlat.c

index a0251a78807dbe4f5b4a7c7aeacb63398fe0bbcf..862f4b0139fcb33bf0902fcd635c9bd6f440522c 100644 (file)
@@ -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: