Rev 1787 | Rev 2028 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1787 | Rev 2021 | ||
|---|---|---|---|
| Line 36... | Line 36... | ||
| 36 | #include <debug.h> |
36 | #include <debug.h> |
| 37 | #include <proc/thread.h> |
37 | #include <proc/thread.h> |
| 38 | #include <memstr.h> |
38 | #include <memstr.h> |
| 39 | #include <arch.h> |
39 | #include <arch.h> |
| 40 | 40 | ||
| - | 41 | #ifdef CONFIG_BENCH |
|
| - | 42 | #include <arch/cycle.h> |
|
| - | 43 | #endif |
|
| - | 44 | ||
| 41 | #define MAX_FRAMES 256 |
45 | #define MAX_FRAMES 256 |
| 42 | #define MAX_ORDER 8 |
46 | #define MAX_ORDER 8 |
| 43 | 47 | ||
| 44 | #define THREAD_RUNS 1 |
48 | #define THREAD_RUNS 1 |
| 45 | #define THREADS 8 |
49 | #define THREADS 8 |
| Line 99... | Line 103... | ||
| 99 | { |
103 | { |
| 100 | panic("Test failed.\n"); |
104 | panic("Test failed.\n"); |
| 101 | } |
105 | } |
| 102 | 106 | ||
| 103 | 107 | ||
| 104 | void test(void) |
108 | void test_falloc2(void) |
| 105 | { |
109 | { |
| - | 110 | #ifdef CONFIG_BENCH |
|
| - | 111 | uint64_t t0 = get_cycle(); |
|
| - | 112 | #endif |
|
| 106 | int i; |
113 | int i; |
| 107 | 114 | ||
| 108 | atomic_set(&thread_count, THREADS); |
115 | atomic_set(&thread_count, THREADS); |
| 109 | 116 | ||
| 110 | for (i = 0; i < THREADS; i++) { |
117 | for (i = 0; i < THREADS; i++) { |
| Line 118... | Line 125... | ||
| 118 | 125 | ||
| 119 | while (thread_count.count) |
126 | while (thread_count.count) |
| 120 | ; |
127 | ; |
| 121 | 128 | ||
| 122 | printf("Test passed.\n"); |
129 | printf("Test passed.\n"); |
| - | 130 | #ifdef CONFIG_BENCH |
|
| - | 131 | uint64_t dt = get_cycle() - t0; |
|
| - | 132 | printf("Time: %.*d cycles\n", sizeof(dt) * 2, dt); |
|
| - | 133 | #endif |
|
| 123 | } |
134 | } |