From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.9 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B04A4C43387 for ; Fri, 14 Dec 2018 20:47:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F2DDE206DD for ; Fri, 14 Dec 2018 20:47:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731087AbeLNUra (ORCPT ); Fri, 14 Dec 2018 15:47:30 -0500 Received: from terminus.zytor.com ([198.137.202.136]:48981 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730713AbeLNUr3 (ORCPT ); Fri, 14 Dec 2018 15:47:29 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id wBEKlA4T1457511 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 14 Dec 2018 12:47:10 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id wBEKlARl1457508; Fri, 14 Dec 2018 12:47:10 -0800 Date: Fri, 14 Dec 2018 12:47:10 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Jiri Olsa Message-ID: Cc: jolsa@kernel.org, namhyung@kernel.org, mingo@kernel.org, peterz@infradead.org, davem@davemloft.net, tglx@linutronix.de, alexander.shishkin@linux.intel.com, linux-kernel@vger.kernel.org, hpa@zytor.com Reply-To: peterz@infradead.org, mingo@kernel.org, namhyung@kernel.org, jolsa@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, alexander.shishkin@linux.intel.com, tglx@linutronix.de, davem@davemloft.net To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf top: Move lost events warning to helpline Git-Commit-ID: f0a93bdc13e413958f7440b69fa4054ccbca5f97 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: f0a93bdc13e413958f7440b69fa4054ccbca5f97 Gitweb: https://git.kernel.org/tip/f0a93bdc13e413958f7440b69fa4054ccbca5f97 Author: Jiri Olsa AuthorDate: Mon, 5 Nov 2018 21:34:47 +0100 Committer: Arnaldo Carvalho de Melo CommitDate: Thu, 6 Dec 2018 14:12:33 -0300 perf top: Move lost events warning to helpline We can't display the UI box saying that we are slow in the reader thread. That will make 'perf top' even slower and the user even more angry ;-) Move the UI box message from the reader thread to the UI thread and change it to a helpline, so there's no need to 'press any key'. Acked-by: David S. Miller Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Peter Zijlstra Link: https://lkml.kernel.org/n/tip-x4k0iuw7tt6mywsaguq6jfwu@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/builtin-top.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index c02ea537d5a7..9fe835ba0697 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -553,8 +553,6 @@ static void perf_top__sort_new_samples(void *arg) struct perf_evsel *evsel = t->sym_evsel; struct hists *hists; - perf_top__reset_sample_counters(t); - if (t->evlist->selected != NULL) t->sym_evsel = t->evlist->selected; @@ -571,6 +569,11 @@ static void perf_top__sort_new_samples(void *arg) hists__collapse_resort(hists, NULL); perf_evsel__output_resort(evsel, NULL); + + if (t->lost) + pr_warning("Too slow to read ring buffer (change period (-c/-F) or limit CPUs (-C)\n"); + + perf_top__reset_sample_counters(t); } static void *display_thread_tui(void *arg) @@ -908,10 +911,8 @@ 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); @@ -922,13 +923,6 @@ 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"); } /* From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC813C43387 for ; Tue, 18 Dec 2018 14:14:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9821A217D7 for ; Tue, 18 Dec 2018 14:14:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727043AbeLROO1 (ORCPT ); Tue, 18 Dec 2018 09:14:27 -0500 Received: from terminus.zytor.com ([198.137.202.136]:57197 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726426AbeLROO0 (ORCPT ); Tue, 18 Dec 2018 09:14:26 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id wBIEE6lI2854560 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 18 Dec 2018 06:14:06 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id wBIEE5Kg2854557; Tue, 18 Dec 2018 06:14:05 -0800 Date: Tue, 18 Dec 2018 06:14:05 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Jiri Olsa Message-ID: Cc: peterz@infradead.org, acme@redhat.com, namhyung@kernel.org, jolsa@kernel.org, hpa@zytor.com, alexander.shishkin@linux.intel.com, mingo@kernel.org, davem@davemloft.net, linux-kernel@vger.kernel.org, tglx@linutronix.de Reply-To: namhyung@kernel.org, acme@redhat.com, peterz@infradead.org, hpa@zytor.com, jolsa@kernel.org, mingo@kernel.org, alexander.shishkin@linux.intel.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, davem@davemloft.net To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf top: Move lost events warning to helpline Git-Commit-ID: 254de74cd14a2e64323caeffe653de0f390a4e65 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Message-ID: <20181218141405.t4WbzBEc5qssQr-CWy7BHsdJ1hrEoRDWB6D9nuk6Rqc@z> Commit-ID: 254de74cd14a2e64323caeffe653de0f390a4e65 Gitweb: https://git.kernel.org/tip/254de74cd14a2e64323caeffe653de0f390a4e65 Author: Jiri Olsa AuthorDate: Mon, 5 Nov 2018 21:34:47 +0100 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 17 Dec 2018 14:57:45 -0300 perf top: Move lost events warning to helpline We can't display the UI box saying that we are slow in the reader thread. That will make 'perf top' even slower and the user even more angry ;-) Move the UI box message from the reader thread to the UI thread and change it to a helpline, so there's no need to 'press any key'. Signed-off-by: Jiri Olsa Acked-by: David S. Miller Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Peter Zijlstra Link: https://lkml.kernel.org/n/tip-x4k0iuw7tt6mywsaguq6jfwu@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-top.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index c02ea537d5a7..9fe835ba0697 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -553,8 +553,6 @@ static void perf_top__sort_new_samples(void *arg) struct perf_evsel *evsel = t->sym_evsel; struct hists *hists; - perf_top__reset_sample_counters(t); - if (t->evlist->selected != NULL) t->sym_evsel = t->evlist->selected; @@ -571,6 +569,11 @@ static void perf_top__sort_new_samples(void *arg) hists__collapse_resort(hists, NULL); perf_evsel__output_resort(evsel, NULL); + + if (t->lost) + pr_warning("Too slow to read ring buffer (change period (-c/-F) or limit CPUs (-C)\n"); + + perf_top__reset_sample_counters(t); } static void *display_thread_tui(void *arg) @@ -908,10 +911,8 @@ 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); @@ -922,13 +923,6 @@ 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"); } /*