[arch] factor out the debug_cycle_count to arch specific code

This commit is contained in:
Travis Geiselbrecht
2009-06-28 12:48:18 -07:00
parent f5afcca893
commit 2d23d7f9e3
12 changed files with 21 additions and 35 deletions

View File

@@ -29,8 +29,8 @@
#include <lib/console.h>
STATIC_COMMAND_START
{ "printf_tests", NULL, (console_cmd)&printf_tests },
{ "thread_tests", NULL, (console_cmd)&thread_tests },
STATIC_COMMAND("printf_tests", NULL, (console_cmd)&printf_tests)
STATIC_COMMAND("thread_tests", NULL, (console_cmd)&thread_tests)
STATIC_COMMAND_END(tests);
#endif

View File

@@ -221,11 +221,11 @@ static int context_switch_tester(void *arg)
event_wait(&context_switch_event);
uint count = debug_cycle_count();
uint count = arch_cycle_count();
for (i = 0; i < iter; i++) {
thread_yield();
}
total_count += debug_cycle_count() - count;
total_count += arch_cycle_count() - count;
thread_sleep(1000);
printf("took %u cycles to yield %d times, %u per yield, %u per yield per thread\n",
total_count, iter, total_count / iter, total_count / iter / thread_count);