2 * Copyright (C) 2008-2011 Mathieu Desnoyers
3 * Copyright (C) 2009 Pierre-Marc Fournier
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation;
8 * version 2.1 of the License.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 * Ported to userspace by Pierre-Marc Fournier.
28 #include <urcu/arch.h>
30 #include <urcu/hlist.h>
31 #include <urcu/uatomic.h>
32 #include <urcu/compiler.h>
33 #include <urcu/system.h>
35 #include <lttng/tracepoint.h>
36 #include <lttng/ust-abi.h> /* for LTTNG_UST_SYM_NAME_LEN */
38 #include <usterr-signal-safe.h>
41 #include "tracepoint-internal.h"
42 #include "lttng-tracer-core.h"
46 /* Test compiler support for weak symbols with hidden visibility. */
47 char __tracepoint_test_symbol
[9] __attribute__((weak
, visibility("hidden")));
49 /* Set to 1 to enable tracepoint debug output */
50 static const int tracepoint_debug
;
51 static int initialized
;
52 static void (*new_tracepoint_cb
)(struct lttng_ust_tracepoint
*);
55 * tracepoint_mutex nests inside UST mutex.
57 * Note about interaction with fork/clone: UST does not hold the
58 * tracepoint mutex across fork/clone because it is either:
59 * - nested within UST mutex, in which case holding the UST mutex across
61 * - taken by a library constructor, which should never race with a
62 * fork/clone if the application is expected to continue running with
63 * the same memory layout (no following exec()).
65 static pthread_mutex_t tracepoint_mutex
= PTHREAD_MUTEX_INITIALIZER
;
68 * libraries that contain tracepoints (struct tracepoint_lib).
69 * Protected by tracepoint mutex.
71 static CDS_LIST_HEAD(libs
);
74 * The tracepoint mutex protects the library tracepoints, the hash table, and
76 * All calls to the tracepoint API must be protected by the tracepoint mutex,
77 * excepts calls to tracepoint_register_lib and
78 * tracepoint_unregister_lib, which take the tracepoint mutex themselves.
82 * Tracepoint hash table, containing the active tracepoints.
83 * Protected by tracepoint mutex.
85 #define TRACEPOINT_HASH_BITS 12
86 #define TRACEPOINT_TABLE_SIZE (1 << TRACEPOINT_HASH_BITS)
87 static struct cds_hlist_head tracepoint_table
[TRACEPOINT_TABLE_SIZE
];
89 static CDS_LIST_HEAD(old_probes
);
90 static int need_update
;
94 * It is used to to delay the free of multiple probes array until a quiescent
96 * Tracepoint entries modifications are protected by the tracepoint mutex.
98 struct tracepoint_entry
{
99 struct cds_hlist_node hlist
;
100 struct lttng_ust_tracepoint_probe
*probes
;
101 int refcount
; /* Number of times armed. 0 if disarmed. */
102 int callsite_refcount
; /* how many libs use this tracepoint */
103 const char *signature
;
109 struct cds_list_head list
;
110 /* Field below only used for call_rcu scheme */
111 /* struct rcu_head head; */
113 struct lttng_ust_tracepoint_probe probes
[0];
117 * Callsite hash table, containing the tracepoint call sites.
118 * Protected by tracepoint mutex.
120 #define CALLSITE_HASH_BITS 12
121 #define CALLSITE_TABLE_SIZE (1 << CALLSITE_HASH_BITS)
122 static struct cds_hlist_head callsite_table
[CALLSITE_TABLE_SIZE
];
124 struct callsite_entry
{
125 struct cds_hlist_node hlist
; /* hash table node */
126 struct cds_list_head node
; /* lib list of callsites node */
127 struct lttng_ust_tracepoint
*tp
;
130 /* coverity[+alloc] */
131 static void *allocate_probes(int count
)
133 struct tp_probes
*p
=
134 zmalloc(count
* sizeof(struct lttng_ust_tracepoint_probe
)
135 + sizeof(struct tp_probes
));
136 return p
== NULL
? NULL
: p
->probes
;
139 /* coverity[+free : arg-0] */
140 static void release_probes(void *old
)
143 struct tp_probes
*tp_probes
= caa_container_of(old
,
144 struct tp_probes
, probes
[0]);
150 static void debug_print_probes(struct tracepoint_entry
*entry
)
154 if (!tracepoint_debug
|| !entry
->probes
)
157 for (i
= 0; entry
->probes
[i
].func
; i
++)
158 DBG("Probe %d : %p", i
, entry
->probes
[i
].func
);
162 tracepoint_entry_add_probe(struct tracepoint_entry
*entry
,
163 void (*probe
)(void), void *data
)
166 struct lttng_ust_tracepoint_probe
*old
, *new;
170 return ERR_PTR(-EINVAL
);
172 debug_print_probes(entry
);
175 /* (N -> N+1), (N != 0, 1) probes */
176 for (nr_probes
= 0; old
[nr_probes
].func
; nr_probes
++)
177 if (old
[nr_probes
].func
== probe
&&
178 old
[nr_probes
].data
== data
)
179 return ERR_PTR(-EEXIST
);
181 /* + 2 : one for new probe, one for NULL func */
182 new = allocate_probes(nr_probes
+ 2);
184 return ERR_PTR(-ENOMEM
);
187 nr_probes
* sizeof(struct lttng_ust_tracepoint_probe
));
188 new[nr_probes
].func
= probe
;
189 new[nr_probes
].data
= data
;
190 new[nr_probes
+ 1].func
= NULL
;
191 entry
->refcount
= nr_probes
+ 1;
193 debug_print_probes(entry
);
198 tracepoint_entry_remove_probe(struct tracepoint_entry
*entry
,
199 void (*probe
)(void), void *data
)
201 int nr_probes
= 0, nr_del
= 0, i
;
202 struct lttng_ust_tracepoint_probe
*old
, *new;
207 return ERR_PTR(-ENOENT
);
209 debug_print_probes(entry
);
210 /* (N -> M), (N > 1, M >= 0) probes */
212 for (nr_probes
= 0; old
[nr_probes
].func
; nr_probes
++) {
213 if (old
[nr_probes
].func
== probe
&&
214 old
[nr_probes
].data
== data
)
219 if (nr_probes
- nr_del
== 0) {
220 /* N -> 0, (N > 1) */
221 entry
->probes
= NULL
;
223 debug_print_probes(entry
);
227 /* N -> M, (N > 1, M > 0) */
229 new = allocate_probes(nr_probes
- nr_del
+ 1);
231 return ERR_PTR(-ENOMEM
);
232 for (i
= 0; old
[i
].func
; i
++)
233 if (old
[i
].func
!= probe
|| old
[i
].data
!= data
)
235 new[nr_probes
- nr_del
].func
= NULL
;
236 entry
->refcount
= nr_probes
- nr_del
;
239 debug_print_probes(entry
);
244 * Get tracepoint if the tracepoint is present in the tracepoint hash table.
245 * Must be called with tracepoint mutex held.
246 * Returns NULL if not present.
248 static struct tracepoint_entry
*get_tracepoint(const char *name
)
250 struct cds_hlist_head
*head
;
251 struct cds_hlist_node
*node
;
252 struct tracepoint_entry
*e
;
253 size_t name_len
= strlen(name
);
256 if (name_len
> LTTNG_UST_SYM_NAME_LEN
- 1) {
257 WARN("Truncating tracepoint name %s which exceeds size limits of %u chars", name
, LTTNG_UST_SYM_NAME_LEN
- 1);
258 name_len
= LTTNG_UST_SYM_NAME_LEN
- 1;
260 hash
= jhash(name
, name_len
, 0);
261 head
= &tracepoint_table
[hash
& (TRACEPOINT_TABLE_SIZE
- 1)];
262 cds_hlist_for_each_entry(e
, node
, head
, hlist
) {
263 if (!strncmp(name
, e
->name
, LTTNG_UST_SYM_NAME_LEN
- 1))
270 * Add the tracepoint to the tracepoint hash table. Must be called with
271 * tracepoint mutex held.
273 static struct tracepoint_entry
*add_tracepoint(const char *name
,
274 const char *signature
)
276 struct cds_hlist_head
*head
;
277 struct cds_hlist_node
*node
;
278 struct tracepoint_entry
*e
;
279 size_t name_len
= strlen(name
);
282 if (name_len
> LTTNG_UST_SYM_NAME_LEN
- 1) {
283 WARN("Truncating tracepoint name %s which exceeds size limits of %u chars", name
, LTTNG_UST_SYM_NAME_LEN
- 1);
284 name_len
= LTTNG_UST_SYM_NAME_LEN
- 1;
286 hash
= jhash(name
, name_len
, 0);
287 head
= &tracepoint_table
[hash
& (TRACEPOINT_TABLE_SIZE
- 1)];
288 cds_hlist_for_each_entry(e
, node
, head
, hlist
) {
289 if (!strncmp(name
, e
->name
, LTTNG_UST_SYM_NAME_LEN
- 1)) {
290 DBG("tracepoint %s busy", name
);
291 return ERR_PTR(-EEXIST
); /* Already there */
295 * Using zmalloc here to allocate a variable length element. Could
296 * cause some memory fragmentation if overused.
298 e
= zmalloc(sizeof(struct tracepoint_entry
) + name_len
+ 1);
300 return ERR_PTR(-ENOMEM
);
301 memcpy(&e
->name
[0], name
, name_len
+ 1);
302 e
->name
[name_len
] = '\0';
305 e
->callsite_refcount
= 0;
306 e
->signature
= signature
;
307 cds_hlist_add_head(&e
->hlist
, head
);
312 * Remove the tracepoint from the tracepoint hash table. Must be called with
313 * tracepoint mutex held.
315 static void remove_tracepoint(struct tracepoint_entry
*e
)
317 cds_hlist_del(&e
->hlist
);
322 * Sets the probe callback corresponding to one tracepoint.
324 static void set_tracepoint(struct tracepoint_entry
**entry
,
325 struct lttng_ust_tracepoint
*elem
, int active
)
327 WARN_ON(strncmp((*entry
)->name
, elem
->name
, LTTNG_UST_SYM_NAME_LEN
- 1) != 0);
329 * Check that signatures match before connecting a probe to a
330 * tracepoint. Warn the user if they don't.
332 if (strcmp(elem
->signature
, (*entry
)->signature
) != 0) {
333 static int warned
= 0;
335 /* Only print once, don't flood console. */
337 WARN("Tracepoint signature mismatch, not enabling one or more tracepoints. Ensure that the tracepoint probes prototypes match the application.");
338 WARN("Tracepoint \"%s\" signatures: call: \"%s\" vs probe: \"%s\".",
339 elem
->name
, elem
->signature
, (*entry
)->signature
);
342 /* Don't accept connecting non-matching signatures. */
347 * rcu_assign_pointer has a cmm_smp_wmb() which makes sure that the new
348 * probe callbacks array is consistent before setting a pointer to it.
349 * This array is referenced by __DO_TRACE from
350 * include/linux/tracepoints.h. A matching cmm_smp_read_barrier_depends()
353 rcu_assign_pointer(elem
->probes
, (*entry
)->probes
);
354 CMM_STORE_SHARED(elem
->state
, active
);
358 * Disable a tracepoint and its probe callback.
359 * Note: only waiting an RCU period after setting elem->call to the empty
360 * function insures that the original callback is not used anymore. This insured
361 * by preempt_disable around the call site.
363 static void disable_tracepoint(struct lttng_ust_tracepoint
*elem
)
365 CMM_STORE_SHARED(elem
->state
, 0);
366 rcu_assign_pointer(elem
->probes
, NULL
);
370 * Add the callsite to the callsite hash table. Must be called with
371 * tracepoint mutex held.
373 static void add_callsite(struct tracepoint_lib
* lib
, struct lttng_ust_tracepoint
*tp
)
375 struct cds_hlist_head
*head
;
376 struct callsite_entry
*e
;
377 const char *name
= tp
->name
;
378 size_t name_len
= strlen(name
);
380 struct tracepoint_entry
*tp_entry
;
382 if (name_len
> LTTNG_UST_SYM_NAME_LEN
- 1) {
383 WARN("Truncating tracepoint name %s which exceeds size limits of %u chars", name
, LTTNG_UST_SYM_NAME_LEN
- 1);
384 name_len
= LTTNG_UST_SYM_NAME_LEN
- 1;
386 hash
= jhash(name
, name_len
, 0);
387 head
= &callsite_table
[hash
& (CALLSITE_TABLE_SIZE
- 1)];
388 e
= zmalloc(sizeof(struct callsite_entry
));
390 PERROR("Unable to add callsite for tracepoint \"%s\"", name
);
393 cds_hlist_add_head(&e
->hlist
, head
);
395 cds_list_add(&e
->node
, &lib
->callsites
);
397 tp_entry
= get_tracepoint(name
);
400 tp_entry
->callsite_refcount
++;
404 * Remove the callsite from the callsite hash table and from lib
405 * callsite list. Must be called with tracepoint mutex held.
407 static void remove_callsite(struct callsite_entry
*e
)
409 struct tracepoint_entry
*tp_entry
;
411 tp_entry
= get_tracepoint(e
->tp
->name
);
413 tp_entry
->callsite_refcount
--;
414 if (tp_entry
->callsite_refcount
== 0)
415 disable_tracepoint(e
->tp
);
417 cds_hlist_del(&e
->hlist
);
418 cds_list_del(&e
->node
);
423 * Enable/disable all callsites based on the state of a specific
425 * Must be called with tracepoint mutex held.
427 static void tracepoint_sync_callsites(const char *name
)
429 struct cds_hlist_head
*head
;
430 struct cds_hlist_node
*node
;
431 struct callsite_entry
*e
;
432 size_t name_len
= strlen(name
);
434 struct tracepoint_entry
*tp_entry
;
436 tp_entry
= get_tracepoint(name
);
437 if (name_len
> LTTNG_UST_SYM_NAME_LEN
- 1) {
438 WARN("Truncating tracepoint name %s which exceeds size limits of %u chars", name
, LTTNG_UST_SYM_NAME_LEN
- 1);
439 name_len
= LTTNG_UST_SYM_NAME_LEN
- 1;
441 hash
= jhash(name
, name_len
, 0);
442 head
= &callsite_table
[hash
& (CALLSITE_TABLE_SIZE
- 1)];
443 cds_hlist_for_each_entry(e
, node
, head
, hlist
) {
444 struct lttng_ust_tracepoint
*tp
= e
->tp
;
446 if (strncmp(name
, tp
->name
, LTTNG_UST_SYM_NAME_LEN
- 1))
449 set_tracepoint(&tp_entry
, tp
,
450 !!tp_entry
->refcount
);
452 disable_tracepoint(tp
);
458 * tracepoint_update_probe_range - Update a probe range
459 * @begin: beginning of the range
460 * @end: end of the range
462 * Updates the probe callback corresponding to a range of tracepoints.
465 void tracepoint_update_probe_range(struct lttng_ust_tracepoint
* const *begin
,
466 struct lttng_ust_tracepoint
* const *end
)
468 struct lttng_ust_tracepoint
* const *iter
;
469 struct tracepoint_entry
*mark_entry
;
471 for (iter
= begin
; iter
< end
; iter
++) {
473 continue; /* skip dummy */
474 if (!(*iter
)->name
) {
475 disable_tracepoint(*iter
);
478 mark_entry
= get_tracepoint((*iter
)->name
);
480 set_tracepoint(&mark_entry
, *iter
,
481 !!mark_entry
->refcount
);
483 disable_tracepoint(*iter
);
488 static void lib_update_tracepoints(struct tracepoint_lib
*lib
)
490 tracepoint_update_probe_range(lib
->tracepoints_start
,
491 lib
->tracepoints_start
+ lib
->tracepoints_count
);
494 static void lib_register_callsites(struct tracepoint_lib
*lib
)
496 struct lttng_ust_tracepoint
* const *begin
;
497 struct lttng_ust_tracepoint
* const *end
;
498 struct lttng_ust_tracepoint
* const *iter
;
500 begin
= lib
->tracepoints_start
;
501 end
= lib
->tracepoints_start
+ lib
->tracepoints_count
;
503 for (iter
= begin
; iter
< end
; iter
++) {
505 continue; /* skip dummy */
506 if (!(*iter
)->name
) {
509 add_callsite(lib
, *iter
);
513 static void lib_unregister_callsites(struct tracepoint_lib
*lib
)
515 struct callsite_entry
*callsite
, *tmp
;
517 cds_list_for_each_entry_safe(callsite
, tmp
, &lib
->callsites
, node
)
518 remove_callsite(callsite
);
522 * Update probes, removing the faulty probes.
524 static void tracepoint_update_probes(void)
526 struct tracepoint_lib
*lib
;
528 /* tracepoints registered from libraries and executable. */
529 cds_list_for_each_entry(lib
, &libs
, list
)
530 lib_update_tracepoints(lib
);
533 static struct lttng_ust_tracepoint_probe
*
534 tracepoint_add_probe(const char *name
, void (*probe
)(void), void *data
,
535 const char *signature
)
537 struct tracepoint_entry
*entry
;
538 struct lttng_ust_tracepoint_probe
*old
;
540 entry
= get_tracepoint(name
);
542 entry
= add_tracepoint(name
, signature
);
544 return (struct lttng_ust_tracepoint_probe
*)entry
;
546 old
= tracepoint_entry_add_probe(entry
, probe
, data
);
547 if (IS_ERR(old
) && !entry
->refcount
)
548 remove_tracepoint(entry
);
553 * __tracepoint_probe_register - Connect a probe to a tracepoint
554 * @name: tracepoint name
555 * @probe: probe handler
557 * Returns 0 if ok, error value on error.
558 * The probe address must at least be aligned on the architecture pointer size.
559 * Called with the tracepoint mutex held.
561 int __tracepoint_probe_register(const char *name
, void (*probe
)(void),
562 void *data
, const char *signature
)
567 DBG("Registering probe to tracepoint %s", name
);
569 pthread_mutex_lock(&tracepoint_mutex
);
570 old
= tracepoint_add_probe(name
, probe
, data
, signature
);
576 tracepoint_sync_callsites(name
);
579 pthread_mutex_unlock(&tracepoint_mutex
);
583 static void *tracepoint_remove_probe(const char *name
, void (*probe
)(void),
586 struct tracepoint_entry
*entry
;
589 entry
= get_tracepoint(name
);
591 return ERR_PTR(-ENOENT
);
592 old
= tracepoint_entry_remove_probe(entry
, probe
, data
);
595 if (!entry
->refcount
)
596 remove_tracepoint(entry
);
601 * tracepoint_probe_unregister - Disconnect a probe from a tracepoint
602 * @name: tracepoint name
603 * @probe: probe function pointer
604 * @probe: probe data pointer
606 int __tracepoint_probe_unregister(const char *name
, void (*probe
)(void),
612 DBG("Un-registering probe from tracepoint %s", name
);
614 pthread_mutex_lock(&tracepoint_mutex
);
615 old
= tracepoint_remove_probe(name
, probe
, data
);
620 tracepoint_sync_callsites(name
);
623 pthread_mutex_unlock(&tracepoint_mutex
);
627 static void tracepoint_add_old_probes(void *old
)
631 struct tp_probes
*tp_probes
= caa_container_of(old
,
632 struct tp_probes
, probes
[0]);
633 cds_list_add(&tp_probes
->u
.list
, &old_probes
);
638 * tracepoint_probe_register_noupdate - register a probe but not connect
639 * @name: tracepoint name
640 * @probe: probe handler
642 * caller must call tracepoint_probe_update_all()
644 int tracepoint_probe_register_noupdate(const char *name
, void (*probe
)(void),
645 void *data
, const char *signature
)
650 pthread_mutex_lock(&tracepoint_mutex
);
651 old
= tracepoint_add_probe(name
, probe
, data
, signature
);
656 tracepoint_add_old_probes(old
);
658 pthread_mutex_unlock(&tracepoint_mutex
);
663 * tracepoint_probe_unregister_noupdate - remove a probe but not disconnect
664 * @name: tracepoint name
665 * @probe: probe function pointer
667 * caller must call tracepoint_probe_update_all()
668 * Called with the tracepoint mutex held.
670 int tracepoint_probe_unregister_noupdate(const char *name
, void (*probe
)(void),
676 DBG("Un-registering probe from tracepoint %s", name
);
678 pthread_mutex_lock(&tracepoint_mutex
);
679 old
= tracepoint_remove_probe(name
, probe
, data
);
684 tracepoint_add_old_probes(old
);
686 pthread_mutex_unlock(&tracepoint_mutex
);
691 * tracepoint_probe_update_all - update tracepoints
693 void tracepoint_probe_update_all(void)
695 CDS_LIST_HEAD(release_probes
);
696 struct tp_probes
*pos
, *next
;
698 pthread_mutex_lock(&tracepoint_mutex
);
702 if (!cds_list_empty(&old_probes
))
703 cds_list_replace_init(&old_probes
, &release_probes
);
706 tracepoint_update_probes();
707 cds_list_for_each_entry_safe(pos
, next
, &release_probes
, u
.list
) {
708 cds_list_del(&pos
->u
.list
);
713 pthread_mutex_unlock(&tracepoint_mutex
);
716 void tracepoint_set_new_tracepoint_cb(void (*cb
)(struct lttng_ust_tracepoint
*))
718 new_tracepoint_cb
= cb
;
721 static void new_tracepoints(struct lttng_ust_tracepoint
* const *start
,
722 struct lttng_ust_tracepoint
* const *end
)
724 if (new_tracepoint_cb
) {
725 struct lttng_ust_tracepoint
* const *t
;
727 for (t
= start
; t
< end
; t
++) {
729 new_tracepoint_cb(*t
);
734 int tracepoint_register_lib(struct lttng_ust_tracepoint
* const *tracepoints_start
,
735 int tracepoints_count
)
737 struct tracepoint_lib
*pl
, *iter
;
741 pl
= (struct tracepoint_lib
*) zmalloc(sizeof(struct tracepoint_lib
));
743 PERROR("Unable to register tracepoint lib");
746 pl
->tracepoints_start
= tracepoints_start
;
747 pl
->tracepoints_count
= tracepoints_count
;
748 CDS_INIT_LIST_HEAD(&pl
->callsites
);
750 pthread_mutex_lock(&tracepoint_mutex
);
752 * We sort the libs by struct lib pointer address.
754 cds_list_for_each_entry_reverse(iter
, &libs
, list
) {
755 BUG_ON(iter
== pl
); /* Should never be in the list twice */
757 /* We belong to the location right after iter. */
758 cds_list_add(&pl
->list
, &iter
->list
);
762 /* We should be added at the head of the list */
763 cds_list_add(&pl
->list
, &libs
);
765 new_tracepoints(tracepoints_start
, tracepoints_start
+ tracepoints_count
);
766 lib_register_callsites(pl
);
767 lib_update_tracepoints(pl
);
768 pthread_mutex_unlock(&tracepoint_mutex
);
770 DBG("just registered a tracepoints section from %p and having %d tracepoints",
771 tracepoints_start
, tracepoints_count
);
775 for (i
= 0; i
< tracepoints_count
; i
++) {
776 DBG("registered tracepoint: %s", tracepoints_start
[i
]->name
);
783 int tracepoint_unregister_lib(struct lttng_ust_tracepoint
* const *tracepoints_start
)
785 struct tracepoint_lib
*lib
;
787 pthread_mutex_lock(&tracepoint_mutex
);
788 cds_list_for_each_entry(lib
, &libs
, list
) {
789 if (lib
->tracepoints_start
!= tracepoints_start
)
792 cds_list_del(&lib
->list
);
794 * Unregistering a callsite also decreases the
795 * callsite reference count of the corresponding
796 * tracepoint, and disables the tracepoint if
797 * the reference count drops to zero.
799 lib_unregister_callsites(lib
);
800 DBG("just unregistered a tracepoints section from %p",
801 lib
->tracepoints_start
);
805 pthread_mutex_unlock(&tracepoint_mutex
);
810 * Report in debug message whether the compiler correctly supports weak
811 * hidden symbols. This test checks that the address associated with two
812 * weak symbols with hidden visibility is the same when declared within
813 * two compile units part of the same module.
815 static void check_weak_hidden(void)
817 DBG("Your compiler support for weak symbols with hidden visibility is %s",
818 __tracepoint_test_symbol
== lttng_ust_tp_check_weak_hidden() ?
820 "BROKEN. Please upgrade or fix your compiler to use LTTng-UST tracepoints.");
823 void init_tracepoint(void)
825 if (uatomic_xchg(&initialized
, 1) == 1)
831 void exit_tracepoint(void)
837 * Create the wrapper symbols.
839 #undef tp_rcu_read_lock_bp
840 #undef tp_rcu_read_unlock_bp
841 #undef tp_rcu_dereference_bp
843 void tp_rcu_read_lock_bp(void)
848 void tp_rcu_read_unlock_bp(void)
850 rcu_read_unlock_bp();
853 void *tp_rcu_dereference_sym_bp(void *p
)
855 return rcu_dereference_bp(p
);