Changeset cce6acf in mainline for kernel/generic/src/console/cmd.c
- Timestamp:
- 2006-12-13T12:10:23Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e9db6f9e
- Parents:
- 7e13972
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/cmd.c
r7e13972 rcce6acf 68 68 #ifdef CONFIG_TEST 69 69 #include <test.h> 70 #endif71 72 #ifdef CONFIG_BENCH73 #include <arch/cycle.h>74 70 #endif 75 71 … … 866 862 { 867 863 printf("%s\t\t%s\n", test->name, test->desc); 868 #ifdef CONFIG_BENCH 869 uint64_t t0 = get_cycle(); 870 #endif 864 865 /* Update and read thread accounting 866 for benchmarking */ 867 ipl_t ipl = interrupts_disable(); 868 spinlock_lock(&THREAD->lock); 869 thread_update_accounting(); 870 uint64_t t0 = THREAD->cycles; 871 spinlock_unlock(&THREAD->lock); 872 interrupts_restore(ipl); 873 874 /* Execute the test */ 871 875 char * ret = test->entry(); 872 #ifdef CONFIG_BENCH 873 uint64_t dt = get_cycle() - t0; 876 877 /* Update and read thread accounting */ 878 ipl = interrupts_disable(); 879 spinlock_lock(&THREAD->lock); 880 thread_update_accounting(); 881 uint64_t dt = THREAD->cycles - t0; 882 spinlock_unlock(&THREAD->lock); 883 interrupts_restore(ipl); 884 874 885 printf("Time: %llu cycles\n", dt); 875 #endif876 886 877 887 if (ret == NULL) {
Note:
See TracChangeset
for help on using the changeset viewer.