Implement LTTNG_UST_TRACEPOINT_LIST
[lttng-ust.git] / include / lttng / tracepoint-internal.h
CommitLineData
51489cad
MD
1#ifndef _LTTNG_TRACEPOINT_INTERNAL_H
2#define _LTTNG_TRACEPOINT_INTERNAL_H
81614639
MD
3
4/*
5 * tracepoint-internal.h
6 *
7 * Tracepoint internal header.
8 *
9 * Copyright (C) 2008 Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
10 * Copyright (C) 2009 Pierre-Marc Fournier
11 * Copyright (C) 2009 Steven Rostedt <rostedt@goodmis.org>
12 *
13 * This library is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU Lesser General Public
15 * License as published by the Free Software Foundation;
16 * version 2.1 of the License.
17 *
18 * This library is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * Lesser General Public License for more details.
22 *
23 * You should have received a copy of the GNU Lesser General Public
24 * License along with this library; if not, write to the Free Software
25 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
26 *
27 * Heavily inspired from the Linux Kernel Markers.
81614639
MD
28 */
29
30#include <urcu-bp.h>
4318ae1b 31#include <lttng/core.h>
81614639 32#include <urcu/list.h>
51489cad 33#include <lttng/tracepoint-types.h>
81614639 34
1fcf7ad7
MD
35struct tracepoint_lib {
36 struct tracepoint * const *tracepoints_start;
37 int tracepoints_count;
38 struct cds_list_head list;
39};
40
81614639
MD
41extern int tracepoint_probe_register_noupdate(const char *name, void *probe,
42 void *data);
43extern int tracepoint_probe_unregister_noupdate(const char *name, void *probe,
44 void *data);
45extern void tracepoint_probe_update_all(void);
46
47struct tracepoint_iter {
48 struct tracepoint_lib *lib;
49 struct tracepoint * const *tracepoint;
50};
51
52extern void tracepoint_iter_start(struct tracepoint_iter *iter);
53extern void tracepoint_iter_next(struct tracepoint_iter *iter);
54extern void tracepoint_iter_stop(struct tracepoint_iter *iter);
55extern void tracepoint_iter_reset(struct tracepoint_iter *iter);
56extern int tracepoint_get_iter_range(struct tracepoint * const **tracepoint,
57 struct tracepoint * const *begin, struct tracepoint * const *end);
58
59/*
60 * tracepoint_synchronize_unregister must be called between the last tracepoint
61 * probe unregistration and the end of module exit to make sure there is no
62 * caller executing a probe when it is freed.
63 */
64static inline void tracepoint_synchronize_unregister(void)
65{
66 synchronize_rcu();
67}
68
81614639
MD
69struct trace_event_iter {
70 struct trace_event_lib *lib;
71 struct trace_event * const *trace_event;
72};
73
74extern void trace_event_iter_start(struct trace_event_iter *iter);
75extern void trace_event_iter_next(struct trace_event_iter *iter);
c7292295 76extern void trace_event_iter_stop(struct trace_event_iter *iter);
81614639
MD
77extern void trace_event_iter_reset(struct trace_event_iter *iter);
78
81614639
MD
79extern void trace_event_update_process(void);
80extern int is_trace_event_enabled(const char *channel, const char *name);
81
b27f8e75 82extern void init_tracepoint(void);
edaa1431 83extern void exit_tracepoint(void);
b27f8e75 84
51489cad 85#endif /* _LTTNG_TRACEPOINT_INTERNAL_H */
This page took 0.026947 seconds and 4 git commands to generate.