diff options
author | Ingo Molnar <mingo@elte.hu> | 2012-01-31 13:02:35 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2012-01-31 13:02:37 +0100 |
commit | bb1693f89ae7f0b30c90d9b26a4f827faed1144a (patch) | |
tree | e02fc59d76d79493bffa190e492775baa134bff6 /tools/perf/builtin-top.c | |
parent | efb3040d481a1594592b1defb4526c406c7a4751 (diff) | |
parent | 45179fec946dd554f74e950d2278dabd5ad23fd3 (diff) | |
download | linux-rt-bb1693f89ae7f0b30c90d9b26a4f827faed1144a.tar.gz |
Merge branch 'perf/urgent' into perf/core
We cherry-picked 3 commits into perf/urgent, merge them back to allow
conflict-free work on those files.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-top.c')
-rw-r--r-- | tools/perf/builtin-top.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index e8b033c074f9..d869b214ada2 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -88,8 +88,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; } @@ -99,6 +97,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); } @@ -452,8 +457,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) { |