Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Mar 2010 23:08:19 +0000 (UTC)
From:      Fabien Thomas <fabient@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r204783 - head/usr.sbin/pmcstat
Message-ID:  <201003052308.o25N8Jpr040586@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: fabient
Date: Fri Mar  5 23:08:19 2010
New Revision: 204783
URL: http://svn.freebsd.org/changeset/base/204783

Log:
  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

Modified:
  head/usr.sbin/pmcstat/pmcpl_callgraph.c
  head/usr.sbin/pmcstat/pmcpl_calltree.c
  head/usr.sbin/pmcstat/pmcstat.c

Modified: head/usr.sbin/pmcstat/pmcpl_callgraph.c
==============================================================================
--- head/usr.sbin/pmcstat/pmcpl_callgraph.c	Fri Mar  5 23:03:20 2010	(r204782)
+++ head/usr.sbin/pmcstat/pmcpl_callgraph.c	Fri Mar  5 23:08:19 2010	(r204783)
@@ -550,7 +550,7 @@ pmcstat_cgnode_topprint(struct pmcstat_c
 
 		len = ns_len + vs_len + 1;
 		if (width - len < 0) {
-			PMCSTAT_PRINTW("...");
+			PMCSTAT_PRINTW(" ...");
 			break;
 		}
 		width -= len;

Modified: head/usr.sbin/pmcstat/pmcpl_calltree.c
==============================================================================
--- head/usr.sbin/pmcstat/pmcpl_calltree.c	Fri Mar  5 23:03:20 2010	(r204782)
+++ head/usr.sbin/pmcstat/pmcpl_calltree.c	Fri Mar  5 23:08:19 2010	(r204783)
@@ -387,7 +387,7 @@ pmcpl_ct_node_dumptop(int pmcin, struct 
 	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++)

Modified: head/usr.sbin/pmcstat/pmcstat.c
==============================================================================
--- head/usr.sbin/pmcstat/pmcstat.c	Fri Mar  5 23:03:20 2010	(r204782)
+++ head/usr.sbin/pmcstat/pmcstat.c	Fri Mar  5 23:08:19 2010	(r204783)
@@ -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);
 		}
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003052308.o25N8Jpr040586>