Move to kernel style SPDX license identifiers
[lttng-ust.git] / liblttng-ust / lttng-tracer-core.h
CommitLineData
4fbf9cd1 1/*
c0c0989a
MJ
2 * SPDX-License-Identifier: LGPL-2.1-only
3 *
4fbf9cd1
MD
4 * Copyright (C) 2005-2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
5 *
6 * This contains the core definitions for the Linux Trace Toolkit.
4fbf9cd1
MD
7 */
8
c0c0989a
MJ
9#ifndef _LTTNG_TRACER_CORE_H
10#define _LTTNG_TRACER_CORE_H
11
b728d87e
MD
12#include <stddef.h>
13#include <urcu/arch.h>
4fbf9cd1 14#include <urcu/list.h>
44c72f10
MD
15#include <lttng/ust-tracer.h>
16#include <lttng/bug.h>
4318ae1b 17#include <lttng/ringbuffer-config.h>
44c72f10 18#include <usterr-signal-safe.h>
94be38e8 19#include <helper.h>
4fbf9cd1 20
735bef47
MJ
21/*
22 * The longuest possible namespace proc path is with the cgroup ns
23 * and the maximum theoretical linux pid of 536870912 :
24 *
25 * /proc/self/task/536870912/ns/cgroup
26 */
27#define LTTNG_PROC_NS_PATH_MAX 40
28
7dd08bec
MD
29struct lttng_session;
30struct lttng_channel;
31struct lttng_event;
ce7352a2
MD
32struct lttng_ctx_field;
33struct lttng_ust_lib_ring_buffer_ctx;
34struct lttng_ctx_value;
850550e0 35struct lttng_event_notifier;
4fbf9cd1 36
3327ac33
MD
37int ust_lock(void) __attribute__ ((warn_unused_result));
38void ust_lock_nocheck(void);
17dfb34b 39void ust_unlock(void);
8165c8da 40
eddd8d5d 41void lttng_fixup_event_tls(void);
4158a15a 42void lttng_fixup_vtid_tls(void);
009745db 43void lttng_fixup_procname_tls(void);
735bef47
MJ
44void lttng_fixup_cgroup_ns_tls(void);
45void lttng_fixup_ipc_ns_tls(void);
46void lttng_fixup_net_ns_tls(void);
3046e0bf 47LTTNG_HIDDEN
cefef7a7 48void lttng_fixup_time_ns_tls(void);
735bef47 49void lttng_fixup_uts_ns_tls(void);
eddd8d5d 50
74d81a6c
MD
51const char *lttng_ust_obj_get_name(int id);
52
32ce8569
MD
53int lttng_get_notify_socket(void *owner);
54
94be38e8
JR
55LTTNG_HIDDEN
56char* lttng_ust_sockinfo_get_procname(void *owner);
57
246be17e 58void lttng_ust_sockinfo_session_enabled(void *owner);
95c25348 59
79f3848b
MD
60void lttng_ust_malloc_wrapper_init(void);
61
405be658
MD
62ssize_t lttng_ust_read(int fd, void *buf, size_t len);
63
ce7352a2
MD
64size_t lttng_ust_dummy_get_size(struct lttng_ctx_field *field, size_t offset);
65void lttng_ust_dummy_record(struct lttng_ctx_field *field,
66 struct lttng_ust_lib_ring_buffer_ctx *ctx,
67 struct lttng_channel *chan);
68void lttng_ust_dummy_get_value(struct lttng_ctx_field *field,
69 struct lttng_ctx_value *value);
70int lttng_context_is_app(const char *name);
c362addf 71void lttng_ust_fixup_tls(void);
ce7352a2 72
10544ee8
MD
73extern void (*lttng_ust_liburcu_bp_before_fork)(void);
74extern void (*lttng_ust_liburcu_bp_after_fork_parent)(void);
75extern void (*lttng_ust_liburcu_bp_after_fork_child)(void);
76
cab88ff8
MD
77LTTNG_HIDDEN
78void lttng_event_notifier_notification_send(
79 struct lttng_event_notifier *event_notifier,
80 const char *stack_data);
81
23d128de
MJ
82LTTNG_HIDDEN
83struct lttng_counter_transport *lttng_counter_transport_find(const char *name);
84LTTNG_HIDDEN
85void lttng_counter_transport_register(struct lttng_counter_transport *transport);
86LTTNG_HIDDEN
87void lttng_counter_transport_unregister(struct lttng_counter_transport *transport);
88
20142124
MD
89#ifdef LTTNG_UST_HAVE_PERF_EVENT
90void lttng_ust_fixup_perf_counter_tls(void);
91void lttng_perf_lock(void);
92void lttng_perf_unlock(void);
93#else /* #ifdef LTTNG_UST_HAVE_PERF_EVENT */
94static inline
95void lttng_ust_fixup_perf_counter_tls(void)
96{
97}
98static inline
99void lttng_perf_lock(void)
100{
101}
102static inline
103void lttng_perf_unlock(void)
104{
105}
106#endif /* #else #ifdef LTTNG_UST_HAVE_PERF_EVENT */
107
7dd08bec 108#endif /* _LTTNG_TRACER_CORE_H */
This page took 0.036086 seconds and 4 git commands to generate.