Received: by 10.223.185.116 with SMTP id b49csp1019713wrg; Fri, 16 Feb 2018 10:56:38 -0800 (PST) X-Google-Smtp-Source: AH8x226W3i4KRwOe9hT6f8y4TvMJu6QezAgvYEG3p45oxXDxTtXYQ52LVZS/A0q8LhtR7P0Kyqji X-Received: by 2002:a17:902:12f:: with SMTP id 44-v6mr6727197plb.403.1518807398790; Fri, 16 Feb 2018 10:56:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518807398; cv=none; d=google.com; s=arc-20160816; b=pe7qFextOYUsuICgAf3PMt7eTsSu+bNMWybEGGU23l7N24BNi+a/210Nj21LYfjeJI nf9DBxA9QZ2NtZ9T7va53bASwb/GrZP+1tCzB/4myDuaFlBrX2BVWA8uL3LZZgmhRDeN /RUUqyWYESCc7CTYqLs9ndgDdXaweiZer9AncyxyeJb7SCVycQyHFjYOKpso8DqUj2/z wKL3j/CYS4WjQS1WwEAWjLlSCapSgEU83kBNcm2byZV04gcZ0EWH4R3EAU66T1WiT7Iv 6cyDAwpqtzfA+riesEJYHaRFLFcWIAXBkDvXpLHebpfwPoReCRgwcq3SjEPxMrFdC0+l ejng== 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=N4Y/td7JYyY6Vzy0q4e7/toLg42ls3tcP6rIquP4whU=; b=P5PqPcWGSqoGwlz9NOCzdzq0Za/m1yfOsZV7oKqPUDVskw9KWA1H3rHcv0w8E0+x43 7kaYiixejOMDxfEt0bol7lUv9VT6utG5d3Mx9siGrcNl7ZhMQ4TeFWmyR0M23+c7Ds7v Jqd08mFTNthDb+1DlYgezSCvKoFnk3TELMgfTBOPMHbfPVrm/omNT/vH9tjcChYk7/y5 QJ8F9Pj3A47ql6A9nmM0d5nAilV1KlIJN9F2qTnm2psGGE/6VqfGjkjQYh9G5YhxTc7+ kdTukIqAnkGXxnZ2TGYoyHaY9G/qHUTM0Q2hAJQMrkA3y3v/+euFTlw3ffFQpiNCyaea WFBQ== 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 p33-v6si2409208pld.310.2018.02.16.10.56.24; Fri, 16 Feb 2018 10:56:38 -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 S932883AbeBPJwc (ORCPT + 99 others); Fri, 16 Feb 2018 04:52:32 -0500 Received: from terminus.zytor.com ([198.137.202.136]:60517 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932850AbeBPJwa (ORCPT ); Fri, 16 Feb 2018 04:52:30 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w1G9g60J022943; Fri, 16 Feb 2018 01:42:06 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w1G9g6Vm022940; Fri, 16 Feb 2018 01:42:06 -0800 Date: Fri, 16 Feb 2018 01:42:06 -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: yao.jin@linux.intel.com, mingo@kernel.org, wangnan0@huawei.com, namhyung@kernel.org, jolsa@kernel.org, kan.liang@intel.com, acme@redhat.com, tglx@linutronix.de, hpa@zytor.com, ak@linux.intel.com, peterz@infradead.org, linux-kernel@vger.kernel.org Reply-To: kan.liang@intel.com, acme@redhat.com, tglx@linutronix.de, yao.jin@linux.intel.com, mingo@kernel.org, wangnan0@huawei.com, namhyung@kernel.org, jolsa@kernel.org, peterz@infradead.org, linux-kernel@vger.kernel.org, hpa@zytor.com, ak@linux.intel.com 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: 8cc42de736b617827a4e7664fb8d7a325bc125bc 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: 8cc42de736b617827a4e7664fb8d7a325bc125bc Gitweb: https://git.kernel.org/tip/8cc42de736b617827a4e7664fb8d7a325bc125bc Author: Kan Liang AuthorDate: Thu, 18 Jan 2018 13:26:32 -0800 Committer: Arnaldo Carvalho de Melo CommitDate: Thu, 15 Feb 2018 09:57:06 -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"); } /*