3 * Test time spent in a LTTng instrumentation probe.
7 #define CONFIG_LTT_FACILITY_TESTS
8 #include "ltt-facility-tests.h"
10 #include <linux/init.h>
11 #include <linux/module.h>
12 #include <linux/ltt-core.h>
15 /* Event logged : 4 bytes + 20 bytes header = 24 bytes. Let's use 1MB of
16 * buffers. 1MB / 24bytes = 43690. So, if we write 20000 event, we should not
17 * lose events. Check event lost count after tests. */
19 #define NR_LOOPS 20000
21 static int ltt_test_init(void)
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 printk(KERN_ALERT
"test init\n");
30 local_irq_save(flags
);
31 for(i
=0; i
<NR_LOOPS
; i
++) {
33 trace_tests_write_4bytes(5000);
36 max_time
= max(max_time
, time
);
37 min_time
= min(min_time
, time
);
40 local_irq_restore(flags
);
42 printk(KERN_ALERT
"test results : time per probe\n");
43 printk(KERN_ALERT
"number of loops : %d\n", NR_LOOPS
);
44 printk(KERN_ALERT
"total time : %llu\n", tot_time
);
45 printk(KERN_ALERT
"min : %llu\n", min_time
);
46 printk(KERN_ALERT
"max : %llu\n", max_time
);
48 printk(KERN_ALERT
"test end\n");
50 return -EAGAIN
; /* Fail will directly unload the module */
53 static void ltt_test_exit(void)
55 printk(KERN_ALERT
"test exit\n");
58 module_init(ltt_test_init
)
59 module_exit(ltt_test_exit
)
61 MODULE_LICENSE("GPL");
62 MODULE_AUTHOR("Mathieu Desnoyers");
63 MODULE_DESCRIPTION("Linux Trace Toolkit Test");
This page took 0.029677 seconds and 4 git commands to generate.