diff options
-rw-r--r-- | Documentation/tracepoints.txt | 13 | ||||
-rw-r--r-- | samples/tracepoints/tracepoint-sample.c | 24 |
2 files changed, 19 insertions, 18 deletions
diff --git a/Documentation/tracepoints.txt b/Documentation/tracepoints.txt index 4ff43c6de299..c0e1ceed75a4 100644 --- a/Documentation/tracepoints.txt +++ b/Documentation/tracepoints.txt | |||
@@ -103,13 +103,14 @@ used to export the defined tracepoints. | |||
103 | 103 | ||
104 | * Probe / tracepoint example | 104 | * Probe / tracepoint example |
105 | 105 | ||
106 | See the example provided in samples/tracepoints/src | 106 | See the example provided in samples/tracepoints |
107 | 107 | ||
108 | Compile them with your kernel. | 108 | Compile them with your kernel. They are built during 'make' (not |
109 | 'make modules') when CONFIG_SAMPLE_TRACEPOINTS=m. | ||
109 | 110 | ||
110 | Run, as root : | 111 | Run, as root : |
111 | modprobe tracepoint-example (insmod order is not important) | 112 | modprobe tracepoint-sample (insmod order is not important) |
112 | modprobe tracepoint-probe-example | 113 | modprobe tracepoint-probe-sample |
113 | cat /proc/tracepoint-example (returns an expected error) | 114 | cat /proc/tracepoint-sample (returns an expected error) |
114 | rmmod tracepoint-example tracepoint-probe-example | 115 | rmmod tracepoint-sample tracepoint-probe-sample |
115 | dmesg | 116 | dmesg |
diff --git a/samples/tracepoints/tracepoint-sample.c b/samples/tracepoints/tracepoint-sample.c index 68d5dc0310e4..9cf80a11e8b6 100644 --- a/samples/tracepoints/tracepoint-sample.c +++ b/samples/tracepoints/tracepoint-sample.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* tracepoint-sample.c | 1 | /* tracepoint-sample.c |
2 | * | 2 | * |
3 | * Executes a tracepoint when /proc/tracepoint-example is opened. | 3 | * Executes a tracepoint when /proc/tracepoint-sample is opened. |
4 | * | 4 | * |
5 | * (C) Copyright 2007 Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> | 5 | * (C) Copyright 2007 Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> |
6 | * | 6 | * |
@@ -16,7 +16,7 @@ | |||
16 | DEFINE_TRACE(subsys_event); | 16 | DEFINE_TRACE(subsys_event); |
17 | DEFINE_TRACE(subsys_eventb); | 17 | DEFINE_TRACE(subsys_eventb); |
18 | 18 | ||
19 | struct proc_dir_entry *pentry_example; | 19 | struct proc_dir_entry *pentry_sample; |
20 | 20 | ||
21 | static int my_open(struct inode *inode, struct file *file) | 21 | static int my_open(struct inode *inode, struct file *file) |
22 | { | 22 | { |
@@ -32,25 +32,25 @@ static struct file_operations mark_ops = { | |||
32 | .open = my_open, | 32 | .open = my_open, |
33 | }; | 33 | }; |
34 | 34 | ||
35 | static int __init example_init(void) | 35 | static int __init sample_init(void) |
36 | { | 36 | { |
37 | printk(KERN_ALERT "example init\n"); | 37 | printk(KERN_ALERT "sample init\n"); |
38 | pentry_example = proc_create("tracepoint-example", 0444, NULL, | 38 | pentry_sample = proc_create("tracepoint-sample", 0444, NULL, |
39 | &mark_ops); | 39 | &mark_ops); |
40 | if (!pentry_example) | 40 | if (!pentry_sample) |
41 | return -EPERM; | 41 | return -EPERM; |
42 | return 0; | 42 | return 0; |
43 | } | 43 | } |
44 | 44 | ||
45 | static void __exit example_exit(void) | 45 | static void __exit sample_exit(void) |
46 | { | 46 | { |
47 | printk(KERN_ALERT "example exit\n"); | 47 | printk(KERN_ALERT "sample exit\n"); |
48 | remove_proc_entry("tracepoint-example", NULL); | 48 | remove_proc_entry("tracepoint-sample", NULL); |
49 | } | 49 | } |
50 | 50 | ||
51 | module_init(example_init) | 51 | module_init(sample_init) |
52 | module_exit(example_exit) | 52 | module_exit(sample_exit) |
53 | 53 | ||
54 | MODULE_LICENSE("GPL"); | 54 | MODULE_LICENSE("GPL"); |
55 | MODULE_AUTHOR("Mathieu Desnoyers"); | 55 | MODULE_AUTHOR("Mathieu Desnoyers"); |
56 | MODULE_DESCRIPTION("Tracepoint example"); | 56 | MODULE_DESCRIPTION("Tracepoint sample"); |