Skip to content

Commit 254de74

Browse files
olsajiriacmel
authored andcommitted
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 <[email protected]> Acked-by: David S. Miller <[email protected]> Acked-by: Namhyung Kim <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: https://lkml.kernel.org/n/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent d24e3c9 commit 254de74

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

tools/perf/builtin-top.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -553,8 +553,6 @@ static void perf_top__sort_new_samples(void *arg)
553553
struct perf_evsel *evsel = t->sym_evsel;
554554
struct hists *hists;
555555

556-
perf_top__reset_sample_counters(t);
557-
558556
if (t->evlist->selected != NULL)
559557
t->sym_evsel = t->evlist->selected;
560558

@@ -571,6 +569,11 @@ static void perf_top__sort_new_samples(void *arg)
571569

572570
hists__collapse_resort(hists, NULL);
573571
perf_evsel__output_resort(evsel, NULL);
572+
573+
if (t->lost)
574+
pr_warning("Too slow to read ring buffer (change period (-c/-F) or limit CPUs (-C)\n");
575+
576+
perf_top__reset_sample_counters(t);
574577
}
575578

576579
static void *display_thread_tui(void *arg)
@@ -908,10 +911,8 @@ static void perf_top__mmap_read(struct perf_top *top)
908911
{
909912
bool overwrite = top->record_opts.overwrite;
910913
struct perf_evlist *evlist = top->evlist;
911-
unsigned long long start, end;
912914
int i;
913915

914-
start = rdclock();
915916
if (overwrite)
916917
perf_evlist__toggle_bkw_mmap(evlist, BKW_MMAP_DATA_PENDING);
917918

@@ -922,13 +923,6 @@ static void perf_top__mmap_read(struct perf_top *top)
922923
perf_evlist__toggle_bkw_mmap(evlist, BKW_MMAP_EMPTY);
923924
perf_evlist__toggle_bkw_mmap(evlist, BKW_MMAP_RUNNING);
924925
}
925-
end = rdclock();
926-
927-
if ((end - start) > (unsigned long long)top->delay_secs * NSEC_PER_SEC)
928-
ui__warning("Too slow to read ring buffer.\n"
929-
"Please try increasing the period (-c) or\n"
930-
"decreasing the freq (-F) or\n"
931-
"limiting the number of CPUs (-C)\n");
932926
}
933927

934928
/*

0 commit comments

Comments
 (0)