Move to kernel style SPDX license identifiers
[lttng-ust.git] / include / lttng / ust-context-provider.h
CommitLineData
53569322 1/*
c0c0989a 2 * SPDX-License-Identifier: MIT
53569322 3 *
c0c0989a 4 * Copyright (C) 2016 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
53569322
MD
5 */
6
c0c0989a
MJ
7#ifndef _LTTNG_UST_CONTEXT_PROVIDER_H
8#define _LTTNG_UST_CONTEXT_PROVIDER_H
9
b4051ad8 10#include <stddef.h>
53569322
MD
11#include <lttng/ust-events.h>
12#include <urcu/hlist.h>
13
14struct lttng_ust_context_provider {
15 char *name;
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;
23};
24
25int lttng_ust_context_provider_register(struct lttng_ust_context_provider *provider);
26void lttng_ust_context_provider_unregister(struct lttng_ust_context_provider *provider);
27
28int lttng_context_is_app(const char *name);
29
30void 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));
37
38int lttng_ust_add_app_context_to_ctx_rcu(const char *name, struct lttng_ctx **ctx);
39int lttng_ust_context_set_provider_rcu(struct lttng_ctx **_ctx,
40 const char *name,
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));
47int lttng_context_add_rcu(struct lttng_ctx **ctx_p,
48 const struct lttng_ctx_field *f);
49
50#endif /* _LTTNG_UST_CONTEXT_PROVIDER_H */
This page took 0.025343 seconds and 4 git commands to generate.