Received: by 10.223.185.116 with SMTP id b49csp3564652wrg; Tue, 13 Feb 2018 04:23:08 -0800 (PST) X-Google-Smtp-Source: AH8x224m0or4Edene4eS2509a1iwr6i9c5iW2pDn01NyphRNQjGSAPD2TNj/cWXitcU7eCby2BTA X-Received: by 10.101.80.69 with SMTP id k5mr872340pgo.447.1518524588689; Tue, 13 Feb 2018 04:23:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518524588; cv=none; d=google.com; s=arc-20160816; b=wRJvDSTsQ3vHsiQMzXgyxm1FXWIptZiPRZC4+Zj8i2tp+HlQNhWRsIOJTV+729A3J2 V1lSyhoBTdzoi26t0cMoyZMEwkhsmClQZMR0zGs/O7JtFDNZ2JcP+uiTDNB83bQeIvpb hvyPXKAUqb7ycJ3HhHV2Ue5T5SzhlruwIhkXQ8BDnAdQwx/tqN0ESmJiLrF8NBugGrzW XEMzt1kFNRDYuREd5SaOqHGQ2gvWoJYIABbIOBIrbrCzsNa/rHpkbR+RyboIjyzAzXqi pLYk1LQwP/IM84vqFMkBPWY9VBClDEp8UC2uZVjE2Rp8OCtu/9Zh8JVzkTh9zuWENRmd m+UQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=lIvevN2rFUt6/Xs2rarcw/rOU2PcoYdG/8RxeS+7IJo=; b=DLvZDPWUXOEUYnxDz/++6aPz/jA3BqQEGqe9jrF8SX5O5dkqDs5qmbvaMHL6spq5su +nvYjeEtUKYyH+xaVkFJz9aD84jwcdftQ41BVS+W9Ka3F83mWENbx0GBF3nSif4ywh1V Z/3V8zGcYtTyQs4CgrLlaEIdNo+QivtDoDcAkYeEBLYxMMr1eOTqm1Eow4lo7cdth1ES ZjVNebHmUoh5UH9A8du03SGDOfxTRg46G+3VveeFZFzfr7YJXnbDwy8g4zH+J4FpwMrm 2OIxS6cAqQW+0HI5WFL2VhGw9b8kLR4nLVAuPSTRovfQxQNkTJho2sYGAiI0AjM7/6oy GKew== ARC-Authentication-Results: i=1; mx.google.com; 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 t12si985802pgo.110.2018.02.13.04.22.54; Tue, 13 Feb 2018 04:23:08 -0800 (PST) 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; 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 S935070AbeBMMVt (ORCPT + 99 others); Tue, 13 Feb 2018 07:21:49 -0500 Received: from terminus.zytor.com ([198.137.202.136]:50539 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934827AbeBMMVr (ORCPT ); Tue, 13 Feb 2018 07:21:47 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w1DCBMrS029594; Tue, 13 Feb 2018 04:11:22 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w1DCBLqk029586; Tue, 13 Feb 2018 04:11:21 -0800 Date: Tue, 13 Feb 2018 04:11:21 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Kan Liang Message-ID: Cc: tglx@linutronix.de, yao.jin@linux.intel.com, jolsa@kernel.org, hpa@zytor.com, peterz@infradead.org, kan.liang@intel.com, namhyung@kernel.org, linux-kernel@vger.kernel.org, ak@linux.intel.com, acme@redhat.com, mingo@kernel.org, wangnan0@huawei.com Reply-To: acme@redhat.com, mingo@kernel.org, wangnan0@huawei.com, kan.liang@intel.com, hpa@zytor.com, peterz@infradead.org, jolsa@kernel.org, yao.jin@linux.intel.com, tglx@linutronix.de, ak@linux.intel.com, linux-kernel@vger.kernel.org, namhyung@kernel.org In-Reply-To: <1516310792-208685-18-git-send-email-kan.liang@intel.com> References: <1516310792-208685-18-git-send-email-kan.liang@intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] perf top: Check the latency of perf_top__mmap_read() Git-Commit-ID: 1db6c3a2144eaf0d8aaeecf46df73106834bad75 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 1db6c3a2144eaf0d8aaeecf46df73106834bad75 Gitweb: https://git.kernel.org/tip/1db6c3a2144eaf0d8aaeecf46df73106834bad75 Author: Kan Liang AuthorDate: Thu, 18 Jan 2018 13:26:32 -0800 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 6 Feb 2018 10:11:51 -0300 perf top: Check the latency of perf_top__mmap_read() The latency of perf_top__mmap_read() should be lower than refresh time. If not, give some hints to reduce the latency. Signed-off-by: Kan Liang Acked-by: Jiri Olsa Cc: Andi Kleen Cc: Jin Yao Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Wang Nan Link: http://lkml.kernel.org/r/1516310792-208685-18-git-send-email-kan.liang@intel.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-top.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 2b4914f..b7c823b 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -889,8 +889,10 @@ static void perf_top__mmap_read(struct perf_top *top) { bool overwrite = top->record_opts.overwrite; struct perf_evlist *evlist = top->evlist; + unsigned long long start, end; int i; + start = rdclock(); if (overwrite) perf_evlist__toggle_bkw_mmap(evlist, BKW_MMAP_DATA_PENDING); @@ -901,6 +903,13 @@ static void perf_top__mmap_read(struct perf_top *top) perf_evlist__toggle_bkw_mmap(evlist, BKW_MMAP_EMPTY); perf_evlist__toggle_bkw_mmap(evlist, BKW_MMAP_RUNNING); } + end = rdclock(); + + if ((end - start) > (unsigned long long)top->delay_secs * NSEC_PER_SEC) + ui__warning("Too slow to read ring buffer.\n" + "Please try increasing the period (-c) or\n" + "decreasing the freq (-F) or\n" + "limiting the number of CPUs (-C)\n"); } /*