5 #include <linux/module.h>
6 #include <linux/proc_fs.h>
7 #include <linux/sched.h>
8 #include <linux/timex.h>
9 #include <linux/marker.h>
10 #include <asm/ptrace.h>
13 struct proc_dir_entry
*pentry
= NULL
;
15 static inline void test(unsigned long arg
)
18 trace_mark(test_marker
, "arg1 %lu arg2 %p", arg
, current
);
21 static int my_open(struct inode
*inode
, struct file
*file
)
24 cycles_t cycles1
, cycles2
;
27 local_irq_save(flags
);
29 cycles1
= get_cycles();
31 for(i
=0; i
<20000; i
++) {
35 cycles2
= get_cycles();
37 local_irq_restore(flags
);
38 printk("cycles : %llu\n", cycles2
-cycles1
);
43 static struct file_operations my_operations
= {
49 pentry
= create_proc_entry("testmark", 0444, NULL
);
51 pentry
->proc_fops
= &my_operations
;
56 void cleanup_module(void)
58 remove_proc_entry("testmark", NULL
);
61 MODULE_LICENSE("GPL");
62 MODULE_AUTHOR("Mathieu Desnoyers");
63 MODULE_DESCRIPTION("Marker Test");