From 3d20760d98d2746236db515c75b689d1a727e43d Mon Sep 17 00:00:00 2001 From: fabient Date: Fri, 5 Mar 2010 23:08:19 +0000 Subject: Bug fixed: - no display on serial terminal in top mode. - display alignment for continuation string. - correct invalid value used for display limit. MFC after: 3 days --- usr.sbin/pmcstat/pmcpl_callgraph.c | 2 +- usr.sbin/pmcstat/pmcpl_calltree.c | 2 +- usr.sbin/pmcstat/pmcstat.c | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) (limited to 'usr.sbin/pmcstat') diff --git a/usr.sbin/pmcstat/pmcpl_callgraph.c b/usr.sbin/pmcstat/pmcpl_callgraph.c index d6f1a9d..84e2819 100644 --- a/usr.sbin/pmcstat/pmcpl_callgraph.c +++ b/usr.sbin/pmcstat/pmcpl_callgraph.c @@ -550,7 +550,7 @@ pmcstat_cgnode_topprint(struct pmcstat_cgnode *cg, len = ns_len + vs_len + 1; if (width - len < 0) { - PMCSTAT_PRINTW("..."); + PMCSTAT_PRINTW(" ..."); break; } width -= len; diff --git a/usr.sbin/pmcstat/pmcpl_calltree.c b/usr.sbin/pmcstat/pmcpl_calltree.c index 498092d..404653e 100644 --- a/usr.sbin/pmcstat/pmcpl_calltree.c +++ b/usr.sbin/pmcstat/pmcpl_calltree.c @@ -387,7 +387,7 @@ pmcpl_ct_node_dumptop(int pmcin, struct pmcpl_ct_node *ct, if (ct->pct_narc == 0) { pmcpl_ct_topscreen[x+1][*y] = NULL; if (*y >= PMCPL_CT_MAXLINE || - *y >= pmcstat_displaywidth) + *y >= pmcstat_displayheight) return 1; *y = *y + 1; for (i=0; i < x; i++) diff --git a/usr.sbin/pmcstat/pmcstat.c b/usr.sbin/pmcstat/pmcstat.c index a73d293..89ec8f0 100644 --- a/usr.sbin/pmcstat/pmcstat.c +++ b/usr.sbin/pmcstat/pmcstat.c @@ -1311,6 +1311,9 @@ main(int argc, char **argv) intrflush(stdscr, FALSE); keypad(stdscr, TRUE); clear(); + /* Get terminal width / height with ncurses. */ + getmaxyx(stdscr, pmcstat_displayheight, pmcstat_displaywidth); + pmcstat_displayheight--; pmcstat_displaywidth--; atexit(pmcstat_topexit); } } -- cgit v1.1