8 #include <ltt/ltt-facility-user_tests.h>
10 #define max(a,b) ((a)>(b)?(a):(b))
11 #define min(a,b) ((a)<(b)?(a):(b))
13 /* Event logged : 4 bytes + 20 bytes header = 24 bytes. Let's use 1MB of
14 * buffers. 1MB / 24bytes = 43690. So, if we write 20000 event, we should not
15 * lose events. Check event lost count after tests. */
17 #define NR_LOOPS 20000
19 typedef unsigned long long cycles_t
;
21 int main(int argc
, char **argv
)
24 cycles_t time1
, time2
, time
;
25 cycles_t max_time
= 0, min_time
= 18446744073709551615ULL; /* (2^64)-1 */
26 cycles_t tot_time
= 0;
28 for(i
=0; i
<NR_LOOPS
; i
++) {
30 trace_user_tests_write_4bytes(5000);
33 max_time
= max(max_time
, time
);
34 min_time
= min(min_time
, time
);
38 printf("test results : time per probe (in cycles)\n");
39 printf("number of loops : %d\n", NR_LOOPS
);
40 printf("total time : %llu\n", tot_time
);
41 printf("average time : %g\n", tot_time
/(double)NR_LOOPS
);
42 printf("min : %llu\n", min_time
);
43 printf("max : %llu\n", max_time
);
This page took 0.030344 seconds and 4 git commands to generate.