Received: by 10.223.176.46 with SMTP id f43csp34524wra; Thu, 18 Jan 2018 13:31:22 -0800 (PST) X-Google-Smtp-Source: ACJfBouLGfg3WiHEKw78lf/81GHRu3HCC33W2IuWBU5uIY4diD65DjypRfUnqxQu0zxiWskDn0az X-Received: by 10.98.63.214 with SMTP id z83mr31327734pfj.95.1516311082332; Thu, 18 Jan 2018 13:31:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516311082; cv=none; d=google.com; s=arc-20160816; b=Qk4ubgDvEW3q3JsKxPrskT/MPWOGXrqu7JZk6vQLSHlupTQ5A/AmRtfQVqM+cCtaYf eWLZXeH4yyAyh5mYGcZJrhCVeEXXvIPVB/p7Y9h3f5lTtXtXm/vA4iw3V/1Skv5YP57c gSdgji/Z1Wst9q5Bkx5bhofAkEoEOFPXadTjTBTKbeHlix451GePru/8jL1V/4DDGVQQ NJIXK4Pr0u84aHsx7ep7iEYX4YUpuz7WbZBLiUStpoSFGGg3z1+uplyhOr3FhYRmCIbn CLhkVvIvkAjqdrcxaaKEfzK0ZyvPy4e5xTAhnPFZct72K/kdShmF8XzdzXeDQ0APGl/R nBtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=xfv0LpSy1I2m45OfoddxqNmVJfcCjp3xjuZJvEBRrqo=; b=m6ew8lhO6odw95JHUbrQKLRg+7q625p9lmkdoM7DfxoxhPTJOyvi3IizxsEZEJ/Hkv FJgrAvIVFYd0CRXoN2hRJeX9O7kxNPLAXQOr/yfO1r1q+m/DMezWHOr8ir2UOhty7tga otxpc4282ZS5dIUwnEA4TfQVuR9fCsObX5fw+gIwDlyGjodjuzb1iuPWoq2gr9j9VoYe CAmfSmCplIZoh7Sq464VM/qNdLyuGh9KUSmmwGIcm9lKM/euGSORrYj/5iTjya8TD7gx YWlL3BH3RLDc0ZjfNVer6MNDYP7lw5BI0sm/GRqM4hRK8ZxyAHk98peAN+SGUpThrPut TIeg== 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 7si7760915pfo.357.2018.01.18.13.31.08; Thu, 18 Jan 2018 13:31:22 -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 S1755032AbeARV3j (ORCPT + 99 others); Thu, 18 Jan 2018 16:29:39 -0500 Received: from mga04.intel.com ([192.55.52.120]:47432 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932337AbeARV1m (ORCPT ); Thu, 18 Jan 2018 16:27:42 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jan 2018 13:27:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,378,1511856000"; d="scan'208";a="11477302" Received: from otc-knm-01.jf.intel.com ([10.54.39.34]) by fmsmga008.fm.intel.com with ESMTP; 18 Jan 2018 13:27:40 -0800 From: kan.liang@intel.com To: acme@kernel.org, peterz@infradead.org, mingo@redhat.com, linux-kernel@vger.kernel.org Cc: wangnan0@huawei.com, jolsa@kernel.org, namhyung@kernel.org, ak@linux.intel.com, yao.jin@linux.intel.com, Kan Liang Subject: [PATCH V5 17/17] perf top: check the latency of perf_top__mmap_read() Date: Thu, 18 Jan 2018 13:26:32 -0800 Message-Id: <1516310792-208685-18-git-send-email-kan.liang@intel.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1516310792-208685-1-git-send-email-kan.liang@intel.com> References: <1516310792-208685-1-git-send-email-kan.liang@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kan Liang 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 --- 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 465a699..79ed39f 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"); } /* -- 2.5.5