svn commit: r208415 - in projects/stress2: include lib

Peter Holm pho at FreeBSD.org
Sat May 22 11:38:07 UTC 2010


Author: pho
Date: Sat May 22 11:38:06 2010
New Revision: 208415
URL: http://svn.freebsd.org/changeset/base/208415

Log:
  Only print the name of the test program if run.

Modified:
  projects/stress2/include/stress.h
  projects/stress2/lib/main.c
  projects/stress2/lib/options.c

Modified: projects/stress2/include/stress.h
==============================================================================
--- projects/stress2/include/stress.h	Sat May 22 08:30:47 2010	(r208414)
+++ projects/stress2/include/stress.h	Sat May 22 11:38:06 2010	(r208415)
@@ -60,6 +60,7 @@ extern void putval(unsigned long);
 extern unsigned long getval(void);
 extern void getdf(int64_t *, int64_t *);
 extern void reservedf(int64_t, int64_t);
+extern void show_status(void);
 extern int64_t swap(void);
 extern unsigned long usermem(void);
 #endif

Modified: projects/stress2/lib/main.c
==============================================================================
--- projects/stress2/lib/main.c	Sat May 22 08:30:47 2010	(r208414)
+++ projects/stress2/lib/main.c	Sat May 22 11:38:06 2010	(r208415)
@@ -152,6 +152,8 @@ run_test(void)
 	if (random_int(1,100) > op->load)
 		return (status);
 
+	show_status();
+
 	start = time(NULL);
 	done_testing = 0;
 	fflush(stdout);

Modified: projects/stress2/lib/options.c
==============================================================================
--- projects/stress2/lib/options.c	Sat May 22 08:30:47 2010	(r208414)
+++ projects/stress2/lib/options.c	Sat May 22 11:38:06 2010	(r208415)
@@ -144,9 +144,6 @@ void
 options(int argc, char **argv)
 {
 	int ch;
-	int days;
-	time_t t;
-	char buf[80];
 
 	op = &opt;
 
@@ -206,6 +203,14 @@ options(int argc, char **argv)
 		op->run_time = 15;
 	if (op->load < 0 || op->load > 100)
 		op->load = 100;
+}
+
+void
+show_status(void)
+{
+	char buf[80];
+	int days;
+	time_t t;
 
 	if (op->verbose > 0) {
 		t = op->run_time;
@@ -218,7 +223,6 @@ options(int argc, char **argv)
 	}
 }
 
-
 void
 rmval(void)
 {


More information about the svn-src-projects mailing list