Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1345474ybp; Thu, 17 Oct 2019 11:22:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqyz16plgYeMAuqeFevyRDbzyZtvCMKbFonkOQAKMao+0Y2azt6PsVZHo2JL8gyAM/S4c2lE X-Received: by 2002:a05:6402:29a:: with SMTP id l26mr5271719edv.290.1571336544181; Thu, 17 Oct 2019 11:22:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571336544; cv=none; d=google.com; s=arc-20160816; b=xEiMXTspNLH9P/s1EDn9oPaIVM0AYIpDONAv3AokQ7vU5kpgEIkquAtlUPTxTQNs2X 6SllcPd/t7PUZ4v8Al8e/KTzJwlR2hB3CROaes1Vv8HMF/cgQF3HcF6jXXiNmBZzoo1n OxE4jxjDJTv0tUXASVnxhjV6Qt5hsPDO1ZDUmPj3L3QHeHSYq/sHdY9II0FtKJqgE5+O jKiTk7DgcagL86iLSZH7x0zV8ZeAXpN3yvUGY+1CCWJ11QPvdjFYInJp17lHS6jNgiN2 INUzVh+QN6VabakQhZpemBfXrlYm/oCXS7bsW3SlvsuDqX3+0yJIT3kdlF3SUxvtPrVP OVMQ== 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=X5BiH6jEkrG2xUGPQ+FLlRVXJFSbiSD2900I/CMeRLw=; b=TXNhlP+QuqMNa+SjNj54qlZ2U9DRNlxBj3xDhK1xJD+BpTfljrAzBfow9ZvGSYkNdC ChSQPV0T+LDVPKcG100f+pfUHp6TPqvNEM0kIN++ZA+dOfAYsxKq8T6rfjBwPBSzf33s BRs/kvAX/EhW/sgDxfVLT87rPC/eQvaQGevU+AI7ye5WJmHLzAuue9J6aHBxyYBjSPwm 8nXnI4gCeWt5/9f8fcoCEzNlei4WGrrxcV/ca14nMLwuH1bUfvzaTSkmar58b2fkFmqq KYdFtq9PGwp3CNyAgLoMapZfa3JrS9Mcou44Gs+3zRn2KR6cgj5YIxiMe16rEkKgnPZb fUjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=pDVNVPfv; 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 e47si2192259ede.325.2019.10.17.11.22.01; Thu, 17 Oct 2019 11:22:24 -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=pDVNVPfv; 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 S2438864AbfJPWAn (ORCPT + 99 others); Wed, 16 Oct 2019 18:00:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:54600 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2438564AbfJPV7g (ORCPT ); Wed, 16 Oct 2019 17:59:36 -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 DA44C21928; Wed, 16 Oct 2019 21:59:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571263176; bh=r4G5M8LqISPfavKPeJV3kNgvzavMX8YwB3Ihhw+YbsE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pDVNVPfvNJQ83J5NALlJaAKuTbzbpxh4YxRyfi+5R81pfC3K2crlXNeo7TqVVwTmK FXuXsUlBjQkU/ADh0zO+3wL53pfvMzvmW5Q9xb7ir9SvsDZuFL10avBSMVBtwt/OZ+ nWCKamLnF4frNZuTVDxLVpUolPLjlfxbtfBWRldw= 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 103/112] tracing/hwlat: Report total time spent in all NMIs during the sample Date: Wed, 16 Oct 2019 14:51:35 -0700 Message-Id: <20191016214906.806471830@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 98dc19c11470ee6048aba723d77079ad2cda8a52 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: 7b2c86250122 ("tracing: Add NMI tracing in hwlat detector") 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, 1 insertion(+), 1 deletion(-) --- a/kernel/trace/trace_hwlat.c +++ b/kernel/trace/trace_hwlat.c @@ -150,7 +150,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)