update compat
[lttv.git] / tests / kernel / test-mark.c
1 /* test-mark.c
2 *
3 */
4
5 #include <linux/marker.h>
6 #include <linux/module.h>
7 #include <linux/proc_fs.h>
8 #include <linux/sched.h>
9 #include <asm/ptrace.h>
10
11 volatile int x = 7;
12
13 struct proc_dir_entry *pentry = NULL;
14
15 static inline void test(struct pt_regs * regs)
16 {
17 MARK(kernel_debug_test, "%d %ld %p", 2, regs->eip, regs);
18 }
19
20 static int my_open(struct inode *inode, struct file *file)
21 {
22 unsigned int i;
23
24 for(i=0; i<2; i++) {
25 MARK(subsys_mark1, "%d", 1);
26 }
27 MARK(subsys_mark2, "%d %s %s", 2, "blah2", "blahx");
28 MARK(subsys_mark3, "%d %s %s", x, "blah3", "blah5");
29 test(NULL);
30 test(NULL);
31
32 return -EPERM;
33 }
34
35
36 static struct file_operations my_operations = {
37 .open = my_open,
38 };
39
40 int init_module(void)
41 {
42 pentry = create_proc_entry("testmark", 0444, NULL);
43 if (pentry)
44 pentry->proc_fops = &my_operations;
45
46 marker_list_probe(NULL);
47
48 return 0;
49 }
50
51 void cleanup_module(void)
52 {
53 remove_proc_entry("testmark", NULL);
54 }
55
56 MODULE_LICENSE("GPL");
57 MODULE_AUTHOR("Mathieu Desnoyers");
58 MODULE_DESCRIPTION("Marker Test");
59
This page took 0.035071 seconds and 5 git commands to generate.