aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-top.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-top.c')
-rw-r--r--tools/perf/builtin-top.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index c5aebf6eb746..e211304a0dd7 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -304,7 +304,7 @@ static void print_sym_table(void)
304 304
305 hists__collapse_resort_threaded(&top.sym_evsel->hists); 305 hists__collapse_resort_threaded(&top.sym_evsel->hists);
306 hists__output_resort_threaded(&top.sym_evsel->hists); 306 hists__output_resort_threaded(&top.sym_evsel->hists);
307 hists__decay_entries(&top.sym_evsel->hists); 307 hists__decay_entries_threaded(&top.sym_evsel->hists);
308 hists__output_recalc_col_len(&top.sym_evsel->hists, winsize.ws_row - 3); 308 hists__output_recalc_col_len(&top.sym_evsel->hists, winsize.ws_row - 3);
309 putchar('\n'); 309 putchar('\n');
310 hists__fprintf(&top.sym_evsel->hists, NULL, false, false, 310 hists__fprintf(&top.sym_evsel->hists, NULL, false, false,
@@ -555,7 +555,7 @@ static void perf_top__sort_new_samples(void *arg)
555 555
556 hists__collapse_resort_threaded(&t->sym_evsel->hists); 556 hists__collapse_resort_threaded(&t->sym_evsel->hists);
557 hists__output_resort_threaded(&t->sym_evsel->hists); 557 hists__output_resort_threaded(&t->sym_evsel->hists);
558 hists__decay_entries(&t->sym_evsel->hists); 558 hists__decay_entries_threaded(&t->sym_evsel->hists);
559 hists__output_recalc_col_len(&t->sym_evsel->hists, winsize.ws_row - 3); 559 hists__output_recalc_col_len(&t->sym_evsel->hists, winsize.ws_row - 3);
560} 560}
561 561
@@ -585,16 +585,31 @@ static void *display_thread(void *arg __used)
585 tc.c_cc[VMIN] = 0; 585 tc.c_cc[VMIN] = 0;
586 tc.c_cc[VTIME] = 0; 586 tc.c_cc[VTIME] = 0;
587 587
588 pthread__unblock_sigwinch();
588repeat: 589repeat:
589 delay_msecs = top.delay_secs * 1000; 590 delay_msecs = top.delay_secs * 1000;
590 tcsetattr(0, TCSANOW, &tc); 591 tcsetattr(0, TCSANOW, &tc);
591 /* trash return*/ 592 /* trash return*/
592 getc(stdin); 593 getc(stdin);
593 594
594 do { 595 while (1) {
595 print_sym_table(); 596 print_sym_table();
596 } while (!poll(&stdin_poll, 1, delay_msecs) == 1); 597 /*
597 598 * Either timeout expired or we got an EINTR due to SIGWINCH,
599 * refresh screen in both cases.
600 */
601 switch (poll(&stdin_poll, 1, delay_msecs)) {
602 case 0:
603 continue;
604 case -1:
605 if (errno == EINTR)
606 continue;
607 /* Fall trhu */
608 default:
609 goto process_hotkey;
610 }
611 }
612process_hotkey:
598 c = getc(stdin); 613 c = getc(stdin);
599 tcsetattr(0, TCSAFLUSH, &save); 614 tcsetattr(0, TCSAFLUSH, &save);
600 615