3 * Test time spent in a LTTng instrumentation probe.
7 #define CONFIG_LTT_FACILITY_COMPACT
8 #include <ltt/ltt-facility-select-compact.h>
9 #include "ltt-facility-compact.h"
11 #include <linux/init.h>
12 #include <linux/module.h>
13 #include <linux/ltt-core.h>
16 /* Event logged : 4 bytes. Let's use 1MB of
17 * buffers. 1MB / 4bytes = 262144 (plus heartbeats). So, if we write 20000
18 * event, we should not lose events. Check event lost count after tests. */
20 #define NR_LOOPS 20000
22 static int ltt_test_init(void)
25 cycles_t time1
, time2
, time
;
26 cycles_t tot_time
= 0;
28 printk(KERN_ALERT
"test init\n");
30 local_irq_save(flags
);
32 for(i
=0; i
<NR_LOOPS
; i
++) {
33 trace_compact_event_a();
38 local_irq_restore(flags
);
40 printk(KERN_ALERT
"test results : time per probe\n");
41 printk(KERN_ALERT
"number of loops : %d\n", NR_LOOPS
);
42 printk(KERN_ALERT
"total time : %llu\n", tot_time
);
44 printk(KERN_ALERT
"test end\n");
46 return -EAGAIN
; /* Fail will directly unload the module */
49 static void ltt_test_exit(void)
51 printk(KERN_ALERT
"test exit\n");
54 module_init(ltt_test_init
)
55 module_exit(ltt_test_exit
)
57 MODULE_LICENSE("GPL");
58 MODULE_AUTHOR("Mathieu Desnoyers");
59 MODULE_DESCRIPTION("Linux Trace Toolkit Test");
This page took 0.030402 seconds and 5 git commands to generate.