Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1347080ybp; Thu, 17 Oct 2019 11:23:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqxglIoWIA+RFodk9LAIgT925mko3nldBlVcONsHhRVKat9EmRRoIUsgU6kWaLkGaWXL8RDK X-Received: by 2002:aa7:de02:: with SMTP id h2mr5312608edv.212.1571336635708; Thu, 17 Oct 2019 11:23:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571336635; cv=none; d=google.com; s=arc-20160816; b=06ZZ3Lv4N0/B9waKUkbX9XJ4oBoDm7fLx1AtmwQNsoTAL6Jih2Yl10ZEhGlxLv2dwH 22J91bZP8AL7UAUh0s1oTWAwfNckgW5iP0bUlk8ACVoZtlm8OVn16N0GgYQ6VAnCYo02 SpsDc6mE3281PocOTTWDuz4/M7rgmHUs6EAPMHZmG/dhhkYJd4XV4PwLmKJ+zd1mSP2k MixhafO0KZkv5U8M0SEvLPkGjoXFEOBr1dKkYlECdt017JoOnhnC1XrDhIK6RBtX3XAg 6HLKVj9/trT8t37jRTCsyVrrimyNlSfpk7TcLD5/7ItWdQX6z76i/7OKPfzzG5YoZxEr +4Dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0RDoDHuJq5AmSIcA/FxHLHuDFPb+lCKreZj1BzrPces=; b=pBFcfOmhLk91nUIoymchpSH87vTmEET+kSaxF5wLVHZ27flBuAeSThfECVQSeCf28U Ipnb3kyKpGBjVp0gsx0gKc2V/EKymdADG74VAVJptldjKLd4cdEA3hCq+plgeCdTHVwY L/lShJaRjlHd6Is1I33Iuvve7lPHHLP3aMy6pj4UFcPWRkpgSt7hpy+cYtQaFT6Y9YDS TIFzIzt8tMJfPJwCfRpCWMCbs0AocczWBYFzvj+7D3EzofXGABlNV+qeYx0zty6Q9TDo zYlmAuZLEamdqBxcjHzK3JA9Cw1OHGolFkEXmTDcVuQV5qaq3wbDGfEKDksLTMd+0e7g 6p3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bsiflNbW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m1si1915795eji.86.2019.10.17.11.23.32; Thu, 17 Oct 2019 11:23:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bsiflNbW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438874AbfJPWAp (ORCPT + 99 others); Wed, 16 Oct 2019 18:00:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:54618 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2438568AbfJPV7h (ORCPT ); Wed, 16 Oct 2019 17:59:37 -0400 Received: from localhost (unknown [192.55.54.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BA80B21925; Wed, 16 Oct 2019 21:59:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571263176; bh=r4AUOYR8v+E1OaFX4qVSirdArg5U+qp6rBVI9XN0p6g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bsiflNbWkz95Kt8g2l1kwHkpKmW1V3kj/FbVYIrqjKDq4QR+E5xdNm2lPKjeGdM0S bc7Oin+jET/ab1ulglx8/xnFYQsZrYS49XhLE5lJKA09qRk1Vo+5nHLhyr+fldN9Qw qZIBVTLg/SNLPbPz9cG9FJf6CcqC6IyL3Q5wQAUg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Srivatsa S. Bhat (VMware)" , "Steven Rostedt (VMware)" Subject: [PATCH 5.3 104/112] tracing/hwlat: Dont ignore outer-loop duration when calculating max_latency Date: Wed, 16 Oct 2019 14:51:36 -0700 Message-Id: <20191016214906.951835525@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191016214844.038848564@linuxfoundation.org> References: <20191016214844.038848564@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Srivatsa S. Bhat (VMware) 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) Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Greg Kroah-Hartman --- kernel/trace/trace_hwlat.c | 2 ++ 1 file changed, 2 insertions(+) --- a/kernel/trace/trace_hwlat.c +++ b/kernel/trace/trace_hwlat.c @@ -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: