Commit 8cc42de7 authored by Kan Liang's avatar Kan Liang Committed by Arnaldo Carvalho de Melo

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: default avatarKan Liang <kan.liang@intel.com>
Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1516310792-208685-18-git-send-email-kan.liang@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent ebebbf08
...@@ -889,8 +889,10 @@ static void perf_top__mmap_read(struct perf_top *top) ...@@ -889,8 +889,10 @@ 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);
...@@ -901,6 +903,13 @@ static void perf_top__mmap_read(struct perf_top *top) ...@@ -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_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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment