2 * SPDX-License-Identifier: LGPL-2.1-only
4 * Copyright (C) 2005-2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 * This contains the core definitions for the Linux Trace Toolkit.
9 #ifndef _LTTNG_TRACER_CORE_H
10 #define _LTTNG_TRACER_CORE_H
13 #include <urcu/arch.h>
14 #include <urcu/list.h>
15 #include <lttng/ust-tracer.h>
16 #include <lttng/bug.h>
17 #include <lttng/ringbuffer-config.h>
18 #include <usterr-signal-safe.h>
19 #include <ust-helper.h>
22 * The longuest possible namespace proc path is with the cgroup ns
23 * and the maximum theoretical linux pid of 536870912 :
25 * /proc/self/task/536870912/ns/cgroup
27 #define LTTNG_PROC_NS_PATH_MAX 40
32 struct lttng_ctx_field
;
33 struct lttng_ust_lib_ring_buffer_ctx
;
34 struct lttng_ctx_value
;
35 struct lttng_event_notifier
;
38 int ust_lock(void) __attribute__ ((warn_unused_result
));
40 void ust_lock_nocheck(void);
42 void ust_unlock(void);
44 void lttng_fixup_event_tls(void);
45 void lttng_fixup_vtid_tls(void);
46 void lttng_fixup_procname_tls(void);
47 void lttng_fixup_cgroup_ns_tls(void);
48 void lttng_fixup_ipc_ns_tls(void);
49 void lttng_fixup_net_ns_tls(void);
51 void lttng_fixup_time_ns_tls(void);
52 void lttng_fixup_uts_ns_tls(void);
55 void lttng_ust_fixup_fd_tracker_tls(void);
57 const char *lttng_ust_obj_get_name(int id
);
59 int lttng_get_notify_socket(void *owner
);
62 char* lttng_ust_sockinfo_get_procname(void *owner
);
64 void lttng_ust_sockinfo_session_enabled(void *owner
);
66 void lttng_ust_malloc_wrapper_init(void);
68 ssize_t
lttng_ust_read(int fd
, void *buf
, size_t len
);
70 size_t lttng_ust_dummy_get_size(struct lttng_ctx_field
*field
, size_t offset
);
71 void lttng_ust_dummy_record(struct lttng_ctx_field
*field
,
72 struct lttng_ust_lib_ring_buffer_ctx
*ctx
,
73 struct lttng_channel
*chan
);
74 void lttng_ust_dummy_get_value(struct lttng_ctx_field
*field
,
75 struct lttng_ctx_value
*value
);
76 int lttng_context_is_app(const char *name
);
77 void lttng_ust_fixup_tls(void);
80 void lttng_event_notifier_notification_send(
81 struct lttng_event_notifier
*event_notifier
,
82 const char *stack_data
);
85 struct lttng_counter_transport
*lttng_counter_transport_find(const char *name
);
87 void lttng_counter_transport_register(struct lttng_counter_transport
*transport
);
89 void lttng_counter_transport_unregister(struct lttng_counter_transport
*transport
);
91 #ifdef HAVE_PERF_EVENT
92 void lttng_ust_fixup_perf_counter_tls(void);
93 void lttng_perf_lock(void);
94 void lttng_perf_unlock(void);
95 #else /* #ifdef HAVE_PERF_EVENT */
97 void lttng_ust_fixup_perf_counter_tls(void)
101 void lttng_perf_lock(void)
105 void lttng_perf_unlock(void)
108 #endif /* #else #ifdef HAVE_PERF_EVENT */
110 #endif /* _LTTNG_TRACER_CORE_H */