diff options
Diffstat (limited to 'samples/tracepoints/tracepoint-probe-sample.c')
| -rw-r--r-- | samples/tracepoints/tracepoint-probe-sample.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/samples/tracepoints/tracepoint-probe-sample.c b/samples/tracepoints/tracepoint-probe-sample.c index 9e60eb6ca2d8..744c0b9652a7 100644 --- a/samples/tracepoints/tracepoint-probe-sample.c +++ b/samples/tracepoints/tracepoint-probe-sample.c | |||
| @@ -13,7 +13,8 @@ | |||
| 13 | * Here the caller only guarantees locking for struct file and struct inode. | 13 | * Here the caller only guarantees locking for struct file and struct inode. |
| 14 | * Locking must therefore be done in the probe to use the dentry. | 14 | * Locking must therefore be done in the probe to use the dentry. |
| 15 | */ | 15 | */ |
| 16 | static void probe_subsys_event(struct inode *inode, struct file *file) | 16 | static void probe_subsys_event(void *ignore, |
| 17 | struct inode *inode, struct file *file) | ||
| 17 | { | 18 | { |
| 18 | path_get(&file->f_path); | 19 | path_get(&file->f_path); |
| 19 | dget(file->f_path.dentry); | 20 | dget(file->f_path.dentry); |
| @@ -23,7 +24,7 @@ static void probe_subsys_event(struct inode *inode, struct file *file) | |||
| 23 | path_put(&file->f_path); | 24 | path_put(&file->f_path); |
| 24 | } | 25 | } |
| 25 | 26 | ||
| 26 | static void probe_subsys_eventb(void) | 27 | static void probe_subsys_eventb(void *ignore) |
| 27 | { | 28 | { |
| 28 | printk(KERN_INFO "Event B is encountered\n"); | 29 | printk(KERN_INFO "Event B is encountered\n"); |
| 29 | } | 30 | } |
| @@ -32,9 +33,9 @@ static int __init tp_sample_trace_init(void) | |||
| 32 | { | 33 | { |
| 33 | int ret; | 34 | int ret; |
| 34 | 35 | ||
| 35 | ret = register_trace_subsys_event(probe_subsys_event); | 36 | ret = register_trace_subsys_event(probe_subsys_event, NULL); |
| 36 | WARN_ON(ret); | 37 | WARN_ON(ret); |
| 37 | ret = register_trace_subsys_eventb(probe_subsys_eventb); | 38 | ret = register_trace_subsys_eventb(probe_subsys_eventb, NULL); |
| 38 | WARN_ON(ret); | 39 | WARN_ON(ret); |
| 39 | 40 | ||
| 40 | return 0; | 41 | return 0; |
| @@ -44,8 +45,8 @@ module_init(tp_sample_trace_init); | |||
| 44 | 45 | ||
| 45 | static void __exit tp_sample_trace_exit(void) | 46 | static void __exit tp_sample_trace_exit(void) |
| 46 | { | 47 | { |
| 47 | unregister_trace_subsys_eventb(probe_subsys_eventb); | 48 | unregister_trace_subsys_eventb(probe_subsys_eventb, NULL); |
| 48 | unregister_trace_subsys_event(probe_subsys_event); | 49 | unregister_trace_subsys_event(probe_subsys_event, NULL); |
| 49 | tracepoint_synchronize_unregister(); | 50 | tracepoint_synchronize_unregister(); |
| 50 | } | 51 | } |
| 51 | 52 | ||
