Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 287132
b: refs/heads/master
c: 509605d
h: refs/heads/master
v: v3
  • Loading branch information
Stephane Eranian authored and Arnaldo Carvalho de Melo committed Jan 31, 2012
1 parent 7932a6b commit 2d21215
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d8d9c282a1abbe2baf6d22f959e6adf4c90629bf
refs/heads/master: 509605dbe9395ce1abbfac1dba375f074ff57a53
13 changes: 10 additions & 3 deletions trunk/tools/perf/builtin-top.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ void get_term_dimensions(struct winsize *ws)

static void perf_top__update_print_entries(struct perf_top *top)
{
top->print_entries = top->winsize.ws_row;

if (top->print_entries > 9)
top->print_entries -= 9;
}
Expand All @@ -100,6 +98,13 @@ static void perf_top__sig_winch(int sig __used, siginfo_t *info __used, void *ar
struct perf_top *top = arg;

get_term_dimensions(&top->winsize);
if (!top->print_entries
|| (top->print_entries+4) > top->winsize.ws_row) {
top->print_entries = top->winsize.ws_row;
} else {
top->print_entries += 4;
top->winsize.ws_row = top->print_entries;
}
perf_top__update_print_entries(top);
}

Expand Down Expand Up @@ -453,8 +458,10 @@ static void perf_top__handle_keypress(struct perf_top *top, int c)
};
perf_top__sig_winch(SIGWINCH, NULL, top);
sigaction(SIGWINCH, &act, NULL);
} else
} else {
perf_top__sig_winch(SIGWINCH, NULL, top);
signal(SIGWINCH, SIG_DFL);
}
break;
case 'E':
if (top->evlist->nr_entries > 1) {
Expand Down

0 comments on commit 2d21215

Please sign in to comment.