2 * Copyright (C) 2007 Mathieu Desnoyers
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 #include <linux/module.h>
19 #include <linux/mutex.h>
20 #include <linux/types.h>
21 #include <linux/jhash.h>
22 #include <linux/list.h>
23 #include <linux/rcupdate.h>
24 #include <linux/marker.h>
25 #include <linux/err.h>
27 extern struct marker __start___markers
[];
28 extern struct marker __stop___markers
[];
30 /* Set to 1 to enable marker debug output */
31 const int marker_debug
;
34 * markers_mutex nests inside module_mutex. Markers mutex protects the builtin
35 * and module markers and the hash table.
37 static DEFINE_MUTEX(markers_mutex
);
40 * Marker hash table, containing the active markers.
41 * Protected by module_mutex.
43 #define MARKER_HASH_BITS 6
44 #define MARKER_TABLE_SIZE (1 << MARKER_HASH_BITS)
48 * It is used to make sure every handler has finished using its private data
49 * between two consecutive operation (add or remove) on a given marker. It is
50 * also used to delay the free of multiple probes array until a quiescent state
52 * marker entries modifications are protected by the markers_mutex.
55 struct hlist_node hlist
;
57 void (*call
)(const struct marker
*mdata
, /* Probe wrapper */
58 void *call_private
, const char *fmt
, ...);
59 struct marker_probe_closure single
;
60 struct marker_probe_closure
*multi
;
61 int refcount
; /* Number of times armed. 0 if disarmed. */
64 <<<<<<< HEAD
:kernel
/marker
.c
68 unsigned char rcu_pending
:1;
69 unsigned char ptype
:1;
70 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:kernel
/marker
.c
71 char name
[0]; /* Contains name'\0'format'\0' */
74 static struct hlist_head marker_table
[MARKER_TABLE_SIZE
];
77 * __mark_empty_function - Empty probe callback
78 * @probe_private: probe private data
79 * @call_private: call site private data
81 * @...: variable argument list
83 * Empty callback provided as a probe to the markers. By providing this to a
84 * disabled marker, we make sure the execution flow is always valid even
85 * though the function pointer change and the marker enabling are two distinct
86 * operations that modifies the execution flow of preemptible code.
88 void __mark_empty_function(void *probe_private
, void *call_private
,
89 const char *fmt
, va_list *args
)
92 EXPORT_SYMBOL_GPL(__mark_empty_function
);
95 * marker_probe_cb Callback that prepares the variable argument list for probes.
96 * @mdata: pointer of type struct marker
97 * @call_private: caller site private data
99 * @...: Variable argument list.
101 * Since we do not use "typical" pointer based RCU in the 1 argument case, we
102 * need to put a full smp_rmb() in this branch. This is why we do not use
103 * rcu_dereference() for the pointer read.
105 void marker_probe_cb(const struct marker
*mdata
, void *call_private
,
106 const char *fmt
, ...)
112 * disabling preemption to make sure the teardown of the callbacks can
113 * be done correctly when they are in modules and they insure RCU read
117 ptype
= ACCESS_ONCE(mdata
->ptype
);
118 if (likely(!ptype
)) {
119 marker_probe_func
*func
;
120 /* Must read the ptype before ptr. They are not data dependant,
121 * so we put an explicit smp_rmb() here. */
123 func
= ACCESS_ONCE(mdata
->single
.func
);
124 /* Must read the ptr before private data. They are not data
125 * dependant, so we put an explicit smp_rmb() here. */
128 func(mdata
->single
.probe_private
, call_private
, fmt
, &args
);
131 struct marker_probe_closure
*multi
;
134 * multi points to an array, therefore accessing the array
135 * depends on reading multi. However, even in this case,
136 * we must insure that the pointer is read _before_ the array
137 * data. Same as rcu_dereference, but we need a full smp_rmb()
138 * in the fast path, so put the explicit barrier here.
140 smp_read_barrier_depends();
141 multi
= ACCESS_ONCE(mdata
->multi
);
142 for (i
= 0; multi
[i
].func
; i
++) {
144 multi
[i
].func(multi
[i
].probe_private
, call_private
, fmt
,
151 EXPORT_SYMBOL_GPL(marker_probe_cb
);
154 * marker_probe_cb Callback that does not prepare the variable argument list.
155 * @mdata: pointer of type struct marker
156 * @call_private: caller site private data
157 * @fmt: format string
158 * @...: Variable argument list.
160 * Should be connected to markers "MARK_NOARGS".
162 void marker_probe_cb_noarg(const struct marker
*mdata
,
163 void *call_private
, const char *fmt
, ...)
165 va_list args
; /* not initialized */
169 ptype
= ACCESS_ONCE(mdata
->ptype
);
170 if (likely(!ptype
)) {
171 marker_probe_func
*func
;
172 /* Must read the ptype before ptr. They are not data dependant,
173 * so we put an explicit smp_rmb() here. */
175 func
= ACCESS_ONCE(mdata
->single
.func
);
176 /* Must read the ptr before private data. They are not data
177 * dependant, so we put an explicit smp_rmb() here. */
179 func(mdata
->single
.probe_private
, call_private
, fmt
, &args
);
181 struct marker_probe_closure
*multi
;
184 * multi points to an array, therefore accessing the array
185 * depends on reading multi. However, even in this case,
186 * we must insure that the pointer is read _before_ the array
187 * data. Same as rcu_dereference, but we need a full smp_rmb()
188 * in the fast path, so put the explicit barrier here.
190 smp_read_barrier_depends();
191 multi
= ACCESS_ONCE(mdata
->multi
);
192 for (i
= 0; multi
[i
].func
; i
++)
193 multi
[i
].func(multi
[i
].probe_private
, call_private
, fmt
,
198 EXPORT_SYMBOL_GPL(marker_probe_cb_noarg
);
200 static void free_old_closure(struct rcu_head
*head
)
202 struct marker_entry
*entry
= container_of(head
,
203 struct marker_entry
, rcu
);
204 kfree(entry
->oldptr
);
205 /* Make sure we free the data before setting the pending flag to 0 */
207 entry
->rcu_pending
= 0;
210 static void debug_print_probes(struct marker_entry
*entry
)
218 printk(KERN_DEBUG
"Single probe : %p %p\n",
220 entry
->single
.probe_private
);
222 for (i
= 0; entry
->multi
[i
].func
; i
++)
223 printk(KERN_DEBUG
"Multi probe %d : %p %p\n", i
,
224 entry
->multi
[i
].func
,
225 entry
->multi
[i
].probe_private
);
229 static struct marker_probe_closure
*
230 marker_entry_add_probe(struct marker_entry
*entry
,
231 marker_probe_func
*probe
, void *probe_private
)
234 struct marker_probe_closure
*old
, *new;
238 debug_print_probes(entry
);
241 if (entry
->single
.func
== probe
&&
242 entry
->single
.probe_private
== probe_private
)
243 return ERR_PTR(-EBUSY
);
244 if (entry
->single
.func
== __mark_empty_function
) {
246 entry
->single
.func
= probe
;
247 entry
->single
.probe_private
= probe_private
;
250 debug_print_probes(entry
);
258 /* (N -> N+1), (N != 0, 1) probes */
259 for (nr_probes
= 0; old
[nr_probes
].func
; nr_probes
++)
260 if (old
[nr_probes
].func
== probe
261 && old
[nr_probes
].probe_private
263 return ERR_PTR(-EBUSY
);
265 /* + 2 : one for new probe, one for NULL func */
266 new = kzalloc((nr_probes
+ 2) * sizeof(struct marker_probe_closure
),
269 return ERR_PTR(-ENOMEM
);
271 new[0] = entry
->single
;
274 nr_probes
* sizeof(struct marker_probe_closure
));
275 new[nr_probes
].func
= probe
;
276 new[nr_probes
].probe_private
= probe_private
;
277 entry
->refcount
= nr_probes
+ 1;
280 debug_print_probes(entry
);
284 static struct marker_probe_closure
*
285 marker_entry_remove_probe(struct marker_entry
*entry
,
286 marker_probe_func
*probe
, void *probe_private
)
288 int nr_probes
= 0, nr_del
= 0, i
;
289 struct marker_probe_closure
*old
, *new;
293 debug_print_probes(entry
);
295 /* 0 -> N is an error */
296 WARN_ON(entry
->single
.func
== __mark_empty_function
);
298 WARN_ON(probe
&& entry
->single
.func
!= probe
);
299 WARN_ON(entry
->single
.probe_private
!= probe_private
);
300 entry
->single
.func
= __mark_empty_function
;
303 debug_print_probes(entry
);
306 /* (N -> M), (N > 1, M >= 0) probes */
307 for (nr_probes
= 0; old
[nr_probes
].func
; nr_probes
++) {
308 if ((!probe
|| old
[nr_probes
].func
== probe
)
309 && old
[nr_probes
].probe_private
315 if (nr_probes
- nr_del
== 0) {
316 /* N -> 0, (N > 1) */
317 entry
->single
.func
= __mark_empty_function
;
320 } else if (nr_probes
- nr_del
== 1) {
321 /* N -> 1, (N > 1) */
322 for (i
= 0; old
[i
].func
; i
++)
323 if ((probe
&& old
[i
].func
!= probe
) ||
324 old
[i
].probe_private
!= probe_private
)
325 entry
->single
= old
[i
];
330 /* N -> M, (N > 1, M > 1) */
332 new = kzalloc((nr_probes
- nr_del
+ 1)
333 * sizeof(struct marker_probe_closure
), GFP_KERNEL
);
335 return ERR_PTR(-ENOMEM
);
336 for (i
= 0; old
[i
].func
; i
++)
337 if ((probe
&& old
[i
].func
!= probe
) ||
338 old
[i
].probe_private
!= probe_private
)
340 entry
->refcount
= nr_probes
- nr_del
;
344 debug_print_probes(entry
);
349 * Get marker if the marker is present in the marker hash table.
350 * Must be called with markers_mutex held.
351 * Returns NULL if not present.
353 static struct marker_entry
*get_marker(const char *name
)
355 struct hlist_head
*head
;
356 struct hlist_node
*node
;
357 struct marker_entry
*e
;
358 u32 hash
= jhash(name
, strlen(name
), 0);
360 head
= &marker_table
[hash
& ((1 << MARKER_HASH_BITS
)-1)];
361 hlist_for_each_entry(e
, node
, head
, hlist
) {
362 if (!strcmp(name
, e
->name
))
369 * Add the marker to the marker hash table. Must be called with markers_mutex
372 static struct marker_entry
*add_marker(const char *name
, const char *format
)
374 struct hlist_head
*head
;
375 struct hlist_node
*node
;
376 struct marker_entry
*e
;
377 size_t name_len
= strlen(name
) + 1;
378 size_t format_len
= 0;
379 u32 hash
= jhash(name
, name_len
-1, 0);
382 format_len
= strlen(format
) + 1;
383 head
= &marker_table
[hash
& ((1 << MARKER_HASH_BITS
)-1)];
384 hlist_for_each_entry(e
, node
, head
, hlist
) {
385 if (!strcmp(name
, e
->name
)) {
387 "Marker %s busy\n", name
);
388 return ERR_PTR(-EBUSY
); /* Already there */
392 * Using kmalloc here to allocate a variable length element. Could
393 * cause some memory fragmentation if overused.
395 e
= kmalloc(sizeof(struct marker_entry
) + name_len
+ format_len
,
398 return ERR_PTR(-ENOMEM
);
399 memcpy(&e
->name
[0], name
, name_len
);
401 e
->format
= &e
->name
[name_len
];
402 memcpy(e
->format
, format
, format_len
);
403 if (strcmp(e
->format
, MARK_NOARGS
) == 0)
404 e
->call
= marker_probe_cb_noarg
;
406 e
->call
= marker_probe_cb
;
407 trace_mark(core_marker_format
, "name %s format %s",
411 e
->call
= marker_probe_cb
;
413 e
->single
.func
= __mark_empty_function
;
414 e
->single
.probe_private
= NULL
;
419 hlist_add_head(&e
->hlist
, head
);
424 * Remove the marker from the marker hash table. Must be called with mutex_lock
427 static int remove_marker(const char *name
)
429 struct hlist_head
*head
;
430 struct hlist_node
*node
;
431 struct marker_entry
*e
;
433 size_t len
= strlen(name
) + 1;
434 u32 hash
= jhash(name
, len
-1, 0);
436 head
= &marker_table
[hash
& ((1 << MARKER_HASH_BITS
)-1)];
437 hlist_for_each_entry(e
, node
, head
, hlist
) {
438 if (!strcmp(name
, e
->name
)) {
445 if (e
->single
.func
!= __mark_empty_function
)
447 hlist_del(&e
->hlist
);
448 /* Make sure the call_rcu has been executed */
456 * Set the mark_entry format to the format found in the element.
458 static int marker_set_format(struct marker_entry
**entry
, const char *format
)
460 struct marker_entry
*e
;
461 size_t name_len
= strlen((*entry
)->name
) + 1;
462 size_t format_len
= strlen(format
) + 1;
465 e
= kmalloc(sizeof(struct marker_entry
) + name_len
+ format_len
,
469 memcpy(&e
->name
[0], (*entry
)->name
, name_len
);
470 e
->format
= &e
->name
[name_len
];
471 memcpy(e
->format
, format
, format_len
);
472 if (strcmp(e
->format
, MARK_NOARGS
) == 0)
473 e
->call
= marker_probe_cb_noarg
;
475 e
->call
= marker_probe_cb
;
476 e
->single
= (*entry
)->single
;
477 e
->multi
= (*entry
)->multi
;
478 e
->ptype
= (*entry
)->ptype
;
479 e
->refcount
= (*entry
)->refcount
;
481 hlist_add_before(&e
->hlist
, &(*entry
)->hlist
);
482 hlist_del(&(*entry
)->hlist
);
483 /* Make sure the call_rcu has been executed */
484 if ((*entry
)->rcu_pending
)
488 trace_mark(core_marker_format
, "name %s format %s",
494 * Sets the probe callback corresponding to one marker.
496 static int set_marker(struct marker_entry
**entry
, struct marker
*elem
,
500 WARN_ON(strcmp((*entry
)->name
, elem
->name
) != 0);
502 if ((*entry
)->format
) {
503 if (strcmp((*entry
)->format
, elem
->format
) != 0) {
505 "Format mismatch for probe %s "
506 "(%s), marker (%s)\n",
513 ret
= marker_set_format(entry
, elem
->format
);
519 * probe_cb setup (statically known) is done here. It is
520 * asynchronous with the rest of execution, therefore we only
521 * pass from a "safe" callback (with argument) to an "unsafe"
522 * callback (does not set arguments).
524 elem
->call
= (*entry
)->call
;
527 * We only update the single probe private data when the ptr is
528 * set to a _non_ single probe! (0 -> 1 and N -> 1, N != 1)
530 WARN_ON(elem
->single
.func
!= __mark_empty_function
531 && elem
->single
.probe_private
532 != (*entry
)->single
.probe_private
&&
534 elem
->single
.probe_private
= (*entry
)->single
.probe_private
;
536 * Make sure the private data is valid when we update the
540 elem
->single
.func
= (*entry
)->single
.func
;
542 * We also make sure that the new probe callbacks array is consistent
543 * before setting a pointer to it.
545 rcu_assign_pointer(elem
->multi
, (*entry
)->multi
);
547 * Update the function or multi probe array pointer before setting the
551 elem
->ptype
= (*entry
)->ptype
;
552 elem
->state
= active
;
558 * Disable a marker and its probe callback.
559 * Note: only after a synchronize_sched() issued after setting elem->call to the
560 * empty function insures that the original callback is not used anymore. This
561 * insured by preemption disabling around the call site.
563 static void disable_marker(struct marker
*elem
)
565 /* leave "call" as is. It is known statically. */
567 elem
->single
.func
= __mark_empty_function
;
568 /* Update the function before setting the ptype */
570 elem
->ptype
= 0; /* single probe */
572 * Leave the private data and id there, because removal is racy and
573 * should be done only after a synchronize_sched(). These are never used
574 * until the next initialization anyway.
579 * marker_update_probe_range - Update a probe range
580 * @begin: beginning of the range
581 * @end: end of the range
583 * Updates the probe callback corresponding to a range of markers.
585 void marker_update_probe_range(struct marker
*begin
,
589 struct marker_entry
*mark_entry
;
591 mutex_lock(&markers_mutex
);
592 for (iter
= begin
; iter
< end
; iter
++) {
593 mark_entry
= get_marker(iter
->name
);
595 set_marker(&mark_entry
, iter
,
596 !!mark_entry
->refcount
);
598 * ignore error, continue
601 disable_marker(iter
);
604 mutex_unlock(&markers_mutex
);
608 * Update probes, removing the faulty probes.
609 * Issues a synchronize_sched() when no reference to the module passed
610 * as parameter is found in the probes so the probe module can be
611 * safely unloaded from now on.
613 * Internal callback only changed before the first probe is connected to it.
614 * Single probe private data can only be changed on 0 -> 1 and 2 -> 1
615 * transitions. All other transitions will leave the old private data valid.
616 * This makes the non-atomicity of the callback/private data updates valid.
618 * "special case" updates :
623 * Other updates all behave the same, just like the 2 -> 3 or 3 -> 2 updates.
624 * Site effect : marker_set_format may delete the marker entry (creating a
627 static void marker_update_probes(void)
629 /* Core kernel markers */
630 marker_update_probe_range(__start___markers
, __stop___markers
);
631 /* Markers in modules. */
632 module_update_markers();
636 * marker_probe_register - Connect a probe to a marker
638 * @format: format string
639 * @probe: probe handler
640 * @probe_private: probe private data
642 * private data must be a valid allocated memory address, or NULL.
643 * Returns 0 if ok, error value on error.
644 * The probe address must at least be aligned on the architecture pointer size.
646 int marker_probe_register(const char *name
, const char *format
,
647 marker_probe_func
*probe
, void *probe_private
)
649 struct marker_entry
*entry
;
651 struct marker_probe_closure
*old
;
653 mutex_lock(&markers_mutex
);
654 entry
= get_marker(name
);
656 entry
= add_marker(name
, format
);
658 ret
= PTR_ERR(entry
);
663 * If we detect that a call_rcu is pending for this marker,
664 * make sure it's executed now.
666 if (entry
->rcu_pending
)
668 old
= marker_entry_add_probe(entry
, probe
, probe_private
);
673 mutex_unlock(&markers_mutex
);
674 marker_update_probes(); /* may update entry */
675 mutex_lock(&markers_mutex
);
676 entry
= get_marker(name
);
679 entry
->rcu_pending
= 1;
680 /* write rcu_pending before calling the RCU callback */
682 call_rcu(&entry
->rcu
, free_old_closure
);
684 mutex_unlock(&markers_mutex
);
687 EXPORT_SYMBOL_GPL(marker_probe_register
);
690 * marker_probe_unregister - Disconnect a probe from a marker
692 * @probe: probe function pointer
693 * @probe_private: probe private data
695 * Returns the private data given to marker_probe_register, or an ERR_PTR().
696 * We do not need to call a synchronize_sched to make sure the probes have
697 * finished running before doing a module unload, because the module unload
698 * itself uses stop_machine(), which insures that every preempt disabled section
701 int marker_probe_unregister(const char *name
,
702 marker_probe_func
*probe
, void *probe_private
)
704 struct marker_entry
*entry
;
705 struct marker_probe_closure
*old
;
706 <<<<<<< HEAD
:kernel
/marker
.c
710 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:kernel
/marker
.c
712 mutex_lock(&markers_mutex
);
713 entry
= get_marker(name
);
714 <<<<<<< HEAD
:kernel
/marker
.c
719 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:kernel
/marker
.c
721 <<<<<<< HEAD
:kernel
/marker
.c
724 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:kernel
/marker
.c
725 if (entry
->rcu_pending
)
727 old
= marker_entry_remove_probe(entry
, probe
, probe_private
);
728 mutex_unlock(&markers_mutex
);
729 marker_update_probes(); /* may update entry */
730 mutex_lock(&markers_mutex
);
731 entry
= get_marker(name
);
732 <<<<<<< HEAD
:kernel
/marker
.c
736 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:kernel
/marker
.c
738 entry
->rcu_pending
= 1;
739 /* write rcu_pending before calling the RCU callback */
741 call_rcu(&entry
->rcu
, free_old_closure
);
742 remove_marker(name
); /* Ignore busy error message */
743 <<<<<<< HEAD
:kernel
/marker
.c
746 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a
:kernel
/marker
.c
748 mutex_unlock(&markers_mutex
);
751 EXPORT_SYMBOL_GPL(marker_probe_unregister
);
753 static struct marker_entry
*
754 get_marker_from_private_data(marker_probe_func
*probe
, void *probe_private
)
756 struct marker_entry
*entry
;
758 struct hlist_head
*head
;
759 struct hlist_node
*node
;
761 for (i
= 0; i
< MARKER_TABLE_SIZE
; i
++) {
762 head
= &marker_table
[i
];
763 hlist_for_each_entry(entry
, node
, head
, hlist
) {
765 if (entry
->single
.func
== probe
766 && entry
->single
.probe_private
770 struct marker_probe_closure
*closure
;
771 closure
= entry
->multi
;
772 for (i
= 0; closure
[i
].func
; i
++) {
773 if (closure
[i
].func
== probe
&&
774 closure
[i
].probe_private
785 * marker_probe_unregister_private_data - Disconnect a probe from a marker
786 * @probe: probe function
787 * @probe_private: probe private data
789 * Unregister a probe by providing the registered private data.
790 * Only removes the first marker found in hash table.
791 * Return 0 on success or error value.
792 * We do not need to call a synchronize_sched to make sure the probes have
793 * finished running before doing a module unload, because the module unload
794 * itself uses stop_machine(), which insures that every preempt disabled section
797 int marker_probe_unregister_private_data(marker_probe_func
*probe
,
800 struct marker_entry
*entry
;
802 struct marker_probe_closure
*old
;
804 mutex_lock(&markers_mutex
);
805 entry
= get_marker_from_private_data(probe
, probe_private
);
810 if (entry
->rcu_pending
)
812 old
= marker_entry_remove_probe(entry
, NULL
, probe_private
);
813 mutex_unlock(&markers_mutex
);
814 marker_update_probes(); /* may update entry */
815 mutex_lock(&markers_mutex
);
816 entry
= get_marker_from_private_data(probe
, probe_private
);
819 entry
->rcu_pending
= 1;
820 /* write rcu_pending before calling the RCU callback */
822 call_rcu(&entry
->rcu
, free_old_closure
);
823 remove_marker(entry
->name
); /* Ignore busy error message */
825 mutex_unlock(&markers_mutex
);
828 EXPORT_SYMBOL_GPL(marker_probe_unregister_private_data
);
831 * marker_get_private_data - Get a marker's probe private data
833 * @probe: probe to match
834 * @num: get the nth matching probe's private data
836 * Returns the nth private data pointer (starting from 0) matching, or an
838 * Returns the private data pointer, or an ERR_PTR.
839 * The private data pointer should _only_ be dereferenced if the caller is the
840 * owner of the data, or its content could vanish. This is mostly used to
841 * confirm that a caller is the owner of a registered probe.
843 void *marker_get_private_data(const char *name
, marker_probe_func
*probe
,
846 struct hlist_head
*head
;
847 struct hlist_node
*node
;
848 struct marker_entry
*e
;
849 size_t name_len
= strlen(name
) + 1;
850 u32 hash
= jhash(name
, name_len
-1, 0);
853 head
= &marker_table
[hash
& ((1 << MARKER_HASH_BITS
)-1)];
854 hlist_for_each_entry(e
, node
, head
, hlist
) {
855 if (!strcmp(name
, e
->name
)) {
857 if (num
== 0 && e
->single
.func
== probe
)
858 return e
->single
.probe_private
;
862 struct marker_probe_closure
*closure
;
865 for (i
= 0; closure
[i
].func
; i
++) {
866 if (closure
[i
].func
!= probe
)
869 return closure
[i
].probe_private
;
874 return ERR_PTR(-ENOENT
);
876 EXPORT_SYMBOL_GPL(marker_get_private_data
);