- style cleanup.

- fix warnings.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25008 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
François Revol
2008-04-17 19:34:01 +00:00
parent 3ef106839a
commit 3ddc1cdb8b
+19 -31
View File
@@ -49,10 +49,8 @@ static int cpus; /* how many cpus we are runing on */
/* /*
* Grow the list to add just one more entry * Grow the list to add just one more entry
*/ */
void static void
grow( grow(thread_time_list_t *times)
thread_time_list_t *times
)
{ {
int i; int i;
@@ -69,10 +67,8 @@ grow(
times->nthreads++; times->nthreads++;
} }
void static void
init_times( init_times(thread_time_list_t *times)
thread_time_list_t *times
)
{ {
int i; int i;
@@ -86,10 +82,8 @@ init_times(
fprintf(stderr, "This can't happen\n"); fprintf(stderr, "This can't happen\n");
} }
void static void
free_times( free_times(thread_time_list_t *times)
thread_time_list_t *times
)
{ {
int i; int i;
@@ -106,11 +100,8 @@ free_times(
/* /*
* Compare two thread snapshots (for qsort) * Compare two thread snapshots (for qsort)
*/ */
int static int
comparetime( comparetime(const void *a, const void *b)
const void *a,
const void *b
)
{ {
thread_times_t *ta = (thread_times_t *)a; thread_times_t *ta = (thread_times_t *)a;
thread_times_t *tb = (thread_times_t *)b; thread_times_t *tb = (thread_times_t *)b;
@@ -124,11 +115,8 @@ comparetime(
* Remember: for multiple CPUs, multiply the interval by # cpus * Remember: for multiple CPUs, multiply the interval by # cpus
* when calculating * when calculating
*/ */
float static float
cpu_perc( cpu_perc(bigtime_t spent, bigtime_t interval)
bigtime_t spent,
bigtime_t interval
)
{ {
return ((100.0 * spent) / (cpus * interval)); return ((100.0 * spent) / (cpus * interval));
} }
@@ -136,7 +124,7 @@ cpu_perc(
/* /*
* Clear the screen * Clear the screen
*/ */
void static void
clear(void) clear(void)
{ {
if (clear_string) { if (clear_string) {
@@ -148,7 +136,7 @@ clear(void)
/* /*
* Compare an old snapshot with the new one * Compare an old snapshot with the new one
*/ */
void static void
compare( compare(
thread_time_list_t *old, thread_time_list_t *old,
thread_time_list_t *new, thread_time_list_t *new,
@@ -171,11 +159,11 @@ compare(
bigtime_t ktotal; bigtime_t ktotal;
bigtime_t gtotal; bigtime_t gtotal;
bigtime_t idletime; bigtime_t idletime;
thread_times_t ttime; //thread_times_t ttime;
int newthread; int newthread;
int ignore; int ignore;
int linecount; int linecount;
system_info info; //system_info info;
char *p; char *p;
/* /*
@@ -256,7 +244,7 @@ compare(
if (get_team_info(t.team, &tm) < B_NO_ERROR) { if (get_team_info(t.team, &tm) < B_NO_ERROR) {
strcpy(tm.args, "(unknown)"); strcpy(tm.args, "(unknown)");
} else { } else {
if (p = strrchr(tm.args, '/')) { if ((p = strrchr(tm.args, '/'))) {
strcpy(tm.args, p + 1); strcpy(tm.args, p + 1);
} }
} }
@@ -275,7 +263,7 @@ compare(
} }
if (!ignore && (!refresh || (linecount < (rows - 1)))) { if (!ignore && (!refresh || (linecount < (rows - 1)))) {
printf("%6d %7.2f %7.2f %7.2f %4.1f %16s %16s\n", printf("%6ld %7.2f %7.2f %7.2f %4.1f %16s %16s\n",
times.thread_times[i].thid, times.thread_times[i].thid,
total / 1000.0, total / 1000.0,
(double)(times.thread_times[i].user_time / 1000), (double)(times.thread_times[i].user_time / 1000),
@@ -335,7 +323,7 @@ setup_term(void)
/* /*
* Gather up thread data for uinterval microseconds * Gather up thread data for uinterval microseconds
*/ */
thread_time_list_t static thread_time_list_t
gather( gather(
thread_time_list_t *old, thread_time_list_t *old,
bigtime_t *busy_wait_time, bigtime_t *busy_wait_time,
@@ -378,7 +366,7 @@ gather(
/* /*
* print usage message and exit * print usage message and exit
*/ */
void static void
usage(const char *myname) usage(const char *myname)
{ {
fprintf(stderr, "usage: %s [-d] [-i interval] [-n ntimes]\n", myname); fprintf(stderr, "usage: %s [-d] [-i interval] [-n ntimes]\n", myname);
@@ -401,7 +389,7 @@ main(int argc, char **argv)
int interval = 5; int interval = 5;
int refresh = 1; int refresh = 1;
system_info sysinfo; system_info sysinfo;
bigtime_t now; //bigtime_t now;
bigtime_t then; bigtime_t then;
bigtime_t uinterval; bigtime_t uinterval;
bigtime_t elapsed; bigtime_t elapsed;