提交 df0d87ea 编写于 作者: J Jiri Olsa 提交者: Xie XiuQi

perf top: Move lost events warning to helpline

mainline inclusion
from mainline-5.0-rc1
commit 254de74cd14a2e64323caeffe653de0f390a4e65
category: bugfix
bugzilla: NA
CVE: NA

-------------------------------------------------
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: NJiri Olsa <jolsa@kernel.org>
Acked-by: NDavid S. Miller <davem@davemloft.net>
Acked-by: NNamhyung Kim <namhyung@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lkml.kernel.org/n/tip-x4k0iuw7tt6mywsaguq6jfwu@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: NChunmei Xu <xuchunmei@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 abcb1cfc
...@@ -553,8 +553,6 @@ static void perf_top__sort_new_samples(void *arg) ...@@ -553,8 +553,6 @@ static void perf_top__sort_new_samples(void *arg)
struct perf_evsel *evsel = t->sym_evsel; struct perf_evsel *evsel = t->sym_evsel;
struct hists *hists; struct hists *hists;
perf_top__reset_sample_counters(t);
if (t->evlist->selected != NULL) if (t->evlist->selected != NULL)
t->sym_evsel = t->evlist->selected; t->sym_evsel = t->evlist->selected;
...@@ -571,6 +569,11 @@ static void perf_top__sort_new_samples(void *arg) ...@@ -571,6 +569,11 @@ static void perf_top__sort_new_samples(void *arg)
hists__collapse_resort(hists, NULL); hists__collapse_resort(hists, NULL);
perf_evsel__output_resort(evsel, 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) static void *display_thread_tui(void *arg)
...@@ -908,10 +911,8 @@ static void perf_top__mmap_read(struct perf_top *top) ...@@ -908,10 +911,8 @@ static void perf_top__mmap_read(struct perf_top *top)
{ {
bool overwrite = top->record_opts.overwrite; bool overwrite = top->record_opts.overwrite;
struct perf_evlist *evlist = top->evlist; struct perf_evlist *evlist = top->evlist;
unsigned long long start, end;
int i; int i;
start = rdclock();
if (overwrite) if (overwrite)
perf_evlist__toggle_bkw_mmap(evlist, BKW_MMAP_DATA_PENDING); perf_evlist__toggle_bkw_mmap(evlist, BKW_MMAP_DATA_PENDING);
...@@ -922,13 +923,6 @@ static void perf_top__mmap_read(struct perf_top *top) ...@@ -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_EMPTY);
perf_evlist__toggle_bkw_mmap(evlist, BKW_MMAP_RUNNING); 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");
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册