2 * SPDX-License-Identifier: MIT
4 * Copyright (C) 2016 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 #ifndef _LTTNG_UST_CONTEXT_PROVIDER_H
8 #define _LTTNG_UST_CONTEXT_PROVIDER_H
11 #include <lttng/ust-events.h>
12 #include <urcu/hlist.h>
14 struct lttng_ust_context_provider
{
16 size_t (*get_size
)(struct lttng_ctx_field
*field
, size_t offset
);
17 void (*record
)(struct lttng_ctx_field
*field
,
18 struct lttng_ust_lib_ring_buffer_ctx
*ctx
,
19 struct lttng_channel
*chan
);
20 void (*get_value
)(struct lttng_ctx_field
*field
,
21 struct lttng_ctx_value
*value
);
22 struct cds_hlist_node node
;
25 int lttng_ust_context_provider_register(struct lttng_ust_context_provider
*provider
);
26 void lttng_ust_context_provider_unregister(struct lttng_ust_context_provider
*provider
);
28 int lttng_context_is_app(const char *name
);
30 void lttng_ust_context_set_session_provider(const char *name
,
31 size_t (*get_size
)(struct lttng_ctx_field
*field
, size_t offset
),
32 void (*record
)(struct lttng_ctx_field
*field
,
33 struct lttng_ust_lib_ring_buffer_ctx
*ctx
,
34 struct lttng_channel
*chan
),
35 void (*get_value
)(struct lttng_ctx_field
*field
,
36 struct lttng_ctx_value
*value
));
38 int lttng_ust_add_app_context_to_ctx_rcu(const char *name
, struct lttng_ctx
**ctx
);
39 int lttng_ust_context_set_provider_rcu(struct lttng_ctx
**_ctx
,
41 size_t (*get_size
)(struct lttng_ctx_field
*field
, size_t offset
),
42 void (*record
)(struct lttng_ctx_field
*field
,
43 struct lttng_ust_lib_ring_buffer_ctx
*ctx
,
44 struct lttng_channel
*chan
),
45 void (*get_value
)(struct lttng_ctx_field
*field
,
46 struct lttng_ctx_value
*value
));
47 int lttng_context_add_rcu(struct lttng_ctx
**ctx_p
,
48 const struct lttng_ctx_field
*f
);
50 #endif /* _LTTNG_UST_CONTEXT_PROVIDER_H */