diff options
-rw-r--r-- | include/linux/tracepoint.h | 95 | ||||
-rw-r--r-- | include/trace/ftrace.h | 14 | ||||
-rw-r--r-- | kernel/trace/blktrace.c | 125 | ||||
-rw-r--r-- | kernel/trace/ftrace.c | 7 | ||||
-rw-r--r-- | kernel/trace/kmemtrace.c | 42 | ||||
-rw-r--r-- | kernel/trace/trace_sched_switch.c | 20 | ||||
-rw-r--r-- | kernel/trace/trace_sched_wakeup.c | 28 | ||||
-rw-r--r-- | kernel/trace/trace_syscalls.c | 24 | ||||
-rw-r--r-- | kernel/trace/trace_workqueue.c | 26 | ||||
-rw-r--r-- | kernel/tracepoint.c | 91 | ||||
-rw-r--r-- | net/core/drop_monitor.c | 12 | ||||
-rw-r--r-- | samples/tracepoints/tp-samples-trace.h | 4 | ||||
-rw-r--r-- | samples/tracepoints/tracepoint-probe-sample.c | 13 | ||||
-rw-r--r-- | samples/tracepoints/tracepoint-probe-sample2.c | 7 |
14 files changed, 298 insertions, 210 deletions
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index 8d5e4f6d96d0..9a59d1f98cd4 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
@@ -20,12 +20,17 @@ | |||
20 | struct module; | 20 | struct module; |
21 | struct tracepoint; | 21 | struct tracepoint; |
22 | 22 | ||
23 | struct tracepoint_func { | ||
24 | void *func; | ||
25 | void *data; | ||
26 | }; | ||
27 | |||
23 | struct tracepoint { | 28 | struct tracepoint { |
24 | const char *name; /* Tracepoint name */ | 29 | const char *name; /* Tracepoint name */ |
25 | int state; /* State. */ | 30 | int state; /* State. */ |
26 | void (*regfunc)(void); | 31 | void (*regfunc)(void); |
27 | void (*unregfunc)(void); | 32 | void (*unregfunc)(void); |
28 | void **funcs; | 33 | struct tracepoint_func *funcs; |
29 | } __attribute__((aligned(32))); /* | 34 | } __attribute__((aligned(32))); /* |
30 | * Aligned on 32 bytes because it is | 35 | * Aligned on 32 bytes because it is |
31 | * globally visible and gcc happily | 36 | * globally visible and gcc happily |
@@ -37,16 +42,19 @@ struct tracepoint { | |||
37 | * Connect a probe to a tracepoint. | 42 | * Connect a probe to a tracepoint. |
38 | * Internal API, should not be used directly. | 43 | * Internal API, should not be used directly. |
39 | */ | 44 | */ |
40 | extern int tracepoint_probe_register(const char *name, void *probe); | 45 | extern int tracepoint_probe_register(const char *name, void *probe, void *data); |
41 | 46 | ||
42 | /* | 47 | /* |
43 | * Disconnect a probe from a tracepoint. | 48 | * Disconnect a probe from a tracepoint. |
44 | * Internal API, should not be used directly. | 49 | * Internal API, should not be used directly. |
45 | */ | 50 | */ |
46 | extern int tracepoint_probe_unregister(const char *name, void *probe); | 51 | extern int |
52 | tracepoint_probe_unregister(const char *name, void *probe, void *data); | ||
47 | 53 | ||
48 | extern int tracepoint_probe_register_noupdate(const char *name, void *probe); | 54 | extern int tracepoint_probe_register_noupdate(const char *name, void *probe, |
49 | extern int tracepoint_probe_unregister_noupdate(const char *name, void *probe); | 55 | void *data); |
56 | extern int tracepoint_probe_unregister_noupdate(const char *name, void *probe, | ||
57 | void *data); | ||
50 | extern void tracepoint_probe_update_all(void); | 58 | extern void tracepoint_probe_update_all(void); |
51 | 59 | ||
52 | struct tracepoint_iter { | 60 | struct tracepoint_iter { |
@@ -102,17 +110,27 @@ static inline void tracepoint_update_probe_range(struct tracepoint *begin, | |||
102 | /* | 110 | /* |
103 | * it_func[0] is never NULL because there is at least one element in the array | 111 | * it_func[0] is never NULL because there is at least one element in the array |
104 | * when the array itself is non NULL. | 112 | * when the array itself is non NULL. |
113 | * | ||
114 | * Note, the proto and args passed in includes "__data" as the first parameter. | ||
115 | * The reason for this is to handle the "void" prototype. If a tracepoint | ||
116 | * has a "void" prototype, then it is invalid to declare a function | ||
117 | * as "(void *, void)". The DECLARE_TRACE_NOARGS() will pass in just | ||
118 | * "void *data", where as the DECLARE_TRACE() will pass in "void *data, proto". | ||
105 | */ | 119 | */ |
106 | #define __DO_TRACE(tp, proto, args) \ | 120 | #define __DO_TRACE(tp, proto, args) \ |
107 | do { \ | 121 | do { \ |
108 | void **it_func; \ | 122 | struct tracepoint_func *it_func_ptr; \ |
123 | void *it_func; \ | ||
124 | void *__data; \ | ||
109 | \ | 125 | \ |
110 | rcu_read_lock_sched_notrace(); \ | 126 | rcu_read_lock_sched_notrace(); \ |
111 | it_func = rcu_dereference_sched((tp)->funcs); \ | 127 | it_func_ptr = rcu_dereference_sched((tp)->funcs); \ |
112 | if (it_func) { \ | 128 | if (it_func_ptr) { \ |
113 | do { \ | 129 | do { \ |
114 | ((void(*)(proto))(*it_func))(args); \ | 130 | it_func = (it_func_ptr)->func; \ |
115 | } while (*(++it_func)); \ | 131 | __data = (it_func_ptr)->data; \ |
132 | ((void(*)(proto))(it_func))(args); \ | ||
133 | } while ((++it_func_ptr)->func); \ | ||
116 | } \ | 134 | } \ |
117 | rcu_read_unlock_sched_notrace(); \ | 135 | rcu_read_unlock_sched_notrace(); \ |
118 | } while (0) | 136 | } while (0) |
@@ -122,23 +140,29 @@ static inline void tracepoint_update_probe_range(struct tracepoint *begin, | |||
122 | * not add unwanted padding between the beginning of the section and the | 140 | * not add unwanted padding between the beginning of the section and the |
123 | * structure. Force alignment to the same alignment as the section start. | 141 | * structure. Force alignment to the same alignment as the section start. |
124 | */ | 142 | */ |
125 | #define DECLARE_TRACE(name, proto, args) \ | 143 | #define __DECLARE_TRACE(name, proto, args, data_proto, data_args) \ |
126 | extern struct tracepoint __tracepoint_##name; \ | 144 | extern struct tracepoint __tracepoint_##name; \ |
127 | static inline void trace_##name(proto) \ | 145 | static inline void trace_##name(proto) \ |
128 | { \ | 146 | { \ |
129 | if (unlikely(__tracepoint_##name.state)) \ | 147 | if (unlikely(__tracepoint_##name.state)) \ |
130 | __DO_TRACE(&__tracepoint_##name, \ | 148 | __DO_TRACE(&__tracepoint_##name, \ |
131 | TP_PROTO(proto), TP_ARGS(args)); \ | 149 | TP_PROTO(data_proto), \ |
150 | TP_ARGS(data_args)); \ | ||
132 | } \ | 151 | } \ |
133 | static inline int register_trace_##name(void (*probe)(proto)) \ | 152 | static inline int \ |
153 | register_trace_##name(void (*probe)(data_proto), void *data) \ | ||
134 | { \ | 154 | { \ |
135 | return tracepoint_probe_register(#name, (void *)probe); \ | 155 | return tracepoint_probe_register(#name, (void *)probe, \ |
156 | data); \ | ||
136 | } \ | 157 | } \ |
137 | static inline int unregister_trace_##name(void (*probe)(proto)) \ | 158 | static inline int \ |
159 | unregister_trace_##name(void (*probe)(data_proto), void *data) \ | ||
138 | { \ | 160 | { \ |
139 | return tracepoint_probe_unregister(#name, (void *)probe);\ | 161 | return tracepoint_probe_unregister(#name, (void *)probe, \ |
162 | data); \ | ||
140 | } \ | 163 | } \ |
141 | static inline void check_trace_callback_type_##name(void (*cb)(proto)) \ | 164 | static inline void \ |
165 | check_trace_callback_type_##name(void (*cb)(data_proto)) \ | ||
142 | { \ | 166 | { \ |
143 | } | 167 | } |
144 | 168 | ||
@@ -158,20 +182,22 @@ static inline void tracepoint_update_probe_range(struct tracepoint *begin, | |||
158 | EXPORT_SYMBOL(__tracepoint_##name) | 182 | EXPORT_SYMBOL(__tracepoint_##name) |
159 | 183 | ||
160 | #else /* !CONFIG_TRACEPOINTS */ | 184 | #else /* !CONFIG_TRACEPOINTS */ |
161 | #define DECLARE_TRACE(name, proto, args) \ | 185 | #define __DECLARE_TRACE(name, proto, args, data_proto, data_args) \ |
162 | static inline void _do_trace_##name(struct tracepoint *tp, proto) \ | ||
163 | { } \ | ||
164 | static inline void trace_##name(proto) \ | 186 | static inline void trace_##name(proto) \ |
165 | { } \ | 187 | { } \ |
166 | static inline int register_trace_##name(void (*probe)(proto)) \ | 188 | static inline int \ |
189 | register_trace_##name(void (*probe)(data_proto), \ | ||
190 | void *data) \ | ||
167 | { \ | 191 | { \ |
168 | return -ENOSYS; \ | 192 | return -ENOSYS; \ |
169 | } \ | 193 | } \ |
170 | static inline int unregister_trace_##name(void (*probe)(proto)) \ | 194 | static inline int \ |
195 | unregister_trace_##name(void (*probe)(data_proto), \ | ||
196 | void *data) \ | ||
171 | { \ | 197 | { \ |
172 | return -ENOSYS; \ | 198 | return -ENOSYS; \ |
173 | } \ | 199 | } \ |
174 | static inline void check_trace_callback_type_##name(void (*cb)(proto)) \ | 200 | static inline void check_trace_callback_type_##name(void (*cb)(data_proto)) \ |
175 | { \ | 201 | { \ |
176 | } | 202 | } |
177 | 203 | ||
@@ -181,6 +207,29 @@ static inline void tracepoint_update_probe_range(struct tracepoint *begin, | |||
181 | #define EXPORT_TRACEPOINT_SYMBOL(name) | 207 | #define EXPORT_TRACEPOINT_SYMBOL(name) |
182 | 208 | ||
183 | #endif /* CONFIG_TRACEPOINTS */ | 209 | #endif /* CONFIG_TRACEPOINTS */ |
210 | |||
211 | /* | ||
212 | * The need for the DECLARE_TRACE_NOARGS() is to handle the prototype | ||
213 | * (void). "void" is a special value in a function prototype and can | ||
214 | * not be combined with other arguments. Since the DECLARE_TRACE() | ||
215 | * macro adds a data element at the beginning of the prototype, | ||
216 | * we need a way to differentiate "(void *data, proto)" from | ||
217 | * "(void *data, void)". The second prototype is invalid. | ||
218 | * | ||
219 | * DECLARE_TRACE_NOARGS() passes "void" as the tracepoint prototype | ||
220 | * and "void *__data" as the callback prototype. | ||
221 | * | ||
222 | * DECLARE_TRACE() passes "proto" as the tracepoint protoype and | ||
223 | * "void *__data, proto" as the callback prototype. | ||
224 | */ | ||
225 | #define DECLARE_TRACE_NOARGS(name) \ | ||
226 | __DECLARE_TRACE(name, void, , void *__data, __data) | ||
227 | |||
228 | #define DECLARE_TRACE(name, proto, args) \ | ||
229 | __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), \ | ||
230 | PARAMS(void *__data, proto), \ | ||
231 | PARAMS(__data, args)) | ||
232 | |||
184 | #endif /* DECLARE_TRACE */ | 233 | #endif /* DECLARE_TRACE */ |
185 | 234 | ||
186 | #ifndef TRACE_EVENT | 235 | #ifndef TRACE_EVENT |
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index 7dcdfd824aab..ba28b644f41b 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -406,18 +406,18 @@ static inline notrace int ftrace_get_offsets_##call( \ | |||
406 | #undef DEFINE_EVENT | 406 | #undef DEFINE_EVENT |
407 | #define DEFINE_EVENT(template, name, proto, args) \ | 407 | #define DEFINE_EVENT(template, name, proto, args) \ |
408 | \ | 408 | \ |
409 | static void perf_trace_##name(proto); \ | 409 | static void perf_trace_##name(void *, proto); \ |
410 | \ | 410 | \ |
411 | static notrace int \ | 411 | static notrace int \ |
412 | perf_trace_enable_##name(struct ftrace_event_call *unused) \ | 412 | perf_trace_enable_##name(struct ftrace_event_call *unused) \ |
413 | { \ | 413 | { \ |
414 | return register_trace_##name(perf_trace_##name); \ | 414 | return register_trace_##name(perf_trace_##name, NULL); \ |
415 | } \ | 415 | } \ |
416 | \ | 416 | \ |
417 | static notrace void \ | 417 | static notrace void \ |
418 | perf_trace_disable_##name(struct ftrace_event_call *unused) \ | 418 | perf_trace_disable_##name(struct ftrace_event_call *unused) \ |
419 | { \ | 419 | { \ |
420 | unregister_trace_##name(perf_trace_##name); \ | 420 | unregister_trace_##name(perf_trace_##name, NULL); \ |
421 | } | 421 | } |
422 | 422 | ||
423 | #undef DEFINE_EVENT_PRINT | 423 | #undef DEFINE_EVENT_PRINT |
@@ -578,7 +578,7 @@ ftrace_raw_event_id_##call(struct ftrace_event_call *event_call, \ | |||
578 | #undef DEFINE_EVENT | 578 | #undef DEFINE_EVENT |
579 | #define DEFINE_EVENT(template, call, proto, args) \ | 579 | #define DEFINE_EVENT(template, call, proto, args) \ |
580 | \ | 580 | \ |
581 | static notrace void ftrace_raw_event_##call(proto) \ | 581 | static notrace void ftrace_raw_event_##call(void *__ignore, proto) \ |
582 | { \ | 582 | { \ |
583 | ftrace_raw_event_id_##template(&event_##call, args); \ | 583 | ftrace_raw_event_id_##template(&event_##call, args); \ |
584 | } \ | 584 | } \ |
@@ -586,13 +586,13 @@ static notrace void ftrace_raw_event_##call(proto) \ | |||
586 | static notrace int \ | 586 | static notrace int \ |
587 | ftrace_raw_reg_event_##call(struct ftrace_event_call *unused) \ | 587 | ftrace_raw_reg_event_##call(struct ftrace_event_call *unused) \ |
588 | { \ | 588 | { \ |
589 | return register_trace_##call(ftrace_raw_event_##call); \ | 589 | return register_trace_##call(ftrace_raw_event_##call, NULL); \ |
590 | } \ | 590 | } \ |
591 | \ | 591 | \ |
592 | static notrace void \ | 592 | static notrace void \ |
593 | ftrace_raw_unreg_event_##call(struct ftrace_event_call *unused) \ | 593 | ftrace_raw_unreg_event_##call(struct ftrace_event_call *unused) \ |
594 | { \ | 594 | { \ |
595 | unregister_trace_##call(ftrace_raw_event_##call); \ | 595 | unregister_trace_##call(ftrace_raw_event_##call, NULL); \ |
596 | } \ | 596 | } \ |
597 | \ | 597 | \ |
598 | static struct trace_event ftrace_event_type_##call = { \ | 598 | static struct trace_event ftrace_event_type_##call = { \ |
@@ -793,7 +793,7 @@ perf_trace_templ_##call(struct ftrace_event_call *event_call, \ | |||
793 | 793 | ||
794 | #undef DEFINE_EVENT | 794 | #undef DEFINE_EVENT |
795 | #define DEFINE_EVENT(template, call, proto, args) \ | 795 | #define DEFINE_EVENT(template, call, proto, args) \ |
796 | static notrace void perf_trace_##call(proto) \ | 796 | static notrace void perf_trace_##call(void *__ignore, proto) \ |
797 | { \ | 797 | { \ |
798 | struct ftrace_event_call *event_call = &event_##call; \ | 798 | struct ftrace_event_call *event_call = &event_##call; \ |
799 | \ | 799 | \ |
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index b3bc91a3f510..19d93f83e3c3 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c | |||
@@ -675,28 +675,33 @@ static void blk_add_trace_rq(struct request_queue *q, struct request *rq, | |||
675 | } | 675 | } |
676 | } | 676 | } |
677 | 677 | ||
678 | static void blk_add_trace_rq_abort(struct request_queue *q, struct request *rq) | 678 | static void blk_add_trace_rq_abort(void *ignore, |
679 | struct request_queue *q, struct request *rq) | ||
679 | { | 680 | { |
680 | blk_add_trace_rq(q, rq, BLK_TA_ABORT); | 681 | blk_add_trace_rq(q, rq, BLK_TA_ABORT); |
681 | } | 682 | } |
682 | 683 | ||
683 | static void blk_add_trace_rq_insert(struct request_queue *q, struct request *rq) | 684 | static void blk_add_trace_rq_insert(void *ignore, |
685 | struct request_queue *q, struct request *rq) | ||
684 | { | 686 | { |
685 | blk_add_trace_rq(q, rq, BLK_TA_INSERT); | 687 | blk_add_trace_rq(q, rq, BLK_TA_INSERT); |
686 | } | 688 | } |
687 | 689 | ||
688 | static void blk_add_trace_rq_issue(struct request_queue *q, struct request *rq) | 690 | static void blk_add_trace_rq_issue(void *ignore, |
691 | struct request_queue *q, struct request *rq) | ||
689 | { | 692 | { |
690 | blk_add_trace_rq(q, rq, BLK_TA_ISSUE); | 693 | blk_add_trace_rq(q, rq, BLK_TA_ISSUE); |
691 | } | 694 | } |
692 | 695 | ||
693 | static void blk_add_trace_rq_requeue(struct request_queue *q, | 696 | static void blk_add_trace_rq_requeue(void *ignore, |
697 | struct request_queue *q, | ||
694 | struct request *rq) | 698 | struct request *rq) |
695 | { | 699 | { |
696 | blk_add_trace_rq(q, rq, BLK_TA_REQUEUE); | 700 | blk_add_trace_rq(q, rq, BLK_TA_REQUEUE); |
697 | } | 701 | } |
698 | 702 | ||
699 | static void blk_add_trace_rq_complete(struct request_queue *q, | 703 | static void blk_add_trace_rq_complete(void *ignore, |
704 | struct request_queue *q, | ||
700 | struct request *rq) | 705 | struct request *rq) |
701 | { | 706 | { |
702 | blk_add_trace_rq(q, rq, BLK_TA_COMPLETE); | 707 | blk_add_trace_rq(q, rq, BLK_TA_COMPLETE); |
@@ -724,34 +729,40 @@ static void blk_add_trace_bio(struct request_queue *q, struct bio *bio, | |||
724 | !bio_flagged(bio, BIO_UPTODATE), 0, NULL); | 729 | !bio_flagged(bio, BIO_UPTODATE), 0, NULL); |
725 | } | 730 | } |
726 | 731 | ||
727 | static void blk_add_trace_bio_bounce(struct request_queue *q, struct bio *bio) | 732 | static void blk_add_trace_bio_bounce(void *ignore, |
733 | struct request_queue *q, struct bio *bio) | ||
728 | { | 734 | { |
729 | blk_add_trace_bio(q, bio, BLK_TA_BOUNCE); | 735 | blk_add_trace_bio(q, bio, BLK_TA_BOUNCE); |
730 | } | 736 | } |
731 | 737 | ||
732 | static void blk_add_trace_bio_complete(struct request_queue *q, struct bio *bio) | 738 | static void blk_add_trace_bio_complete(void *ignore, |
739 | struct request_queue *q, struct bio *bio) | ||
733 | { | 740 | { |
734 | blk_add_trace_bio(q, bio, BLK_TA_COMPLETE); | 741 | blk_add_trace_bio(q, bio, BLK_TA_COMPLETE); |
735 | } | 742 | } |
736 | 743 | ||
737 | static void blk_add_trace_bio_backmerge(struct request_queue *q, | 744 | static void blk_add_trace_bio_backmerge(void *ignore, |
745 | struct request_queue *q, | ||
738 | struct bio *bio) | 746 | struct bio *bio) |
739 | { | 747 | { |
740 | blk_add_trace_bio(q, bio, BLK_TA_BACKMERGE); | 748 | blk_add_trace_bio(q, bio, BLK_TA_BACKMERGE); |
741 | } | 749 | } |
742 | 750 | ||
743 | static void blk_add_trace_bio_frontmerge(struct request_queue *q, | 751 | static void blk_add_trace_bio_frontmerge(void *ignore, |
752 | struct request_queue *q, | ||
744 | struct bio *bio) | 753 | struct bio *bio) |
745 | { | 754 | { |
746 | blk_add_trace_bio(q, bio, BLK_TA_FRONTMERGE); | 755 | blk_add_trace_bio(q, bio, BLK_TA_FRONTMERGE); |
747 | } | 756 | } |
748 | 757 | ||
749 | static void blk_add_trace_bio_queue(struct request_queue *q, struct bio *bio) | 758 | static void blk_add_trace_bio_queue(void *ignore, |
759 | struct request_queue *q, struct bio *bio) | ||
750 | { | 760 | { |
751 | blk_add_trace_bio(q, bio, BLK_TA_QUEUE); | 761 | blk_add_trace_bio(q, bio, BLK_TA_QUEUE); |
752 | } | 762 | } |
753 | 763 | ||
754 | static void blk_add_trace_getrq(struct request_queue *q, | 764 | static void blk_add_trace_getrq(void *ignore, |
765 | struct request_queue *q, | ||
755 | struct bio *bio, int rw) | 766 | struct bio *bio, int rw) |
756 | { | 767 | { |
757 | if (bio) | 768 | if (bio) |
@@ -765,7 +776,8 @@ static void blk_add_trace_getrq(struct request_queue *q, | |||
765 | } | 776 | } |
766 | 777 | ||
767 | 778 | ||
768 | static void blk_add_trace_sleeprq(struct request_queue *q, | 779 | static void blk_add_trace_sleeprq(void *ignore, |
780 | struct request_queue *q, | ||
769 | struct bio *bio, int rw) | 781 | struct bio *bio, int rw) |
770 | { | 782 | { |
771 | if (bio) | 783 | if (bio) |
@@ -779,7 +791,7 @@ static void blk_add_trace_sleeprq(struct request_queue *q, | |||
779 | } | 791 | } |
780 | } | 792 | } |
781 | 793 | ||
782 | static void blk_add_trace_plug(struct request_queue *q) | 794 | static void blk_add_trace_plug(void *ignore, struct request_queue *q) |
783 | { | 795 | { |
784 | struct blk_trace *bt = q->blk_trace; | 796 | struct blk_trace *bt = q->blk_trace; |
785 | 797 | ||
@@ -787,7 +799,7 @@ static void blk_add_trace_plug(struct request_queue *q) | |||
787 | __blk_add_trace(bt, 0, 0, 0, BLK_TA_PLUG, 0, 0, NULL); | 799 | __blk_add_trace(bt, 0, 0, 0, BLK_TA_PLUG, 0, 0, NULL); |
788 | } | 800 | } |
789 | 801 | ||
790 | static void blk_add_trace_unplug_io(struct request_queue *q) | 802 | static void blk_add_trace_unplug_io(void *ignore, struct request_queue *q) |
791 | { | 803 | { |
792 | struct blk_trace *bt = q->blk_trace; | 804 | struct blk_trace *bt = q->blk_trace; |
793 | 805 | ||
@@ -800,7 +812,7 @@ static void blk_add_trace_unplug_io(struct request_queue *q) | |||
800 | } | 812 | } |
801 | } | 813 | } |
802 | 814 | ||
803 | static void blk_add_trace_unplug_timer(struct request_queue *q) | 815 | static void blk_add_trace_unplug_timer(void *ignore, struct request_queue *q) |
804 | { | 816 | { |
805 | struct blk_trace *bt = q->blk_trace; | 817 | struct blk_trace *bt = q->blk_trace; |
806 | 818 | ||
@@ -813,7 +825,8 @@ static void blk_add_trace_unplug_timer(struct request_queue *q) | |||
813 | } | 825 | } |
814 | } | 826 | } |
815 | 827 | ||
816 | static void blk_add_trace_split(struct request_queue *q, struct bio *bio, | 828 | static void blk_add_trace_split(void *ignore, |
829 | struct request_queue *q, struct bio *bio, | ||
817 | unsigned int pdu) | 830 | unsigned int pdu) |
818 | { | 831 | { |
819 | struct blk_trace *bt = q->blk_trace; | 832 | struct blk_trace *bt = q->blk_trace; |
@@ -839,8 +852,9 @@ static void blk_add_trace_split(struct request_queue *q, struct bio *bio, | |||
839 | * it spans a stripe (or similar). Add a trace for that action. | 852 | * it spans a stripe (or similar). Add a trace for that action. |
840 | * | 853 | * |
841 | **/ | 854 | **/ |
842 | static void blk_add_trace_remap(struct request_queue *q, struct bio *bio, | 855 | static void blk_add_trace_remap(void *ignore, |
843 | dev_t dev, sector_t from) | 856 | struct request_queue *q, struct bio *bio, |
857 | dev_t dev, sector_t from) | ||
844 | { | 858 | { |
845 | struct blk_trace *bt = q->blk_trace; | 859 | struct blk_trace *bt = q->blk_trace; |
846 | struct blk_io_trace_remap r; | 860 | struct blk_io_trace_remap r; |
@@ -869,7 +883,8 @@ static void blk_add_trace_remap(struct request_queue *q, struct bio *bio, | |||
869 | * Add a trace for that action. | 883 | * Add a trace for that action. |
870 | * | 884 | * |
871 | **/ | 885 | **/ |
872 | static void blk_add_trace_rq_remap(struct request_queue *q, | 886 | static void blk_add_trace_rq_remap(void *ignore, |
887 | struct request_queue *q, | ||
873 | struct request *rq, dev_t dev, | 888 | struct request *rq, dev_t dev, |
874 | sector_t from) | 889 | sector_t from) |
875 | { | 890 | { |
@@ -921,64 +936,64 @@ static void blk_register_tracepoints(void) | |||
921 | { | 936 | { |
922 | int ret; | 937 | int ret; |
923 | 938 | ||
924 | ret = register_trace_block_rq_abort(blk_add_trace_rq_abort); | 939 | ret = register_trace_block_rq_abort(blk_add_trace_rq_abort, NULL); |
925 | WARN_ON(ret); | 940 | WARN_ON(ret); |
926 | ret = register_trace_block_rq_insert(blk_add_trace_rq_insert); | 941 | ret = register_trace_block_rq_insert(blk_add_trace_rq_insert, NULL); |
927 | WARN_ON(ret); | 942 | WARN_ON(ret); |
928 | ret = register_trace_block_rq_issue(blk_add_trace_rq_issue); | 943 | ret = register_trace_block_rq_issue(blk_add_trace_rq_issue, NULL); |
929 | WARN_ON(ret); | 944 | WARN_ON(ret); |
930 | ret = register_trace_block_rq_requeue(blk_add_trace_rq_requeue); | 945 | ret = register_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL); |
931 | WARN_ON(ret); | 946 | WARN_ON(ret); |
932 | ret = register_trace_block_rq_complete(blk_add_trace_rq_complete); | 947 | ret = register_trace_block_rq_complete(blk_add_trace_rq_complete, NULL); |
933 | WARN_ON(ret); | 948 | WARN_ON(ret); |
934 | ret = register_trace_block_bio_bounce(blk_add_trace_bio_bounce); | 949 | ret = register_trace_block_bio_bounce(blk_add_trace_bio_bounce, NULL); |
935 | WARN_ON(ret); | 950 | WARN_ON(ret); |
936 | ret = register_trace_block_bio_complete(blk_add_trace_bio_complete); | 951 | ret = register_trace_block_bio_complete(blk_add_trace_bio_complete, NULL); |
937 | WARN_ON(ret); | 952 | WARN_ON(ret); |
938 | ret = register_trace_block_bio_backmerge(blk_add_trace_bio_backmerge); | 953 | ret = register_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL); |
939 | WARN_ON(ret); | 954 | WARN_ON(ret); |
940 | ret = register_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge); | 955 | ret = register_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL); |
941 | WARN_ON(ret); | 956 | WARN_ON(ret); |
942 | ret = register_trace_block_bio_queue(blk_add_trace_bio_queue); | 957 | ret = register_trace_block_bio_queue(blk_add_trace_bio_queue, NULL); |
943 | WARN_ON(ret); | 958 | WARN_ON(ret); |
944 | ret = register_trace_block_getrq(blk_add_trace_getrq); | 959 | ret = register_trace_block_getrq(blk_add_trace_getrq, NULL); |
945 | WARN_ON(ret); | 960 | WARN_ON(ret); |
946 | ret = register_trace_block_sleeprq(blk_add_trace_sleeprq); | 961 | ret = register_trace_block_sleeprq(blk_add_trace_sleeprq, NULL); |
947 | WARN_ON(ret); | 962 | WARN_ON(ret); |
948 | ret = register_trace_block_plug(blk_add_trace_plug); | 963 | ret = register_trace_block_plug(blk_add_trace_plug, NULL); |
949 | WARN_ON(ret); | 964 | WARN_ON(ret); |
950 | ret = register_trace_block_unplug_timer(blk_add_trace_unplug_timer); | 965 | ret = register_trace_block_unplug_timer(blk_add_trace_unplug_timer, NULL); |
951 | WARN_ON(ret); | 966 | WARN_ON(ret); |
952 | ret = register_trace_block_unplug_io(blk_add_trace_unplug_io); | 967 | ret = register_trace_block_unplug_io(blk_add_trace_unplug_io, NULL); |
953 | WARN_ON(ret); | 968 | WARN_ON(ret); |
954 | ret = register_trace_block_split(blk_add_trace_split); | 969 | ret = register_trace_block_split(blk_add_trace_split, NULL); |
955 | WARN_ON(ret); | 970 | WARN_ON(ret); |
956 | ret = register_trace_block_remap(blk_add_trace_remap); | 971 | ret = register_trace_block_remap(blk_add_trace_remap, NULL); |
957 | WARN_ON(ret); | 972 | WARN_ON(ret); |
958 | ret = register_trace_block_rq_remap(blk_add_trace_rq_remap); | 973 | ret = register_trace_block_rq_remap(blk_add_trace_rq_remap, NULL); |
959 | WARN_ON(ret); | 974 | WARN_ON(ret); |
960 | } | 975 | } |
961 | 976 | ||
962 | static void blk_unregister_tracepoints(void) | 977 | static void blk_unregister_tracepoints(void) |
963 | { | 978 | { |
964 | unregister_trace_block_rq_remap(blk_add_trace_rq_remap); | 979 | unregister_trace_block_rq_remap(blk_add_trace_rq_remap, NULL); |
965 | unregister_trace_block_remap(blk_add_trace_remap); | 980 | unregister_trace_block_remap(blk_add_trace_remap, NULL); |
966 | unregister_trace_block_split(blk_add_trace_split); | 981 | unregister_trace_block_split(blk_add_trace_split, NULL); |
967 | unregister_trace_block_unplug_io(blk_add_trace_unplug_io); | 982 | unregister_trace_block_unplug_io(blk_add_trace_unplug_io, NULL); |
968 | unregister_trace_block_unplug_timer(blk_add_trace_unplug_timer); | 983 | unregister_trace_block_unplug_timer(blk_add_trace_unplug_timer, NULL); |
969 | unregister_trace_block_plug(blk_add_trace_plug); | 984 | unregister_trace_block_plug(blk_add_trace_plug, NULL); |
970 | unregister_trace_block_sleeprq(blk_add_trace_sleeprq); | 985 | unregister_trace_block_sleeprq(blk_add_trace_sleeprq, NULL); |
971 | unregister_trace_block_getrq(blk_add_trace_getrq); | 986 | unregister_trace_block_getrq(blk_add_trace_getrq, NULL); |
972 | unregister_trace_block_bio_queue(blk_add_trace_bio_queue); | 987 | unregister_trace_block_bio_queue(blk_add_trace_bio_queue, NULL); |
973 | unregister_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge); | 988 | unregister_trace_block_bio_frontmerge(blk_add_trace_bio_frontmerge, NULL); |
974 | unregister_trace_block_bio_backmerge(blk_add_trace_bio_backmerge); | 989 | unregister_trace_block_bio_backmerge(blk_add_trace_bio_backmerge, NULL); |
975 | unregister_trace_block_bio_complete(blk_add_trace_bio_complete); | 990 | unregister_trace_block_bio_complete(blk_add_trace_bio_complete, NULL); |
976 | unregister_trace_block_bio_bounce(blk_add_trace_bio_bounce); | 991 | unregister_trace_block_bio_bounce(blk_add_trace_bio_bounce, NULL); |
977 | unregister_trace_block_rq_complete(blk_add_trace_rq_complete); | 992 | unregister_trace_block_rq_complete(blk_add_trace_rq_complete, NULL); |
978 | unregister_trace_block_rq_requeue(blk_add_trace_rq_requeue); | 993 | unregister_trace_block_rq_requeue(blk_add_trace_rq_requeue, NULL); |
979 | unregister_trace_block_rq_issue(blk_add_trace_rq_issue); | 994 | unregister_trace_block_rq_issue(blk_add_trace_rq_issue, NULL); |
980 | unregister_trace_block_rq_insert(blk_add_trace_rq_insert); | 995 | unregister_trace_block_rq_insert(blk_add_trace_rq_insert, NULL); |
981 | unregister_trace_block_rq_abort(blk_add_trace_rq_abort); | 996 | unregister_trace_block_rq_abort(blk_add_trace_rq_abort, NULL); |
982 | 997 | ||
983 | tracepoint_synchronize_unregister(); | 998 | tracepoint_synchronize_unregister(); |
984 | } | 999 | } |
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 32837e19e3bd..6d2cb14f9449 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -3234,7 +3234,8 @@ free: | |||
3234 | } | 3234 | } |
3235 | 3235 | ||
3236 | static void | 3236 | static void |
3237 | ftrace_graph_probe_sched_switch(struct task_struct *prev, struct task_struct *next) | 3237 | ftrace_graph_probe_sched_switch(void *ignore, |
3238 | struct task_struct *prev, struct task_struct *next) | ||
3238 | { | 3239 | { |
3239 | unsigned long long timestamp; | 3240 | unsigned long long timestamp; |
3240 | int index; | 3241 | int index; |
@@ -3288,7 +3289,7 @@ static int start_graph_tracing(void) | |||
3288 | } while (ret == -EAGAIN); | 3289 | } while (ret == -EAGAIN); |
3289 | 3290 | ||
3290 | if (!ret) { | 3291 | if (!ret) { |
3291 | ret = register_trace_sched_switch(ftrace_graph_probe_sched_switch); | 3292 | ret = register_trace_sched_switch(ftrace_graph_probe_sched_switch, NULL); |
3292 | if (ret) | 3293 | if (ret) |
3293 | pr_info("ftrace_graph: Couldn't activate tracepoint" | 3294 | pr_info("ftrace_graph: Couldn't activate tracepoint" |
3294 | " probe to kernel_sched_switch\n"); | 3295 | " probe to kernel_sched_switch\n"); |
@@ -3364,7 +3365,7 @@ void unregister_ftrace_graph(void) | |||
3364 | ftrace_graph_entry = ftrace_graph_entry_stub; | 3365 | ftrace_graph_entry = ftrace_graph_entry_stub; |
3365 | ftrace_shutdown(FTRACE_STOP_FUNC_RET); | 3366 | ftrace_shutdown(FTRACE_STOP_FUNC_RET); |
3366 | unregister_pm_notifier(&ftrace_suspend_notifier); | 3367 | unregister_pm_notifier(&ftrace_suspend_notifier); |
3367 | unregister_trace_sched_switch(ftrace_graph_probe_sched_switch); | 3368 | unregister_trace_sched_switch(ftrace_graph_probe_sched_switch, NULL); |
3368 | 3369 | ||
3369 | out: | 3370 | out: |
3370 | mutex_unlock(&ftrace_lock); | 3371 | mutex_unlock(&ftrace_lock); |
diff --git a/kernel/trace/kmemtrace.c b/kernel/trace/kmemtrace.c index a91da69f153a..7253d0c1c32f 100644 --- a/kernel/trace/kmemtrace.c +++ b/kernel/trace/kmemtrace.c | |||
@@ -95,7 +95,8 @@ static inline void kmemtrace_free(enum kmemtrace_type_id type_id, | |||
95 | trace_wake_up(); | 95 | trace_wake_up(); |
96 | } | 96 | } |
97 | 97 | ||
98 | static void kmemtrace_kmalloc(unsigned long call_site, | 98 | static void kmemtrace_kmalloc(void *ignore, |
99 | unsigned long call_site, | ||
99 | const void *ptr, | 100 | const void *ptr, |
100 | size_t bytes_req, | 101 | size_t bytes_req, |
101 | size_t bytes_alloc, | 102 | size_t bytes_alloc, |
@@ -105,7 +106,8 @@ static void kmemtrace_kmalloc(unsigned long call_site, | |||
105 | bytes_req, bytes_alloc, gfp_flags, -1); | 106 | bytes_req, bytes_alloc, gfp_flags, -1); |
106 | } | 107 | } |
107 | 108 | ||
108 | static void kmemtrace_kmem_cache_alloc(unsigned long call_site, | 109 | static void kmemtrace_kmem_cache_alloc(void *ignore, |
110 | unsigned long call_site, | ||
109 | const void *ptr, | 111 | const void *ptr, |
110 | size_t bytes_req, | 112 | size_t bytes_req, |
111 | size_t bytes_alloc, | 113 | size_t bytes_alloc, |
@@ -115,7 +117,8 @@ static void kmemtrace_kmem_cache_alloc(unsigned long call_site, | |||
115 | bytes_req, bytes_alloc, gfp_flags, -1); | 117 | bytes_req, bytes_alloc, gfp_flags, -1); |
116 | } | 118 | } |
117 | 119 | ||
118 | static void kmemtrace_kmalloc_node(unsigned long call_site, | 120 | static void kmemtrace_kmalloc_node(void *ignore, |
121 | unsigned long call_site, | ||
119 | const void *ptr, | 122 | const void *ptr, |
120 | size_t bytes_req, | 123 | size_t bytes_req, |
121 | size_t bytes_alloc, | 124 | size_t bytes_alloc, |
@@ -126,7 +129,8 @@ static void kmemtrace_kmalloc_node(unsigned long call_site, | |||
126 | bytes_req, bytes_alloc, gfp_flags, node); | 129 | bytes_req, bytes_alloc, gfp_flags, node); |
127 | } | 130 | } |
128 | 131 | ||
129 | static void kmemtrace_kmem_cache_alloc_node(unsigned long call_site, | 132 | static void kmemtrace_kmem_cache_alloc_node(void *ignore, |
133 | unsigned long call_site, | ||
130 | const void *ptr, | 134 | const void *ptr, |
131 | size_t bytes_req, | 135 | size_t bytes_req, |
132 | size_t bytes_alloc, | 136 | size_t bytes_alloc, |
@@ -137,12 +141,14 @@ static void kmemtrace_kmem_cache_alloc_node(unsigned long call_site, | |||
137 | bytes_req, bytes_alloc, gfp_flags, node); | 141 | bytes_req, bytes_alloc, gfp_flags, node); |
138 | } | 142 | } |
139 | 143 | ||
140 | static void kmemtrace_kfree(unsigned long call_site, const void *ptr) | 144 | static void |
145 | kmemtrace_kfree(void *ignore, unsigned long call_site, const void *ptr) | ||
141 | { | 146 | { |
142 | kmemtrace_free(KMEMTRACE_TYPE_KMALLOC, call_site, ptr); | 147 | kmemtrace_free(KMEMTRACE_TYPE_KMALLOC, call_site, ptr); |
143 | } | 148 | } |
144 | 149 | ||
145 | static void kmemtrace_kmem_cache_free(unsigned long call_site, const void *ptr) | 150 | static void kmemtrace_kmem_cache_free(void *ignore, |
151 | unsigned long call_site, const void *ptr) | ||
146 | { | 152 | { |
147 | kmemtrace_free(KMEMTRACE_TYPE_CACHE, call_site, ptr); | 153 | kmemtrace_free(KMEMTRACE_TYPE_CACHE, call_site, ptr); |
148 | } | 154 | } |
@@ -151,34 +157,34 @@ static int kmemtrace_start_probes(void) | |||
151 | { | 157 | { |
152 | int err; | 158 | int err; |
153 | 159 | ||
154 | err = register_trace_kmalloc(kmemtrace_kmalloc); | 160 | err = register_trace_kmalloc(kmemtrace_kmalloc, NULL); |
155 | if (err) | 161 | if (err) |
156 | return err; | 162 | return err; |
157 | err = register_trace_kmem_cache_alloc(kmemtrace_kmem_cache_alloc); | 163 | err = register_trace_kmem_cache_alloc(kmemtrace_kmem_cache_alloc, NULL); |
158 | if (err) | 164 | if (err) |
159 | return err; | 165 | return err; |
160 | err = register_trace_kmalloc_node(kmemtrace_kmalloc_node); | 166 | err = register_trace_kmalloc_node(kmemtrace_kmalloc_node, NULL); |
161 | if (err) | 167 | if (err) |
162 | return err; | 168 | return err; |
163 | err = register_trace_kmem_cache_alloc_node(kmemtrace_kmem_cache_alloc_node); | 169 | err = register_trace_kmem_cache_alloc_node(kmemtrace_kmem_cache_alloc_node, NULL); |
164 | if (err) | 170 | if (err) |
165 | return err; | 171 | return err; |
166 | err = register_trace_kfree(kmemtrace_kfree); | 172 | err = register_trace_kfree(kmemtrace_kfree, NULL); |
167 | if (err) | 173 | if (err) |
168 | return err; | 174 | return err; |
169 | err = register_trace_kmem_cache_free(kmemtrace_kmem_cache_free); | 175 | err = register_trace_kmem_cache_free(kmemtrace_kmem_cache_free, NULL); |
170 | 176 | ||
171 | return err; | 177 | return err; |
172 | } | 178 | } |
173 | 179 | ||
174 | static void kmemtrace_stop_probes(void) | 180 | static void kmemtrace_stop_probes(void) |
175 | { | 181 | { |
176 | unregister_trace_kmalloc(kmemtrace_kmalloc); | 182 | unregister_trace_kmalloc(kmemtrace_kmalloc, NULL); |
177 | unregister_trace_kmem_cache_alloc(kmemtrace_kmem_cache_alloc); | 183 | unregister_trace_kmem_cache_alloc(kmemtrace_kmem_cache_alloc, NULL); |
178 | unregister_trace_kmalloc_node(kmemtrace_kmalloc_node); | 184 | unregister_trace_kmalloc_node(kmemtrace_kmalloc_node, NULL); |
179 | unregister_trace_kmem_cache_alloc_node(kmemtrace_kmem_cache_alloc_node); | 185 | unregister_trace_kmem_cache_alloc_node(kmemtrace_kmem_cache_alloc_node, NULL); |
180 | unregister_trace_kfree(kmemtrace_kfree); | 186 | unregister_trace_kfree(kmemtrace_kfree, NULL); |
181 | unregister_trace_kmem_cache_free(kmemtrace_kmem_cache_free); | 187 | unregister_trace_kmem_cache_free(kmemtrace_kmem_cache_free, NULL); |
182 | } | 188 | } |
183 | 189 | ||
184 | static int kmem_trace_init(struct trace_array *tr) | 190 | static int kmem_trace_init(struct trace_array *tr) |
diff --git a/kernel/trace/trace_sched_switch.c b/kernel/trace/trace_sched_switch.c index a55fccfede5d..8f758d070c43 100644 --- a/kernel/trace/trace_sched_switch.c +++ b/kernel/trace/trace_sched_switch.c | |||
@@ -50,7 +50,7 @@ tracing_sched_switch_trace(struct trace_array *tr, | |||
50 | } | 50 | } |
51 | 51 | ||
52 | static void | 52 | static void |
53 | probe_sched_switch(struct task_struct *prev, struct task_struct *next) | 53 | probe_sched_switch(void *ignore, struct task_struct *prev, struct task_struct *next) |
54 | { | 54 | { |
55 | struct trace_array_cpu *data; | 55 | struct trace_array_cpu *data; |
56 | unsigned long flags; | 56 | unsigned long flags; |
@@ -108,7 +108,7 @@ tracing_sched_wakeup_trace(struct trace_array *tr, | |||
108 | } | 108 | } |
109 | 109 | ||
110 | static void | 110 | static void |
111 | probe_sched_wakeup(struct task_struct *wakee, int success) | 111 | probe_sched_wakeup(void *ignore, struct task_struct *wakee, int success) |
112 | { | 112 | { |
113 | struct trace_array_cpu *data; | 113 | struct trace_array_cpu *data; |
114 | unsigned long flags; | 114 | unsigned long flags; |
@@ -138,21 +138,21 @@ static int tracing_sched_register(void) | |||
138 | { | 138 | { |
139 | int ret; | 139 | int ret; |
140 | 140 | ||
141 | ret = register_trace_sched_wakeup(probe_sched_wakeup); | 141 | ret = register_trace_sched_wakeup(probe_sched_wakeup, NULL); |
142 | if (ret) { | 142 | if (ret) { |
143 | pr_info("wakeup trace: Couldn't activate tracepoint" | 143 | pr_info("wakeup trace: Couldn't activate tracepoint" |
144 | " probe to kernel_sched_wakeup\n"); | 144 | " probe to kernel_sched_wakeup\n"); |
145 | return ret; | 145 | return ret; |
146 | } | 146 | } |
147 | 147 | ||
148 | ret = register_trace_sched_wakeup_new(probe_sched_wakeup); | 148 | ret = register_trace_sched_wakeup_new(probe_sched_wakeup, NULL); |
149 | if (ret) { | 149 | if (ret) { |
150 | pr_info("wakeup trace: Couldn't activate tracepoint" | 150 | pr_info("wakeup trace: Couldn't activate tracepoint" |
151 | " probe to kernel_sched_wakeup_new\n"); | 151 | " probe to kernel_sched_wakeup_new\n"); |
152 | goto fail_deprobe; | 152 | goto fail_deprobe; |
153 | } | 153 | } |
154 | 154 | ||
155 | ret = register_trace_sched_switch(probe_sched_switch); | 155 | ret = register_trace_sched_switch(probe_sched_switch, NULL); |
156 | if (ret) { | 156 | if (ret) { |
157 | pr_info("sched trace: Couldn't activate tracepoint" | 157 | pr_info("sched trace: Couldn't activate tracepoint" |
158 | " probe to kernel_sched_switch\n"); | 158 | " probe to kernel_sched_switch\n"); |
@@ -161,17 +161,17 @@ static int tracing_sched_register(void) | |||
161 | 161 | ||
162 | return ret; | 162 | return ret; |
163 | fail_deprobe_wake_new: | 163 | fail_deprobe_wake_new: |
164 | unregister_trace_sched_wakeup_new(probe_sched_wakeup); | 164 | unregister_trace_sched_wakeup_new(probe_sched_wakeup, NULL); |
165 | fail_deprobe: | 165 | fail_deprobe: |
166 | unregister_trace_sched_wakeup(probe_sched_wakeup); | 166 | unregister_trace_sched_wakeup(probe_sched_wakeup, NULL); |
167 | return ret; | 167 | return ret; |
168 | } | 168 | } |
169 | 169 | ||
170 | static void tracing_sched_unregister(void) | 170 | static void tracing_sched_unregister(void) |
171 | { | 171 | { |
172 | unregister_trace_sched_switch(probe_sched_switch); | 172 | unregister_trace_sched_switch(probe_sched_switch, NULL); |
173 | unregister_trace_sched_wakeup_new(probe_sched_wakeup); | 173 | unregister_trace_sched_wakeup_new(probe_sched_wakeup, NULL); |
174 | unregister_trace_sched_wakeup(probe_sched_wakeup); | 174 | unregister_trace_sched_wakeup(probe_sched_wakeup, NULL); |
175 | } | 175 | } |
176 | 176 | ||
177 | static void tracing_start_sched_switch(void) | 177 | static void tracing_start_sched_switch(void) |
diff --git a/kernel/trace/trace_sched_wakeup.c b/kernel/trace/trace_sched_wakeup.c index 8052446ceeaa..0e73bc2ef8c5 100644 --- a/kernel/trace/trace_sched_wakeup.c +++ b/kernel/trace/trace_sched_wakeup.c | |||
@@ -98,7 +98,8 @@ static int report_latency(cycle_t delta) | |||
98 | return 1; | 98 | return 1; |
99 | } | 99 | } |
100 | 100 | ||
101 | static void probe_wakeup_migrate_task(struct task_struct *task, int cpu) | 101 | static void |
102 | probe_wakeup_migrate_task(void *ignore, struct task_struct *task, int cpu) | ||
102 | { | 103 | { |
103 | if (task != wakeup_task) | 104 | if (task != wakeup_task) |
104 | return; | 105 | return; |
@@ -107,7 +108,8 @@ static void probe_wakeup_migrate_task(struct task_struct *task, int cpu) | |||
107 | } | 108 | } |
108 | 109 | ||
109 | static void notrace | 110 | static void notrace |
110 | probe_wakeup_sched_switch(struct task_struct *prev, struct task_struct *next) | 111 | probe_wakeup_sched_switch(void *ignore, |
112 | struct task_struct *prev, struct task_struct *next) | ||
111 | { | 113 | { |
112 | struct trace_array_cpu *data; | 114 | struct trace_array_cpu *data; |
113 | cycle_t T0, T1, delta; | 115 | cycle_t T0, T1, delta; |
@@ -199,7 +201,7 @@ static void wakeup_reset(struct trace_array *tr) | |||
199 | } | 201 | } |
200 | 202 | ||
201 | static void | 203 | static void |
202 | probe_wakeup(struct task_struct *p, int success) | 204 | probe_wakeup(void *ignore, struct task_struct *p, int success) |
203 | { | 205 | { |
204 | struct trace_array_cpu *data; | 206 | struct trace_array_cpu *data; |
205 | int cpu = smp_processor_id(); | 207 | int cpu = smp_processor_id(); |
@@ -263,28 +265,28 @@ static void start_wakeup_tracer(struct trace_array *tr) | |||
263 | { | 265 | { |
264 | int ret; | 266 | int ret; |
265 | 267 | ||
266 | ret = register_trace_sched_wakeup(probe_wakeup); | 268 | ret = register_trace_sched_wakeup(probe_wakeup, NULL); |
267 | if (ret) { | 269 | if (ret) { |
268 | pr_info("wakeup trace: Couldn't activate tracepoint" | 270 | pr_info("wakeup trace: Couldn't activate tracepoint" |
269 | " probe to kernel_sched_wakeup\n"); | 271 | " probe to kernel_sched_wakeup\n"); |
270 | return; | 272 | return; |
271 | } | 273 | } |
272 | 274 | ||
273 | ret = register_trace_sched_wakeup_new(probe_wakeup); | 275 | ret = register_trace_sched_wakeup_new(probe_wakeup, NULL); |
274 | if (ret) { | 276 | if (ret) { |
275 | pr_info("wakeup trace: Couldn't activate tracepoint" | 277 | pr_info("wakeup trace: Couldn't activate tracepoint" |
276 | " probe to kernel_sched_wakeup_new\n"); | 278 | " probe to kernel_sched_wakeup_new\n"); |
277 | goto fail_deprobe; | 279 | goto fail_deprobe; |
278 | } | 280 | } |
279 | 281 | ||
280 | ret = register_trace_sched_switch(probe_wakeup_sched_switch); | 282 | ret = register_trace_sched_switch(probe_wakeup_sched_switch, NULL); |
281 | if (ret) { | 283 | if (ret) { |
282 | pr_info("sched trace: Couldn't activate tracepoint" | 284 | pr_info("sched trace: Couldn't activate tracepoint" |
283 | " probe to kernel_sched_switch\n"); | 285 | " probe to kernel_sched_switch\n"); |
284 | goto fail_deprobe_wake_new; | 286 | goto fail_deprobe_wake_new; |
285 | } | 287 | } |
286 | 288 | ||
287 | ret = register_trace_sched_migrate_task(probe_wakeup_migrate_task); | 289 | ret = register_trace_sched_migrate_task(probe_wakeup_migrate_task, NULL); |
288 | if (ret) { | 290 | if (ret) { |
289 | pr_info("wakeup trace: Couldn't activate tracepoint" | 291 | pr_info("wakeup trace: Couldn't activate tracepoint" |
290 | " probe to kernel_sched_migrate_task\n"); | 292 | " probe to kernel_sched_migrate_task\n"); |
@@ -311,19 +313,19 @@ static void start_wakeup_tracer(struct trace_array *tr) | |||
311 | 313 | ||
312 | return; | 314 | return; |
313 | fail_deprobe_wake_new: | 315 | fail_deprobe_wake_new: |
314 | unregister_trace_sched_wakeup_new(probe_wakeup); | 316 | unregister_trace_sched_wakeup_new(probe_wakeup, NULL); |
315 | fail_deprobe: | 317 | fail_deprobe: |
316 | unregister_trace_sched_wakeup(probe_wakeup); | 318 | unregister_trace_sched_wakeup(probe_wakeup, NULL); |
317 | } | 319 | } |
318 | 320 | ||
319 | static void stop_wakeup_tracer(struct trace_array *tr) | 321 | static void stop_wakeup_tracer(struct trace_array *tr) |
320 | { | 322 | { |
321 | tracer_enabled = 0; | 323 | tracer_enabled = 0; |
322 | unregister_ftrace_function(&trace_ops); | 324 | unregister_ftrace_function(&trace_ops); |
323 | unregister_trace_sched_switch(probe_wakeup_sched_switch); | 325 | unregister_trace_sched_switch(probe_wakeup_sched_switch, NULL); |
324 | unregister_trace_sched_wakeup_new(probe_wakeup); | 326 | unregister_trace_sched_wakeup_new(probe_wakeup, NULL); |
325 | unregister_trace_sched_wakeup(probe_wakeup); | 327 | unregister_trace_sched_wakeup(probe_wakeup, NULL); |
326 | unregister_trace_sched_migrate_task(probe_wakeup_migrate_task); | 328 | unregister_trace_sched_migrate_task(probe_wakeup_migrate_task, NULL); |
327 | } | 329 | } |
328 | 330 | ||
329 | static int __wakeup_tracer_init(struct trace_array *tr) | 331 | static int __wakeup_tracer_init(struct trace_array *tr) |
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c index d036a74a64f3..b8d30e7ecd05 100644 --- a/kernel/trace/trace_syscalls.c +++ b/kernel/trace/trace_syscalls.c | |||
@@ -247,7 +247,7 @@ int syscall_exit_define_fields(struct ftrace_event_call *call) | |||
247 | return ret; | 247 | return ret; |
248 | } | 248 | } |
249 | 249 | ||
250 | void ftrace_syscall_enter(struct pt_regs *regs, long id) | 250 | void ftrace_syscall_enter(void *ignore, struct pt_regs *regs, long id) |
251 | { | 251 | { |
252 | struct syscall_trace_enter *entry; | 252 | struct syscall_trace_enter *entry; |
253 | struct syscall_metadata *sys_data; | 253 | struct syscall_metadata *sys_data; |
@@ -282,7 +282,7 @@ void ftrace_syscall_enter(struct pt_regs *regs, long id) | |||
282 | trace_current_buffer_unlock_commit(buffer, event, 0, 0); | 282 | trace_current_buffer_unlock_commit(buffer, event, 0, 0); |
283 | } | 283 | } |
284 | 284 | ||
285 | void ftrace_syscall_exit(struct pt_regs *regs, long ret) | 285 | void ftrace_syscall_exit(void *ignore, struct pt_regs *regs, long ret) |
286 | { | 286 | { |
287 | struct syscall_trace_exit *entry; | 287 | struct syscall_trace_exit *entry; |
288 | struct syscall_metadata *sys_data; | 288 | struct syscall_metadata *sys_data; |
@@ -324,7 +324,7 @@ int reg_event_syscall_enter(struct ftrace_event_call *call) | |||
324 | return -ENOSYS; | 324 | return -ENOSYS; |
325 | mutex_lock(&syscall_trace_lock); | 325 | mutex_lock(&syscall_trace_lock); |
326 | if (!sys_refcount_enter) | 326 | if (!sys_refcount_enter) |
327 | ret = register_trace_sys_enter(ftrace_syscall_enter); | 327 | ret = register_trace_sys_enter(ftrace_syscall_enter, NULL); |
328 | if (!ret) { | 328 | if (!ret) { |
329 | set_bit(num, enabled_enter_syscalls); | 329 | set_bit(num, enabled_enter_syscalls); |
330 | sys_refcount_enter++; | 330 | sys_refcount_enter++; |
@@ -344,7 +344,7 @@ void unreg_event_syscall_enter(struct ftrace_event_call *call) | |||
344 | sys_refcount_enter--; | 344 | sys_refcount_enter--; |
345 | clear_bit(num, enabled_enter_syscalls); | 345 | clear_bit(num, enabled_enter_syscalls); |
346 | if (!sys_refcount_enter) | 346 | if (!sys_refcount_enter) |
347 | unregister_trace_sys_enter(ftrace_syscall_enter); | 347 | unregister_trace_sys_enter(ftrace_syscall_enter, NULL); |
348 | mutex_unlock(&syscall_trace_lock); | 348 | mutex_unlock(&syscall_trace_lock); |
349 | } | 349 | } |
350 | 350 | ||
@@ -358,7 +358,7 @@ int reg_event_syscall_exit(struct ftrace_event_call *call) | |||
358 | return -ENOSYS; | 358 | return -ENOSYS; |
359 | mutex_lock(&syscall_trace_lock); | 359 | mutex_lock(&syscall_trace_lock); |
360 | if (!sys_refcount_exit) | 360 | if (!sys_refcount_exit) |
361 | ret = register_trace_sys_exit(ftrace_syscall_exit); | 361 | ret = register_trace_sys_exit(ftrace_syscall_exit, NULL); |
362 | if (!ret) { | 362 | if (!ret) { |
363 | set_bit(num, enabled_exit_syscalls); | 363 | set_bit(num, enabled_exit_syscalls); |
364 | sys_refcount_exit++; | 364 | sys_refcount_exit++; |
@@ -378,7 +378,7 @@ void unreg_event_syscall_exit(struct ftrace_event_call *call) | |||
378 | sys_refcount_exit--; | 378 | sys_refcount_exit--; |
379 | clear_bit(num, enabled_exit_syscalls); | 379 | clear_bit(num, enabled_exit_syscalls); |
380 | if (!sys_refcount_exit) | 380 | if (!sys_refcount_exit) |
381 | unregister_trace_sys_exit(ftrace_syscall_exit); | 381 | unregister_trace_sys_exit(ftrace_syscall_exit, NULL); |
382 | mutex_unlock(&syscall_trace_lock); | 382 | mutex_unlock(&syscall_trace_lock); |
383 | } | 383 | } |
384 | 384 | ||
@@ -438,7 +438,7 @@ static DECLARE_BITMAP(enabled_perf_exit_syscalls, NR_syscalls); | |||
438 | static int sys_perf_refcount_enter; | 438 | static int sys_perf_refcount_enter; |
439 | static int sys_perf_refcount_exit; | 439 | static int sys_perf_refcount_exit; |
440 | 440 | ||
441 | static void perf_syscall_enter(struct pt_regs *regs, long id) | 441 | static void perf_syscall_enter(void *ignore, struct pt_regs *regs, long id) |
442 | { | 442 | { |
443 | struct syscall_metadata *sys_data; | 443 | struct syscall_metadata *sys_data; |
444 | struct syscall_trace_enter *rec; | 444 | struct syscall_trace_enter *rec; |
@@ -484,7 +484,7 @@ int perf_sysenter_enable(struct ftrace_event_call *call) | |||
484 | 484 | ||
485 | mutex_lock(&syscall_trace_lock); | 485 | mutex_lock(&syscall_trace_lock); |
486 | if (!sys_perf_refcount_enter) | 486 | if (!sys_perf_refcount_enter) |
487 | ret = register_trace_sys_enter(perf_syscall_enter); | 487 | ret = register_trace_sys_enter(perf_syscall_enter, NULL); |
488 | if (ret) { | 488 | if (ret) { |
489 | pr_info("event trace: Could not activate" | 489 | pr_info("event trace: Could not activate" |
490 | "syscall entry trace point"); | 490 | "syscall entry trace point"); |
@@ -506,11 +506,11 @@ void perf_sysenter_disable(struct ftrace_event_call *call) | |||
506 | sys_perf_refcount_enter--; | 506 | sys_perf_refcount_enter--; |
507 | clear_bit(num, enabled_perf_enter_syscalls); | 507 | clear_bit(num, enabled_perf_enter_syscalls); |
508 | if (!sys_perf_refcount_enter) | 508 | if (!sys_perf_refcount_enter) |
509 | unregister_trace_sys_enter(perf_syscall_enter); | 509 | unregister_trace_sys_enter(perf_syscall_enter, NULL); |
510 | mutex_unlock(&syscall_trace_lock); | 510 | mutex_unlock(&syscall_trace_lock); |
511 | } | 511 | } |
512 | 512 | ||
513 | static void perf_syscall_exit(struct pt_regs *regs, long ret) | 513 | static void perf_syscall_exit(void *ignore, struct pt_regs *regs, long ret) |
514 | { | 514 | { |
515 | struct syscall_metadata *sys_data; | 515 | struct syscall_metadata *sys_data; |
516 | struct syscall_trace_exit *rec; | 516 | struct syscall_trace_exit *rec; |
@@ -559,7 +559,7 @@ int perf_sysexit_enable(struct ftrace_event_call *call) | |||
559 | 559 | ||
560 | mutex_lock(&syscall_trace_lock); | 560 | mutex_lock(&syscall_trace_lock); |
561 | if (!sys_perf_refcount_exit) | 561 | if (!sys_perf_refcount_exit) |
562 | ret = register_trace_sys_exit(perf_syscall_exit); | 562 | ret = register_trace_sys_exit(perf_syscall_exit, NULL); |
563 | if (ret) { | 563 | if (ret) { |
564 | pr_info("event trace: Could not activate" | 564 | pr_info("event trace: Could not activate" |
565 | "syscall exit trace point"); | 565 | "syscall exit trace point"); |
@@ -581,7 +581,7 @@ void perf_sysexit_disable(struct ftrace_event_call *call) | |||
581 | sys_perf_refcount_exit--; | 581 | sys_perf_refcount_exit--; |
582 | clear_bit(num, enabled_perf_exit_syscalls); | 582 | clear_bit(num, enabled_perf_exit_syscalls); |
583 | if (!sys_perf_refcount_exit) | 583 | if (!sys_perf_refcount_exit) |
584 | unregister_trace_sys_exit(perf_syscall_exit); | 584 | unregister_trace_sys_exit(perf_syscall_exit, NULL); |
585 | mutex_unlock(&syscall_trace_lock); | 585 | mutex_unlock(&syscall_trace_lock); |
586 | } | 586 | } |
587 | 587 | ||
diff --git a/kernel/trace/trace_workqueue.c b/kernel/trace/trace_workqueue.c index cc2d2faa7d9e..a7cc3793baf6 100644 --- a/kernel/trace/trace_workqueue.c +++ b/kernel/trace/trace_workqueue.c | |||
@@ -49,7 +49,8 @@ static void cpu_workqueue_stat_free(struct kref *kref) | |||
49 | 49 | ||
50 | /* Insertion of a work */ | 50 | /* Insertion of a work */ |
51 | static void | 51 | static void |
52 | probe_workqueue_insertion(struct task_struct *wq_thread, | 52 | probe_workqueue_insertion(void *ignore, |
53 | struct task_struct *wq_thread, | ||
53 | struct work_struct *work) | 54 | struct work_struct *work) |
54 | { | 55 | { |
55 | int cpu = cpumask_first(&wq_thread->cpus_allowed); | 56 | int cpu = cpumask_first(&wq_thread->cpus_allowed); |
@@ -70,7 +71,8 @@ found: | |||
70 | 71 | ||
71 | /* Execution of a work */ | 72 | /* Execution of a work */ |
72 | static void | 73 | static void |
73 | probe_workqueue_execution(struct task_struct *wq_thread, | 74 | probe_workqueue_execution(void *ignore, |
75 | struct task_struct *wq_thread, | ||
74 | struct work_struct *work) | 76 | struct work_struct *work) |
75 | { | 77 | { |
76 | int cpu = cpumask_first(&wq_thread->cpus_allowed); | 78 | int cpu = cpumask_first(&wq_thread->cpus_allowed); |
@@ -90,7 +92,8 @@ found: | |||
90 | } | 92 | } |
91 | 93 | ||
92 | /* Creation of a cpu workqueue thread */ | 94 | /* Creation of a cpu workqueue thread */ |
93 | static void probe_workqueue_creation(struct task_struct *wq_thread, int cpu) | 95 | static void probe_workqueue_creation(void *ignore, |
96 | struct task_struct *wq_thread, int cpu) | ||
94 | { | 97 | { |
95 | struct cpu_workqueue_stats *cws; | 98 | struct cpu_workqueue_stats *cws; |
96 | unsigned long flags; | 99 | unsigned long flags; |
@@ -114,7 +117,8 @@ static void probe_workqueue_creation(struct task_struct *wq_thread, int cpu) | |||
114 | } | 117 | } |
115 | 118 | ||
116 | /* Destruction of a cpu workqueue thread */ | 119 | /* Destruction of a cpu workqueue thread */ |
117 | static void probe_workqueue_destruction(struct task_struct *wq_thread) | 120 | static void |
121 | probe_workqueue_destruction(void *ignore, struct task_struct *wq_thread) | ||
118 | { | 122 | { |
119 | /* Workqueue only execute on one cpu */ | 123 | /* Workqueue only execute on one cpu */ |
120 | int cpu = cpumask_first(&wq_thread->cpus_allowed); | 124 | int cpu = cpumask_first(&wq_thread->cpus_allowed); |
@@ -259,19 +263,19 @@ int __init trace_workqueue_early_init(void) | |||
259 | { | 263 | { |
260 | int ret, cpu; | 264 | int ret, cpu; |
261 | 265 | ||
262 | ret = register_trace_workqueue_insertion(probe_workqueue_insertion); | 266 | ret = register_trace_workqueue_insertion(probe_workqueue_insertion, NULL); |
263 | if (ret) | 267 | if (ret) |
264 | goto out; | 268 | goto out; |
265 | 269 | ||
266 | ret = register_trace_workqueue_execution(probe_workqueue_execution); | 270 | ret = register_trace_workqueue_execution(probe_workqueue_execution, NULL); |
267 | if (ret) | 271 | if (ret) |
268 | goto no_insertion; | 272 | goto no_insertion; |
269 | 273 | ||
270 | ret = register_trace_workqueue_creation(probe_workqueue_creation); | 274 | ret = register_trace_workqueue_creation(probe_workqueue_creation, NULL); |
271 | if (ret) | 275 | if (ret) |
272 | goto no_execution; | 276 | goto no_execution; |
273 | 277 | ||
274 | ret = register_trace_workqueue_destruction(probe_workqueue_destruction); | 278 | ret = register_trace_workqueue_destruction(probe_workqueue_destruction, NULL); |
275 | if (ret) | 279 | if (ret) |
276 | goto no_creation; | 280 | goto no_creation; |
277 | 281 | ||
@@ -283,11 +287,11 @@ int __init trace_workqueue_early_init(void) | |||
283 | return 0; | 287 | return 0; |
284 | 288 | ||
285 | no_creation: | 289 | no_creation: |
286 | unregister_trace_workqueue_creation(probe_workqueue_creation); | 290 | unregister_trace_workqueue_creation(probe_workqueue_creation, NULL); |
287 | no_execution: | 291 | no_execution: |
288 | unregister_trace_workqueue_execution(probe_workqueue_execution); | 292 | unregister_trace_workqueue_execution(probe_workqueue_execution, NULL); |
289 | no_insertion: | 293 | no_insertion: |
290 | unregister_trace_workqueue_insertion(probe_workqueue_insertion); | 294 | unregister_trace_workqueue_insertion(probe_workqueue_insertion, NULL); |
291 | out: | 295 | out: |
292 | pr_warning("trace_workqueue: unable to trace workqueues\n"); | 296 | pr_warning("trace_workqueue: unable to trace workqueues\n"); |
293 | 297 | ||
diff --git a/kernel/tracepoint.c b/kernel/tracepoint.c index cc89be5bc0f8..c77f3eceea25 100644 --- a/kernel/tracepoint.c +++ b/kernel/tracepoint.c | |||
@@ -54,7 +54,7 @@ static struct hlist_head tracepoint_table[TRACEPOINT_TABLE_SIZE]; | |||
54 | */ | 54 | */ |
55 | struct tracepoint_entry { | 55 | struct tracepoint_entry { |
56 | struct hlist_node hlist; | 56 | struct hlist_node hlist; |
57 | void **funcs; | 57 | struct tracepoint_func *funcs; |
58 | int refcount; /* Number of times armed. 0 if disarmed. */ | 58 | int refcount; /* Number of times armed. 0 if disarmed. */ |
59 | char name[0]; | 59 | char name[0]; |
60 | }; | 60 | }; |
@@ -64,12 +64,12 @@ struct tp_probes { | |||
64 | struct rcu_head rcu; | 64 | struct rcu_head rcu; |
65 | struct list_head list; | 65 | struct list_head list; |
66 | } u; | 66 | } u; |
67 | void *probes[0]; | 67 | struct tracepoint_func probes[0]; |
68 | }; | 68 | }; |
69 | 69 | ||
70 | static inline void *allocate_probes(int count) | 70 | static inline void *allocate_probes(int count) |
71 | { | 71 | { |
72 | struct tp_probes *p = kmalloc(count * sizeof(void *) | 72 | struct tp_probes *p = kmalloc(count * sizeof(struct tracepoint_func) |
73 | + sizeof(struct tp_probes), GFP_KERNEL); | 73 | + sizeof(struct tp_probes), GFP_KERNEL); |
74 | return p == NULL ? NULL : p->probes; | 74 | return p == NULL ? NULL : p->probes; |
75 | } | 75 | } |
@@ -79,7 +79,7 @@ static void rcu_free_old_probes(struct rcu_head *head) | |||
79 | kfree(container_of(head, struct tp_probes, u.rcu)); | 79 | kfree(container_of(head, struct tp_probes, u.rcu)); |
80 | } | 80 | } |
81 | 81 | ||
82 | static inline void release_probes(void *old) | 82 | static inline void release_probes(struct tracepoint_func *old) |
83 | { | 83 | { |
84 | if (old) { | 84 | if (old) { |
85 | struct tp_probes *tp_probes = container_of(old, | 85 | struct tp_probes *tp_probes = container_of(old, |
@@ -95,15 +95,16 @@ static void debug_print_probes(struct tracepoint_entry *entry) | |||
95 | if (!tracepoint_debug || !entry->funcs) | 95 | if (!tracepoint_debug || !entry->funcs) |
96 | return; | 96 | return; |
97 | 97 | ||
98 | for (i = 0; entry->funcs[i]; i++) | 98 | for (i = 0; entry->funcs[i].func; i++) |
99 | printk(KERN_DEBUG "Probe %d : %p\n", i, entry->funcs[i]); | 99 | printk(KERN_DEBUG "Probe %d : %p\n", i, entry->funcs[i].func); |
100 | } | 100 | } |
101 | 101 | ||
102 | static void * | 102 | static struct tracepoint_func * |
103 | tracepoint_entry_add_probe(struct tracepoint_entry *entry, void *probe) | 103 | tracepoint_entry_add_probe(struct tracepoint_entry *entry, |
104 | void *probe, void *data) | ||
104 | { | 105 | { |
105 | int nr_probes = 0; | 106 | int nr_probes = 0; |
106 | void **old, **new; | 107 | struct tracepoint_func *old, *new; |
107 | 108 | ||
108 | WARN_ON(!probe); | 109 | WARN_ON(!probe); |
109 | 110 | ||
@@ -111,8 +112,9 @@ tracepoint_entry_add_probe(struct tracepoint_entry *entry, void *probe) | |||
111 | old = entry->funcs; | 112 | old = entry->funcs; |
112 | if (old) { | 113 | if (old) { |
113 | /* (N -> N+1), (N != 0, 1) probes */ | 114 | /* (N -> N+1), (N != 0, 1) probes */ |
114 | for (nr_probes = 0; old[nr_probes]; nr_probes++) | 115 | for (nr_probes = 0; old[nr_probes].func; nr_probes++) |
115 | if (old[nr_probes] == probe) | 116 | if (old[nr_probes].func == probe && |
117 | old[nr_probes].data == data) | ||
116 | return ERR_PTR(-EEXIST); | 118 | return ERR_PTR(-EEXIST); |
117 | } | 119 | } |
118 | /* + 2 : one for new probe, one for NULL func */ | 120 | /* + 2 : one for new probe, one for NULL func */ |
@@ -120,9 +122,10 @@ tracepoint_entry_add_probe(struct tracepoint_entry *entry, void *probe) | |||
120 | if (new == NULL) | 122 | if (new == NULL) |
121 | return ERR_PTR(-ENOMEM); | 123 | return ERR_PTR(-ENOMEM); |
122 | if (old) | 124 | if (old) |
123 | memcpy(new, old, nr_probes * sizeof(void *)); | 125 | memcpy(new, old, nr_probes * sizeof(struct tracepoint_func)); |
124 | new[nr_probes] = probe; | 126 | new[nr_probes].func = probe; |
125 | new[nr_probes + 1] = NULL; | 127 | new[nr_probes].data = data; |
128 | new[nr_probes + 1].func = NULL; | ||
126 | entry->refcount = nr_probes + 1; | 129 | entry->refcount = nr_probes + 1; |
127 | entry->funcs = new; | 130 | entry->funcs = new; |
128 | debug_print_probes(entry); | 131 | debug_print_probes(entry); |
@@ -130,10 +133,11 @@ tracepoint_entry_add_probe(struct tracepoint_entry *entry, void *probe) | |||
130 | } | 133 | } |
131 | 134 | ||
132 | static void * | 135 | static void * |
133 | tracepoint_entry_remove_probe(struct tracepoint_entry *entry, void *probe) | 136 | tracepoint_entry_remove_probe(struct tracepoint_entry *entry, |
137 | void *probe, void *data) | ||
134 | { | 138 | { |
135 | int nr_probes = 0, nr_del = 0, i; | 139 | int nr_probes = 0, nr_del = 0, i; |
136 | void **old, **new; | 140 | struct tracepoint_func *old, *new; |
137 | 141 | ||
138 | old = entry->funcs; | 142 | old = entry->funcs; |
139 | 143 | ||
@@ -142,8 +146,10 @@ tracepoint_entry_remove_probe(struct tracepoint_entry *entry, void *probe) | |||
142 | 146 | ||
143 | debug_print_probes(entry); | 147 | debug_print_probes(entry); |
144 | /* (N -> M), (N > 1, M >= 0) probes */ | 148 | /* (N -> M), (N > 1, M >= 0) probes */ |
145 | for (nr_probes = 0; old[nr_probes]; nr_probes++) { | 149 | for (nr_probes = 0; old[nr_probes].func; nr_probes++) { |
146 | if ((!probe || old[nr_probes] == probe)) | 150 | if (!probe || |
151 | (old[nr_probes].func == probe && | ||
152 | old[nr_probes].data == data)) | ||
147 | nr_del++; | 153 | nr_del++; |
148 | } | 154 | } |
149 | 155 | ||
@@ -160,10 +166,11 @@ tracepoint_entry_remove_probe(struct tracepoint_entry *entry, void *probe) | |||
160 | new = allocate_probes(nr_probes - nr_del + 1); | 166 | new = allocate_probes(nr_probes - nr_del + 1); |
161 | if (new == NULL) | 167 | if (new == NULL) |
162 | return ERR_PTR(-ENOMEM); | 168 | return ERR_PTR(-ENOMEM); |
163 | for (i = 0; old[i]; i++) | 169 | for (i = 0; old[i].func; i++) |
164 | if ((probe && old[i] != probe)) | 170 | if (probe && |
171 | (old[i].func != probe || old[i].data != data)) | ||
165 | new[j++] = old[i]; | 172 | new[j++] = old[i]; |
166 | new[nr_probes - nr_del] = NULL; | 173 | new[nr_probes - nr_del].func = NULL; |
167 | entry->refcount = nr_probes - nr_del; | 174 | entry->refcount = nr_probes - nr_del; |
168 | entry->funcs = new; | 175 | entry->funcs = new; |
169 | } | 176 | } |
@@ -315,18 +322,19 @@ static void tracepoint_update_probes(void) | |||
315 | module_update_tracepoints(); | 322 | module_update_tracepoints(); |
316 | } | 323 | } |
317 | 324 | ||
318 | static void *tracepoint_add_probe(const char *name, void *probe) | 325 | static struct tracepoint_func * |
326 | tracepoint_add_probe(const char *name, void *probe, void *data) | ||
319 | { | 327 | { |
320 | struct tracepoint_entry *entry; | 328 | struct tracepoint_entry *entry; |
321 | void *old; | 329 | struct tracepoint_func *old; |
322 | 330 | ||
323 | entry = get_tracepoint(name); | 331 | entry = get_tracepoint(name); |
324 | if (!entry) { | 332 | if (!entry) { |
325 | entry = add_tracepoint(name); | 333 | entry = add_tracepoint(name); |
326 | if (IS_ERR(entry)) | 334 | if (IS_ERR(entry)) |
327 | return entry; | 335 | return (struct tracepoint_func *)entry; |
328 | } | 336 | } |
329 | old = tracepoint_entry_add_probe(entry, probe); | 337 | old = tracepoint_entry_add_probe(entry, probe, data); |
330 | if (IS_ERR(old) && !entry->refcount) | 338 | if (IS_ERR(old) && !entry->refcount) |
331 | remove_tracepoint(entry); | 339 | remove_tracepoint(entry); |
332 | return old; | 340 | return old; |
@@ -340,12 +348,12 @@ static void *tracepoint_add_probe(const char *name, void *probe) | |||
340 | * Returns 0 if ok, error value on error. | 348 | * Returns 0 if ok, error value on error. |
341 | * The probe address must at least be aligned on the architecture pointer size. | 349 | * The probe address must at least be aligned on the architecture pointer size. |
342 | */ | 350 | */ |
343 | int tracepoint_probe_register(const char *name, void *probe) | 351 | int tracepoint_probe_register(const char *name, void *probe, void *data) |
344 | { | 352 | { |
345 | void *old; | 353 | struct tracepoint_func *old; |
346 | 354 | ||
347 | mutex_lock(&tracepoints_mutex); | 355 | mutex_lock(&tracepoints_mutex); |
348 | old = tracepoint_add_probe(name, probe); | 356 | old = tracepoint_add_probe(name, probe, data); |
349 | mutex_unlock(&tracepoints_mutex); | 357 | mutex_unlock(&tracepoints_mutex); |
350 | if (IS_ERR(old)) | 358 | if (IS_ERR(old)) |
351 | return PTR_ERR(old); | 359 | return PTR_ERR(old); |
@@ -356,15 +364,16 @@ int tracepoint_probe_register(const char *name, void *probe) | |||
356 | } | 364 | } |
357 | EXPORT_SYMBOL_GPL(tracepoint_probe_register); | 365 | EXPORT_SYMBOL_GPL(tracepoint_probe_register); |
358 | 366 | ||
359 | static void *tracepoint_remove_probe(const char *name, void *probe) | 367 | static struct tracepoint_func * |
368 | tracepoint_remove_probe(const char *name, void *probe, void *data) | ||
360 | { | 369 | { |
361 | struct tracepoint_entry *entry; | 370 | struct tracepoint_entry *entry; |
362 | void *old; | 371 | struct tracepoint_func *old; |
363 | 372 | ||
364 | entry = get_tracepoint(name); | 373 | entry = get_tracepoint(name); |
365 | if (!entry) | 374 | if (!entry) |
366 | return ERR_PTR(-ENOENT); | 375 | return ERR_PTR(-ENOENT); |
367 | old = tracepoint_entry_remove_probe(entry, probe); | 376 | old = tracepoint_entry_remove_probe(entry, probe, data); |
368 | if (IS_ERR(old)) | 377 | if (IS_ERR(old)) |
369 | return old; | 378 | return old; |
370 | if (!entry->refcount) | 379 | if (!entry->refcount) |
@@ -382,12 +391,12 @@ static void *tracepoint_remove_probe(const char *name, void *probe) | |||
382 | * itself uses stop_machine(), which insures that every preempt disabled section | 391 | * itself uses stop_machine(), which insures that every preempt disabled section |
383 | * have finished. | 392 | * have finished. |
384 | */ | 393 | */ |
385 | int tracepoint_probe_unregister(const char *name, void *probe) | 394 | int tracepoint_probe_unregister(const char *name, void *probe, void *data) |
386 | { | 395 | { |
387 | void *old; | 396 | struct tracepoint_func *old; |
388 | 397 | ||
389 | mutex_lock(&tracepoints_mutex); | 398 | mutex_lock(&tracepoints_mutex); |
390 | old = tracepoint_remove_probe(name, probe); | 399 | old = tracepoint_remove_probe(name, probe, data); |
391 | mutex_unlock(&tracepoints_mutex); | 400 | mutex_unlock(&tracepoints_mutex); |
392 | if (IS_ERR(old)) | 401 | if (IS_ERR(old)) |
393 | return PTR_ERR(old); | 402 | return PTR_ERR(old); |
@@ -418,12 +427,13 @@ static void tracepoint_add_old_probes(void *old) | |||
418 | * | 427 | * |
419 | * caller must call tracepoint_probe_update_all() | 428 | * caller must call tracepoint_probe_update_all() |
420 | */ | 429 | */ |
421 | int tracepoint_probe_register_noupdate(const char *name, void *probe) | 430 | int tracepoint_probe_register_noupdate(const char *name, void *probe, |
431 | void *data) | ||
422 | { | 432 | { |
423 | void *old; | 433 | struct tracepoint_func *old; |
424 | 434 | ||
425 | mutex_lock(&tracepoints_mutex); | 435 | mutex_lock(&tracepoints_mutex); |
426 | old = tracepoint_add_probe(name, probe); | 436 | old = tracepoint_add_probe(name, probe, data); |
427 | if (IS_ERR(old)) { | 437 | if (IS_ERR(old)) { |
428 | mutex_unlock(&tracepoints_mutex); | 438 | mutex_unlock(&tracepoints_mutex); |
429 | return PTR_ERR(old); | 439 | return PTR_ERR(old); |
@@ -441,12 +451,13 @@ EXPORT_SYMBOL_GPL(tracepoint_probe_register_noupdate); | |||
441 | * | 451 | * |
442 | * caller must call tracepoint_probe_update_all() | 452 | * caller must call tracepoint_probe_update_all() |
443 | */ | 453 | */ |
444 | int tracepoint_probe_unregister_noupdate(const char *name, void *probe) | 454 | int tracepoint_probe_unregister_noupdate(const char *name, void *probe, |
455 | void *data) | ||
445 | { | 456 | { |
446 | void *old; | 457 | struct tracepoint_func *old; |
447 | 458 | ||
448 | mutex_lock(&tracepoints_mutex); | 459 | mutex_lock(&tracepoints_mutex); |
449 | old = tracepoint_remove_probe(name, probe); | 460 | old = tracepoint_remove_probe(name, probe, data); |
450 | if (IS_ERR(old)) { | 461 | if (IS_ERR(old)) { |
451 | mutex_unlock(&tracepoints_mutex); | 462 | mutex_unlock(&tracepoints_mutex); |
452 | return PTR_ERR(old); | 463 | return PTR_ERR(old); |
diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c index cf208d8042b1..ad41529fb60f 100644 --- a/net/core/drop_monitor.c +++ b/net/core/drop_monitor.c | |||
@@ -172,12 +172,12 @@ out: | |||
172 | return; | 172 | return; |
173 | } | 173 | } |
174 | 174 | ||
175 | static void trace_kfree_skb_hit(struct sk_buff *skb, void *location) | 175 | static void trace_kfree_skb_hit(void *ignore, struct sk_buff *skb, void *location) |
176 | { | 176 | { |
177 | trace_drop_common(skb, location); | 177 | trace_drop_common(skb, location); |
178 | } | 178 | } |
179 | 179 | ||
180 | static void trace_napi_poll_hit(struct napi_struct *napi) | 180 | static void trace_napi_poll_hit(void *ignore, struct napi_struct *napi) |
181 | { | 181 | { |
182 | struct dm_hw_stat_delta *new_stat; | 182 | struct dm_hw_stat_delta *new_stat; |
183 | 183 | ||
@@ -225,12 +225,12 @@ static int set_all_monitor_traces(int state) | |||
225 | 225 | ||
226 | switch (state) { | 226 | switch (state) { |
227 | case TRACE_ON: | 227 | case TRACE_ON: |
228 | rc |= register_trace_kfree_skb(trace_kfree_skb_hit); | 228 | rc |= register_trace_kfree_skb(trace_kfree_skb_hit, NULL); |
229 | rc |= register_trace_napi_poll(trace_napi_poll_hit); | 229 | rc |= register_trace_napi_poll(trace_napi_poll_hit, NULL); |
230 | break; | 230 | break; |
231 | case TRACE_OFF: | 231 | case TRACE_OFF: |
232 | rc |= unregister_trace_kfree_skb(trace_kfree_skb_hit); | 232 | rc |= unregister_trace_kfree_skb(trace_kfree_skb_hit, NULL); |
233 | rc |= unregister_trace_napi_poll(trace_napi_poll_hit); | 233 | rc |= unregister_trace_napi_poll(trace_napi_poll_hit, NULL); |
234 | 234 | ||
235 | tracepoint_synchronize_unregister(); | 235 | tracepoint_synchronize_unregister(); |
236 | 236 | ||
diff --git a/samples/tracepoints/tp-samples-trace.h b/samples/tracepoints/tp-samples-trace.h index dffdc49878af..4d46be965961 100644 --- a/samples/tracepoints/tp-samples-trace.h +++ b/samples/tracepoints/tp-samples-trace.h | |||
@@ -7,7 +7,5 @@ | |||
7 | DECLARE_TRACE(subsys_event, | 7 | DECLARE_TRACE(subsys_event, |
8 | TP_PROTO(struct inode *inode, struct file *file), | 8 | TP_PROTO(struct inode *inode, struct file *file), |
9 | TP_ARGS(inode, file)); | 9 | TP_ARGS(inode, file)); |
10 | DECLARE_TRACE(subsys_eventb, | 10 | DECLARE_TRACE_NOARGS(subsys_eventb); |
11 | TP_PROTO(void), | ||
12 | TP_ARGS()); | ||
13 | #endif | 11 | #endif |
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 | ||
diff --git a/samples/tracepoints/tracepoint-probe-sample2.c b/samples/tracepoints/tracepoint-probe-sample2.c index be2a960573f1..9fcf990e5d4b 100644 --- a/samples/tracepoints/tracepoint-probe-sample2.c +++ b/samples/tracepoints/tracepoint-probe-sample2.c | |||
@@ -12,7 +12,8 @@ | |||
12 | * Here the caller only guarantees locking for struct file and struct inode. | 12 | * Here the caller only guarantees locking for struct file and struct inode. |
13 | * Locking must therefore be done in the probe to use the dentry. | 13 | * Locking must therefore be done in the probe to use the dentry. |
14 | */ | 14 | */ |
15 | static void probe_subsys_event(struct inode *inode, struct file *file) | 15 | static void probe_subsys_event(void *ignore, |
16 | struct inode *inode, struct file *file) | ||
16 | { | 17 | { |
17 | printk(KERN_INFO "Event is encountered with inode number %lu\n", | 18 | printk(KERN_INFO "Event is encountered with inode number %lu\n", |
18 | inode->i_ino); | 19 | inode->i_ino); |
@@ -22,7 +23,7 @@ static int __init tp_sample_trace_init(void) | |||
22 | { | 23 | { |
23 | int ret; | 24 | int ret; |
24 | 25 | ||
25 | ret = register_trace_subsys_event(probe_subsys_event); | 26 | ret = register_trace_subsys_event(probe_subsys_event, NULL); |
26 | WARN_ON(ret); | 27 | WARN_ON(ret); |
27 | 28 | ||
28 | return 0; | 29 | return 0; |
@@ -32,7 +33,7 @@ module_init(tp_sample_trace_init); | |||
32 | 33 | ||
33 | static void __exit tp_sample_trace_exit(void) | 34 | static void __exit tp_sample_trace_exit(void) |
34 | { | 35 | { |
35 | unregister_trace_subsys_event(probe_subsys_event); | 36 | unregister_trace_subsys_event(probe_subsys_event, NULL); |
36 | tracepoint_synchronize_unregister(); | 37 | tracepoint_synchronize_unregister(); |
37 | } | 38 | } |
38 | 39 | ||