diff options
Diffstat (limited to 'samples/markers')
-rw-r--r-- | samples/markers/probe-example.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/samples/markers/probe-example.c b/samples/markers/probe-example.c index a36797535615..c8e099d4d1fd 100644 --- a/samples/markers/probe-example.c +++ b/samples/markers/probe-example.c | |||
@@ -20,31 +20,27 @@ struct probe_data { | |||
20 | marker_probe_func *probe_func; | 20 | marker_probe_func *probe_func; |
21 | }; | 21 | }; |
22 | 22 | ||
23 | void probe_subsystem_event(const struct marker *mdata, void *private, | 23 | void probe_subsystem_event(void *probe_data, void *call_data, |
24 | const char *format, ...) | 24 | const char *format, va_list *args) |
25 | { | 25 | { |
26 | va_list ap; | ||
27 | /* Declare args */ | 26 | /* Declare args */ |
28 | unsigned int value; | 27 | unsigned int value; |
29 | const char *mystr; | 28 | const char *mystr; |
30 | 29 | ||
31 | /* Assign args */ | 30 | /* Assign args */ |
32 | va_start(ap, format); | 31 | value = va_arg(*args, typeof(value)); |
33 | value = va_arg(ap, typeof(value)); | 32 | mystr = va_arg(*args, typeof(mystr)); |
34 | mystr = va_arg(ap, typeof(mystr)); | ||
35 | 33 | ||
36 | /* Call printk */ | 34 | /* Call printk */ |
37 | printk(KERN_DEBUG "Value %u, string %s\n", value, mystr); | 35 | printk(KERN_INFO "Value %u, string %s\n", value, mystr); |
38 | 36 | ||
39 | /* or count, check rights, serialize data in a buffer */ | 37 | /* or count, check rights, serialize data in a buffer */ |
40 | |||
41 | va_end(ap); | ||
42 | } | 38 | } |
43 | 39 | ||
44 | atomic_t eventb_count = ATOMIC_INIT(0); | 40 | atomic_t eventb_count = ATOMIC_INIT(0); |
45 | 41 | ||
46 | void probe_subsystem_eventb(const struct marker *mdata, void *private, | 42 | void probe_subsystem_eventb(void *probe_data, void *call_data, |
47 | const char *format, ...) | 43 | const char *format, va_list *args) |
48 | { | 44 | { |
49 | /* Increment counter */ | 45 | /* Increment counter */ |
50 | atomic_inc(&eventb_count); | 46 | atomic_inc(&eventb_count); |
@@ -72,10 +68,6 @@ static int __init probe_init(void) | |||
72 | if (result) | 68 | if (result) |
73 | printk(KERN_INFO "Unable to register probe %s\n", | 69 | printk(KERN_INFO "Unable to register probe %s\n", |
74 | probe_array[i].name); | 70 | probe_array[i].name); |
75 | result = marker_arm(probe_array[i].name); | ||
76 | if (result) | ||
77 | printk(KERN_INFO "Unable to arm probe %s\n", | ||
78 | probe_array[i].name); | ||
79 | } | 71 | } |
80 | return 0; | 72 | return 0; |
81 | } | 73 | } |
@@ -85,7 +77,8 @@ static void __exit probe_fini(void) | |||
85 | int i; | 77 | int i; |
86 | 78 | ||
87 | for (i = 0; i < ARRAY_SIZE(probe_array); i++) | 79 | for (i = 0; i < ARRAY_SIZE(probe_array); i++) |
88 | marker_probe_unregister(probe_array[i].name); | 80 | marker_probe_unregister(probe_array[i].name, |
81 | probe_array[i].probe_func, &probe_array[i]); | ||
89 | printk(KERN_INFO "Number of event b : %u\n", | 82 | printk(KERN_INFO "Number of event b : %u\n", |
90 | atomic_read(&eventb_count)); | 83 | atomic_read(&eventb_count)); |
91 | } | 84 | } |