1) Moved tprintf and related functions to their own file in common/libc/printf/tprintf.c.

This file is included by both libc and hostcompat.

2) Changed printf -> tprintf in all testbin programs
This commit is contained in:
Scott Haseley
2016-01-15 13:33:11 -05:00
parent 98ff530afb
commit 0ab862abfa
49 changed files with 501 additions and 478 deletions

View File

@@ -229,7 +229,7 @@ runit(unsigned numthinkers, unsigned numgrinders,
char buf[32];
unsigned i;
printf("Running with %u thinkers, %u grinders, and %u pong groups "
tprintf("Running with %u thinkers, %u grinders, and %u pong groups "
"of size %u each.\n", numthinkers, numgrinders, numponggroups,
ponggroupsize);
@@ -242,7 +242,7 @@ runit(unsigned numthinkers, unsigned numgrinders,
&pids[i+2]);
}
usem_open(&startsem);
printf("Forking done; starting the workload.\n");
tprintf("Forking done; starting the workload.\n");
__time(&startsecs, &startnsecs);
Vn(&startsem, numthinkers + numgrinders +
numponggroups * ponggroupsize);
@@ -252,20 +252,20 @@ runit(unsigned numthinkers, unsigned numgrinders,
openresultsfile(O_RDONLY);
printf("--- Timings ---\n");
tprintf("--- Timings ---\n");
if (numthinkers > 0) {
calcresult(0, startsecs, startnsecs, buf, sizeof(buf));
printf("Thinkers: %s\n", buf);
tprintf("Thinkers: %s\n", buf);
}
if (numgrinders > 0) {
calcresult(1, startsecs, startnsecs, buf, sizeof(buf));
printf("Grinders: %s\n", buf);
tprintf("Grinders: %s\n", buf);
}
for (i=0; i<numponggroups; i++) {
calcresult(i+2, startsecs, startnsecs, buf, sizeof(buf));
printf("Pong group %u: %s\n", i, buf);
tprintf("Pong group %u: %s\n", i, buf);
}
closeresultsfile();