* removed.
*/
-struct lttng_ctx;
+struct lttng_ust_ctx;
struct lttng_ust_event_common_private;
enum lttng_ust_event_type {
unsigned int id;
struct lttng_channel *chan;
- struct lttng_ctx *ctx;
+ struct lttng_ust_ctx *ctx;
/* End of base ABI. Fields below should be used after checking struct_size. */
};
*/
struct lttng_ust_lib_ring_buffer_channel *chan; /* Channel buffers */
int enabled;
- struct lttng_ctx *ctx;
+ struct lttng_ust_ctx *ctx;
/* Event ID management */
struct lttng_session *session;
int objd; /* Object associated to channel */
uint32_t struct_size; /* Size of this structure */
struct lttng_ust_event_recorder *event_recorder;
- struct lttng_ctx *chan_ctx; /* RCU dereferenced. */
- struct lttng_ctx *event_ctx; /* RCU dereferenced. */
+ struct lttng_ust_ctx *chan_ctx; /* RCU dereferenced. */
+ struct lttng_ust_ctx *event_ctx; /* RCU dereferenced. */
/* End of base ABI. Fields below should be used after checking struct_size. */
};
#define LTTNG_UST_COMM_REG_MSG_PADDING 64
struct lttng_ust_event_field;
-struct lttng_ctx_field;
+struct lttng_ust_ctx_field;
struct lttng_ust_enum_entry;
struct lttng_integer_type;
struct lttng_session;
int session_objd, /* session descriptor */
int channel_objd, /* channel descriptor */
size_t nr_ctx_fields,
- const struct lttng_ctx_field *ctx_fields,
+ struct lttng_ust_ctx_field **ctx_fields,
uint32_t *chan_id, /* channel id (output) */
int *header_type); /* header type (output) */
#include "ust-dynamic-type.h"
-struct lttng_ctx_value {
+/*
+ * Context value
+ *
+ * IMPORTANT: this structure is part of the ABI between the probe and
+ * UST. Fields need to be only added at the end, never reordered, never
+ * removed.
+ *
+ * The field @struct_size should be used to determine the size of the
+ * structure. It should be queried before using additional fields added
+ * at the end of the structure.
+ */
+
+struct lttng_ust_ctx_value {
+ uint32_t struct_size;
+
enum lttng_ust_dynamic_type sel;
union {
int64_t s64;
const char *str;
double d;
} u;
+
+ /* End of base ABI. Fields below should be used after checking struct_size. */
};
-struct lttng_perf_counter_field;
+/*
+ * Context field
+ *
+ * IMPORTANT: this structure is part of the ABI between the probe and
+ * UST. Fields need to be only added at the end, never reordered, never
+ * removed.
+ *
+ * The field @struct_size should be used to determine the size of the
+ * structure. It should be queried before using additional fields added
+ * at the end of the structure.
+ */
+
+struct lttng_ust_ctx_field {
+ uint32_t struct_size;
+ void *priv;
-#define LTTNG_UST_CTX_FIELD_PADDING 40
-struct lttng_ctx_field {
- struct lttng_ust_event_field event_field;
- size_t (*get_size)(struct lttng_ctx_field *field, size_t offset);
- void (*record)(struct lttng_ctx_field *field,
+ struct lttng_ust_event_field *event_field;
+ size_t (*get_size)(struct lttng_ust_ctx_field *field, size_t offset);
+ void (*record)(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan);
- void (*get_value)(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value);
- union {
- struct lttng_perf_counter_field *perf_counter;
- char padding[LTTNG_UST_CTX_FIELD_PADDING];
- } u;
- void (*destroy)(struct lttng_ctx_field *field);
+ void (*get_value)(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value);
+ void (*destroy)(struct lttng_ust_ctx_field *field);
char *field_name; /* Has ownership, dynamically allocated. */
+
+ /* End of base ABI. Fields below should be used after checking struct_size. */
};
-#define LTTNG_UST_CTX_PADDING 20
-struct lttng_ctx {
- struct lttng_ctx_field *fields;
+/*
+ * All context fields for a given event/channel
+ *
+ * IMPORTANT: this structure is part of the ABI between the probe and
+ * UST. Fields need to be only added at the end, never reordered, never
+ * removed.
+ *
+ * The field @struct_size should be used to determine the size of the
+ * structure. It should be queried before using additional fields added
+ * at the end of the structure.
+ */
+
+struct lttng_ust_ctx {
+ uint32_t struct_size;
+
+ struct lttng_ust_ctx_field **fields;
unsigned int nr_fields;
unsigned int allocated_fields;
unsigned int largest_align;
- char padding[LTTNG_UST_CTX_PADDING];
+
+ /* End of base ABI. Fields below should be used after checking struct_size. */
};
+/*
+ * Context provider
+ *
+ * IMPORTANT: this structure is part of the ABI between the probe and
+ * UST. Fields need to be only added at the end, never reordered, never
+ * removed.
+ *
+ * The field @struct_size should be used to determine the size of the
+ * structure. It should be queried before using additional fields added
+ * at the end of the structure.
+ */
+
struct lttng_ust_context_provider {
+ uint32_t struct_size;
+
char *name;
- size_t (*get_size)(struct lttng_ctx_field *field, size_t offset);
- void (*record)(struct lttng_ctx_field *field,
+ size_t (*get_size)(struct lttng_ust_ctx_field *field, size_t offset);
+ void (*record)(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan);
- void (*get_value)(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value);
+ void (*get_value)(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value);
struct cds_hlist_node node;
+
+ /* End of base ABI. Fields below should be used after checking struct_size. */
};
int lttng_ust_context_provider_register(struct lttng_ust_context_provider *provider);
void lttng_ust_context_provider_unregister(struct lttng_ust_context_provider *provider);
void lttng_ust_context_set_session_provider(const char *name,
- size_t (*get_size)(struct lttng_ctx_field *field, size_t offset),
- void (*record)(struct lttng_ctx_field *field,
+ size_t (*get_size)(struct lttng_ust_ctx_field *field, size_t offset),
+ void (*record)(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan),
- void (*get_value)(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value));
+ void (*get_value)(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value));
-int lttng_ust_add_app_context_to_ctx_rcu(const char *name, struct lttng_ctx **ctx);
-int lttng_ust_context_set_provider_rcu(struct lttng_ctx **_ctx,
+int lttng_ust_add_app_context_to_ctx_rcu(const char *name, struct lttng_ust_ctx **ctx);
+int lttng_ust_context_set_provider_rcu(struct lttng_ust_ctx **_ctx,
const char *name,
- size_t (*get_size)(struct lttng_ctx_field *field, size_t offset),
- void (*record)(struct lttng_ctx_field *field,
+ size_t (*get_size)(struct lttng_ust_ctx_field *field, size_t offset),
+ void (*record)(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan),
- void (*get_value)(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value));
+ void (*get_value)(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value));
#endif /* _LTTNG_UST_CONTEXT_PROVIDER_H */
static
ssize_t count_ctx_fields_recursive(size_t nr_fields,
- const struct lttng_ctx_field *lttng_fields)
+ struct lttng_ust_ctx_field **lttng_fields)
{
int i;
ssize_t ret, count = 0;
for (i = 0; i < nr_fields; i++) {
const struct lttng_ust_event_field *lf;
- lf = <tng_fields[i].event_field;
+ lf = lttng_fields[i]->event_field;
/* skip 'nowrite' fields */
if (lf->nowrite)
continue;
size_t *_nr_write_fields,
struct ustctl_field **ustctl_fields,
size_t nr_fields,
- const struct lttng_ctx_field *lttng_fields)
+ struct lttng_ust_ctx_field **lttng_fields)
{
struct ustctl_field *fields;
int ret;
for (i = 0; i < nr_fields; i++) {
ret = serialize_one_field(session, fields, &iter_output,
- <tng_fields[i].event_field);
+ lttng_fields[i]->event_field);
if (ret)
goto error_type;
}
int session_objd, /* session descriptor */
int channel_objd, /* channel descriptor */
size_t nr_ctx_fields,
- const struct lttng_ctx_field *ctx_fields,
+ struct lttng_ust_ctx_field **ctx_fields,
uint32_t *chan_id, /* channel id (output) */
int *header_type) /* header type (output) */
{
return NULL;
}
-static size_t get_size_cb(struct lttng_ctx_field *field, size_t offset)
+static size_t get_size_cb(struct lttng_ust_ctx_field *field, size_t offset)
{
struct lttng_ust_jni_ctx_entry *jctx;
size_t size = 0;
}
-static void record_cb(struct lttng_ctx_field *field,
+static void record_cb(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
}
-static void get_value_cb(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value)
+static void get_value_cb(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value)
{
struct lttng_ust_jni_ctx_entry *jctx;
const char *ctx_name = field->event_field.name;
if (!provider) {
goto error_provider;
}
+ provider->struct_size = sizeof(*provider);
provider->name = provider_name_cstr;
provider->get_size = get_size_cb;
provider->record = record_cb;
#include "ust-context-provider.h"
__attribute__((visibility("hidden")))
-int lttng_context_init_all(struct lttng_ctx **ctx);
+int lttng_context_init_all(struct lttng_ust_ctx **ctx);
__attribute__((visibility("hidden")))
int lttng_attach_context(struct lttng_ust_abi_context *context_param,
union lttng_ust_abi_args *uargs,
- struct lttng_ctx **ctx, struct lttng_session *session);
+ struct lttng_ust_ctx **ctx, struct lttng_session *session);
__attribute__((visibility("hidden")))
-int lttng_find_context(struct lttng_ctx *ctx, const char *name);
+int lttng_find_context(struct lttng_ust_ctx *ctx, const char *name);
__attribute__((visibility("hidden")))
-int lttng_get_context_index(struct lttng_ctx *ctx, const char *name);
+int lttng_get_context_index(struct lttng_ust_ctx *ctx, const char *name);
__attribute__((visibility("hidden")))
-struct lttng_ctx_field *lttng_append_context(struct lttng_ctx **ctx_p);
+struct lttng_ust_ctx_field *lttng_append_context(struct lttng_ust_ctx **ctx_p);
__attribute__((visibility("hidden")))
-void lttng_context_update(struct lttng_ctx *ctx);
+void lttng_context_update(struct lttng_ust_ctx *ctx);
__attribute__((visibility("hidden")))
-void lttng_remove_context_field(struct lttng_ctx **ctx_p,
- struct lttng_ctx_field *field);
+void lttng_remove_context_field(struct lttng_ust_ctx **ctx_p,
+ struct lttng_ust_ctx_field *field);
__attribute__((visibility("hidden")))
-void lttng_destroy_context(struct lttng_ctx *ctx);
+void lttng_destroy_context(struct lttng_ust_ctx *ctx);
__attribute__((visibility("hidden")))
-int lttng_context_add_rcu(struct lttng_ctx **ctx_p,
- const struct lttng_ctx_field *f);
+int lttng_context_add_rcu(struct lttng_ust_ctx **ctx_p,
+ struct lttng_ust_ctx_field *f);
__attribute__((visibility("hidden")))
int lttng_context_is_app(const char *name);
void lttng_context_vsgid_reset(void);
__attribute__((visibility("hidden")))
-int lttng_add_vtid_to_ctx(struct lttng_ctx **ctx);
+int lttng_add_vtid_to_ctx(struct lttng_ust_ctx **ctx);
__attribute__((visibility("hidden")))
-int lttng_add_vpid_to_ctx(struct lttng_ctx **ctx);
+int lttng_add_vpid_to_ctx(struct lttng_ust_ctx **ctx);
__attribute__((visibility("hidden")))
-int lttng_add_pthread_id_to_ctx(struct lttng_ctx **ctx);
+int lttng_add_pthread_id_to_ctx(struct lttng_ust_ctx **ctx);
__attribute__((visibility("hidden")))
-int lttng_add_procname_to_ctx(struct lttng_ctx **ctx);
+int lttng_add_procname_to_ctx(struct lttng_ust_ctx **ctx);
__attribute__((visibility("hidden")))
-int lttng_add_ip_to_ctx(struct lttng_ctx **ctx);
+int lttng_add_ip_to_ctx(struct lttng_ust_ctx **ctx);
__attribute__((visibility("hidden")))
-int lttng_add_cpu_id_to_ctx(struct lttng_ctx **ctx);
+int lttng_add_cpu_id_to_ctx(struct lttng_ust_ctx **ctx);
__attribute__((visibility("hidden")))
-int lttng_add_dyntest_to_ctx(struct lttng_ctx **ctx);
+int lttng_add_dyntest_to_ctx(struct lttng_ust_ctx **ctx);
__attribute__((visibility("hidden")))
-int lttng_add_cgroup_ns_to_ctx(struct lttng_ctx **ctx);
+int lttng_add_cgroup_ns_to_ctx(struct lttng_ust_ctx **ctx);
__attribute__((visibility("hidden")))
-int lttng_add_ipc_ns_to_ctx(struct lttng_ctx **ctx);
+int lttng_add_ipc_ns_to_ctx(struct lttng_ust_ctx **ctx);
__attribute__((visibility("hidden")))
-int lttng_add_mnt_ns_to_ctx(struct lttng_ctx **ctx);
+int lttng_add_mnt_ns_to_ctx(struct lttng_ust_ctx **ctx);
__attribute__((visibility("hidden")))
-int lttng_add_net_ns_to_ctx(struct lttng_ctx **ctx);
+int lttng_add_net_ns_to_ctx(struct lttng_ust_ctx **ctx);
__attribute__((visibility("hidden")))
-int lttng_add_pid_ns_to_ctx(struct lttng_ctx **ctx);
+int lttng_add_pid_ns_to_ctx(struct lttng_ust_ctx **ctx);
__attribute__((visibility("hidden")))
-int lttng_add_user_ns_to_ctx(struct lttng_ctx **ctx);
+int lttng_add_user_ns_to_ctx(struct lttng_ust_ctx **ctx);
__attribute__((visibility("hidden")))
-int lttng_add_uts_ns_to_ctx(struct lttng_ctx **ctx);
+int lttng_add_uts_ns_to_ctx(struct lttng_ust_ctx **ctx);
__attribute__((visibility("hidden")))
-int lttng_add_time_ns_to_ctx(struct lttng_ctx **ctx);
+int lttng_add_time_ns_to_ctx(struct lttng_ust_ctx **ctx);
__attribute__((visibility("hidden")))
-int lttng_add_vuid_to_ctx(struct lttng_ctx **ctx);
+int lttng_add_vuid_to_ctx(struct lttng_ust_ctx **ctx);
__attribute__((visibility("hidden")))
-int lttng_add_veuid_to_ctx(struct lttng_ctx **ctx);
+int lttng_add_veuid_to_ctx(struct lttng_ust_ctx **ctx);
__attribute__((visibility("hidden")))
-int lttng_add_vsuid_to_ctx(struct lttng_ctx **ctx);
+int lttng_add_vsuid_to_ctx(struct lttng_ust_ctx **ctx);
__attribute__((visibility("hidden")))
-int lttng_add_vgid_to_ctx(struct lttng_ctx **ctx);
+int lttng_add_vgid_to_ctx(struct lttng_ust_ctx **ctx);
__attribute__((visibility("hidden")))
-int lttng_add_vegid_to_ctx(struct lttng_ctx **ctx);
+int lttng_add_vegid_to_ctx(struct lttng_ust_ctx **ctx);
__attribute__((visibility("hidden")))
-int lttng_add_vsgid_to_ctx(struct lttng_ctx **ctx);
+int lttng_add_vsgid_to_ctx(struct lttng_ust_ctx **ctx);
#endif /* _LTTNG_UST_CONTEXT_INTERNAL_H */
__attribute__((visibility("hidden")))
void lttng_ust_context_set_event_notifier_group_provider(const char *name,
- size_t (*get_size)(struct lttng_ctx_field *field, size_t offset),
- void (*record)(struct lttng_ctx_field *field,
+ size_t (*get_size)(struct lttng_ust_ctx_field *field, size_t offset),
+ void (*record)(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan),
- void (*get_value)(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value));
+ void (*get_value)(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value));
#endif /* _LTTNG_UST_CONTEXT_PROVIDER_INTERNAL_H */
#define IS_INTEGER_REGISTER(reg_type) \
(reg_type == REG_U64 || reg_type == REG_S64)
-static int context_get_index(struct lttng_ctx *ctx,
+static int context_get_index(struct lttng_ust_ctx *ctx,
struct load_ptr *ptr,
uint32_t idx)
{
- struct lttng_ctx_field *ctx_field;
+ struct lttng_ust_ctx_field *ctx_field;
struct lttng_ust_event_field *field;
- struct lttng_ctx_value v;
+ struct lttng_ust_ctx_value v;
- ctx_field = &ctx->fields[idx];
- field = &ctx_field->event_field;
+ v.struct_size = sizeof(struct lttng_ust_ctx_value);
+ ctx_field = ctx->fields[idx];
+ field = ctx_field->event_field;
ptr->type = LOAD_OBJECT;
ptr->field = field;
return 0;
}
-static int dynamic_get_index(struct lttng_ctx *ctx,
+static int dynamic_get_index(struct lttng_ust_ctx *ctx,
struct bytecode_runtime *runtime,
uint64_t index, struct estack_entry *stack_top)
{
struct lttng_interpreter_output *output)
{
struct bytecode_runtime *bytecode = interpreter_data;
- struct lttng_ctx *ctx = lttng_ust_rcu_dereference(*bytecode->p.priv->pctx);
+ struct lttng_ust_ctx *ctx = lttng_ust_rcu_dereference(*bytecode->p.priv->pctx);
void *pc, *next_pc, *start_pc;
int ret = -EINVAL;
uint64_t retval = 0;
{
struct load_op *insn = (struct load_op *) pc;
struct field_ref *ref = (struct field_ref *) insn->data;
- struct lttng_ctx_field *ctx_field;
- struct lttng_ctx_value v;
+ struct lttng_ust_ctx_field *ctx_field;
+ struct lttng_ust_ctx_value v;
+ v.struct_size = sizeof(struct lttng_ust_ctx_value);
dbg_printf("get context ref offset %u type dynamic\n",
ref->offset);
- ctx_field = &ctx->fields[ref->offset];
+ ctx_field = ctx->fields[ref->offset];
ctx_field->get_value(ctx_field, &v);
estack_push(stack, top, ax, bx, ax_t, bx_t);
switch (v.sel) {
{
struct load_op *insn = (struct load_op *) pc;
struct field_ref *ref = (struct field_ref *) insn->data;
- struct lttng_ctx_field *ctx_field;
- struct lttng_ctx_value v;
+ struct lttng_ust_ctx_field *ctx_field;
+ struct lttng_ust_ctx_value v;
+ v.struct_size = sizeof(struct lttng_ust_ctx_value);
dbg_printf("get context ref offset %u type string\n",
ref->offset);
- ctx_field = &ctx->fields[ref->offset];
+ ctx_field = ctx->fields[ref->offset];
ctx_field->get_value(ctx_field, &v);
estack_push(stack, top, ax, bx, ax_t, bx_t);
estack_ax(stack, top)->u.s.str = v.u.str;
{
struct load_op *insn = (struct load_op *) pc;
struct field_ref *ref = (struct field_ref *) insn->data;
- struct lttng_ctx_field *ctx_field;
- struct lttng_ctx_value v;
+ struct lttng_ust_ctx_field *ctx_field;
+ struct lttng_ust_ctx_value v;
+ v.struct_size = sizeof(struct lttng_ust_ctx_value);
dbg_printf("get context ref offset %u type s64\n",
ref->offset);
- ctx_field = &ctx->fields[ref->offset];
+ ctx_field = ctx->fields[ref->offset];
ctx_field->get_value(ctx_field, &v);
estack_push(stack, top, ax, bx, ax_t, bx_t);
estack_ax_v = v.u.s64;
{
struct load_op *insn = (struct load_op *) pc;
struct field_ref *ref = (struct field_ref *) insn->data;
- struct lttng_ctx_field *ctx_field;
- struct lttng_ctx_value v;
+ struct lttng_ust_ctx_field *ctx_field;
+ struct lttng_ust_ctx_value v;
+ v.struct_size = sizeof(struct lttng_ust_ctx_value);
dbg_printf("get context ref offset %u type double\n",
ref->offset);
- ctx_field = &ctx->fields[ref->offset];
+ ctx_field = ctx->fields[ref->offset];
ctx_field->get_value(ctx_field, &v);
estack_push(stack, top, ax, bx, ax_t, bx_t);
memcpy(&estack_ax(stack, top)->u.d, &v.u.d, sizeof(struct literal_double));
return ret;
}
-static int specialize_context_lookup_name(struct lttng_ctx *ctx,
+static int specialize_context_lookup_name(struct lttng_ust_ctx *ctx,
struct bytecode_runtime *bytecode,
struct load_op *insn)
{
return 0;
}
-static int specialize_context_lookup(struct lttng_ctx *ctx,
+static int specialize_context_lookup(struct lttng_ust_ctx *ctx,
struct bytecode_runtime *runtime,
struct load_op *insn,
struct vstack_load *load)
{
int idx, ret;
- struct lttng_ctx_field *ctx_field;
+ struct lttng_ust_ctx_field *ctx_field;
struct lttng_ust_event_field *field;
struct bytecode_get_index_data gid;
ssize_t data_offset;
if (idx < 0) {
return -ENOENT;
}
- ctx_field = &ctx->fields[idx];
- field = &ctx_field->event_field;
+ ctx_field = ctx->fields[idx];
+ field = ctx_field->event_field;
ret = specialize_load_object(field, load, true);
if (ret)
return ret;
return 0;
}
-static int specialize_app_context_lookup(struct lttng_ctx **pctx,
+static int specialize_app_context_lookup(struct lttng_ust_ctx **pctx,
struct bytecode_runtime *runtime,
struct load_op *insn,
struct vstack_load *load)
const char *orig_name;
char *name = NULL;
int idx, ret;
- struct lttng_ctx_field *ctx_field;
+ struct lttng_ust_ctx_field *ctx_field;
struct lttng_ust_event_field *field;
struct bytecode_get_index_data gid;
ssize_t data_offset;
if (idx < 0)
return -ENOENT;
}
- ctx_field = &(*pctx)->fields[idx];
- field = &ctx_field->event_field;
+ ctx_field = (*pctx)->fields[idx];
+ field = ctx_field->event_field;
ret = specialize_load_object(field, load, true);
if (ret)
goto end;
int ret = -EINVAL;
struct vstack _stack;
struct vstack *stack = &_stack;
- struct lttng_ctx **pctx = bytecode->p.priv->pctx;
+ struct lttng_ust_ctx **pctx = bytecode->p.priv->pctx;
vstack_init(stack);
enum bytecode_op bytecode_op)
{
struct load_op *op;
- struct lttng_ctx_field *ctx_field;
+ struct lttng_ust_ctx_field *ctx_field;
int idx;
- struct lttng_ctx **pctx = runtime->p.priv->pctx;
+ struct lttng_ust_ctx **pctx = runtime->p.priv->pctx;
dbg_printf("Apply context reloc: %u %s\n", reloc_offset, context_name);
return -EINVAL;
/* Get context return type */
- ctx_field = &(*pctx)->fields[idx];
+ ctx_field = (*pctx)->fields[idx];
op = (struct load_op *) &runtime->code[reloc_offset];
switch (bytecode_op) {
struct field_ref *field_ref;
field_ref = (struct field_ref *) op->data;
- switch (ctx_field->event_field.type.atype) {
+ switch (ctx_field->event_field->type.atype) {
case atype_integer:
case atype_enum_nestable:
op->op = BYTECODE_OP_GET_CONTEXT_REF_S64;
*/
static
int link_bytecode(const struct lttng_ust_event_desc *event_desc,
- struct lttng_ctx **ctx,
+ struct lttng_ust_ctx **ctx,
struct lttng_ust_bytecode_node *bytecode,
struct cds_list_head *bytecode_runtime_head,
struct cds_list_head *insert_loc)
* instance are name matching (or glob pattern matching).
*/
void lttng_enabler_link_bytecode(const struct lttng_ust_event_desc *event_desc,
- struct lttng_ctx **ctx,
+ struct lttng_ust_ctx **ctx,
struct cds_list_head *instance_bytecode_head,
struct cds_list_head *enabler_bytecode_head)
{
}
static
-size_t cgroup_ns_get_size(struct lttng_ctx_field *field, size_t offset)
+size_t cgroup_ns_get_size(struct lttng_ust_ctx_field *field, size_t offset)
{
size_t size = 0;
}
static
-void cgroup_ns_record(struct lttng_ctx_field *field,
+void cgroup_ns_record(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void cgroup_ns_get_value(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value)
+void cgroup_ns_get_value(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value)
{
value->u.s64 = get_cgroup_ns();
}
-int lttng_add_cgroup_ns_to_ctx(struct lttng_ctx **ctx)
+int lttng_add_cgroup_ns_to_ctx(struct lttng_ust_ctx **ctx)
{
- struct lttng_ctx_field *field;
+ struct lttng_ust_ctx_field *field;
field = lttng_append_context(ctx);
if (!field)
lttng_remove_context_field(ctx, field);
return -EEXIST;
}
- field->event_field.name = "cgroup_ns";
- field->event_field.type.atype = atype_integer;
- field->event_field.type.u.integer.size = sizeof(ino_t) * CHAR_BIT;
- field->event_field.type.u.integer.alignment = lttng_alignof(ino_t) * CHAR_BIT;
- field->event_field.type.u.integer.signedness = lttng_is_signed_type(ino_t);
- field->event_field.type.u.integer.reverse_byte_order = 0;
- field->event_field.type.u.integer.base = 10;
- field->event_field.type.u.integer.encoding = lttng_encode_none;
+ field->event_field->name = "cgroup_ns";
+ field->event_field->type.atype = atype_integer;
+ field->event_field->type.u.integer.size = sizeof(ino_t) * CHAR_BIT;
+ field->event_field->type.u.integer.alignment = lttng_alignof(ino_t) * CHAR_BIT;
+ field->event_field->type.u.integer.signedness = lttng_is_signed_type(ino_t);
+ field->event_field->type.u.integer.reverse_byte_order = 0;
+ field->event_field->type.u.integer.base = 10;
+ field->event_field->type.u.integer.encoding = lttng_encode_none;
field->get_size = cgroup_ns_get_size;
field->record = cgroup_ns_record;
field->get_value = cgroup_ns_get_value;
#include "context-internal.h"
static
-size_t cpu_id_get_size(struct lttng_ctx_field *field, size_t offset)
+size_t cpu_id_get_size(struct lttng_ust_ctx_field *field, size_t offset)
{
size_t size = 0;
}
static
-void cpu_id_record(struct lttng_ctx_field *field,
+void cpu_id_record(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void cpu_id_get_value(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value)
+void cpu_id_get_value(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value)
{
value->u.s64 = lttng_ust_get_cpu();
}
-int lttng_add_cpu_id_to_ctx(struct lttng_ctx **ctx)
+int lttng_add_cpu_id_to_ctx(struct lttng_ust_ctx **ctx)
{
- struct lttng_ctx_field *field;
+ struct lttng_ust_ctx_field *field;
field = lttng_append_context(ctx);
if (!field)
lttng_remove_context_field(ctx, field);
return -EEXIST;
}
- field->event_field.name = "cpu_id";
- field->event_field.type.atype = atype_integer;
- field->event_field.type.u.integer.size = sizeof(int) * CHAR_BIT;
- field->event_field.type.u.integer.alignment = lttng_alignof(int) * CHAR_BIT;
- field->event_field.type.u.integer.signedness = lttng_is_signed_type(int);
- field->event_field.type.u.integer.reverse_byte_order = 0;
- field->event_field.type.u.integer.base = 10;
- field->event_field.type.u.integer.encoding = lttng_encode_none;
+ field->event_field->name = "cpu_id";
+ field->event_field->type.atype = atype_integer;
+ field->event_field->type.u.integer.size = sizeof(int) * CHAR_BIT;
+ field->event_field->type.u.integer.alignment = lttng_alignof(int) * CHAR_BIT;
+ field->event_field->type.u.integer.signedness = lttng_is_signed_type(int);
+ field->event_field->type.u.integer.reverse_byte_order = 0;
+ field->event_field->type.u.integer.base = 10;
+ field->event_field->type.u.integer.encoding = lttng_encode_none;
field->get_size = cpu_id_get_size;
field->record = cpu_id_record;
field->get_value = cpu_id_get_value;
#include "context-internal.h"
static
-size_t ip_get_size(struct lttng_ctx_field *field, size_t offset)
+size_t ip_get_size(struct lttng_ust_ctx_field *field, size_t offset)
{
size_t size = 0;
}
static
-void ip_record(struct lttng_ctx_field *field,
+void ip_record(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
chan->ops->event_write(ctx, &ip, sizeof(ip));
}
-int lttng_add_ip_to_ctx(struct lttng_ctx **ctx)
+int lttng_add_ip_to_ctx(struct lttng_ust_ctx **ctx)
{
- struct lttng_ctx_field *field;
+ struct lttng_ust_ctx_field *field;
field = lttng_append_context(ctx);
if (!field)
lttng_remove_context_field(ctx, field);
return -EEXIST;
}
- field->event_field.name = "ip";
- field->event_field.type.atype = atype_integer;
- field->event_field.type.u.integer.size = sizeof(void *) * CHAR_BIT;
- field->event_field.type.u.integer.alignment = lttng_alignof(void *) * CHAR_BIT;
- field->event_field.type.u.integer.signedness = lttng_is_signed_type(void *);
- field->event_field.type.u.integer.reverse_byte_order = 0;
- field->event_field.type.u.integer.base = 16;
- field->event_field.type.u.integer.encoding = lttng_encode_none;
+ field->event_field->name = "ip";
+ field->event_field->type.atype = atype_integer;
+ field->event_field->type.u.integer.size = sizeof(void *) * CHAR_BIT;
+ field->event_field->type.u.integer.alignment = lttng_alignof(void *) * CHAR_BIT;
+ field->event_field->type.u.integer.signedness = lttng_is_signed_type(void *);
+ field->event_field->type.u.integer.reverse_byte_order = 0;
+ field->event_field->type.u.integer.base = 16;
+ field->event_field->type.u.integer.encoding = lttng_encode_none;
field->get_size = ip_get_size;
field->record = ip_record;
lttng_context_update(*ctx);
}
static
-size_t ipc_ns_get_size(struct lttng_ctx_field *field, size_t offset)
+size_t ipc_ns_get_size(struct lttng_ust_ctx_field *field, size_t offset)
{
size_t size = 0;
}
static
-void ipc_ns_record(struct lttng_ctx_field *field,
+void ipc_ns_record(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void ipc_ns_get_value(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value)
+void ipc_ns_get_value(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value)
{
value->u.s64 = get_ipc_ns();
}
-int lttng_add_ipc_ns_to_ctx(struct lttng_ctx **ctx)
+int lttng_add_ipc_ns_to_ctx(struct lttng_ust_ctx **ctx)
{
- struct lttng_ctx_field *field;
+ struct lttng_ust_ctx_field *field;
field = lttng_append_context(ctx);
if (!field)
lttng_remove_context_field(ctx, field);
return -EEXIST;
}
- field->event_field.name = "ipc_ns";
- field->event_field.type.atype = atype_integer;
- field->event_field.type.u.integer.size = sizeof(ino_t) * CHAR_BIT;
- field->event_field.type.u.integer.alignment = lttng_alignof(ino_t) * CHAR_BIT;
- field->event_field.type.u.integer.signedness = lttng_is_signed_type(ino_t);
- field->event_field.type.u.integer.reverse_byte_order = 0;
- field->event_field.type.u.integer.base = 10;
- field->event_field.type.u.integer.encoding = lttng_encode_none;
+ field->event_field->name = "ipc_ns";
+ field->event_field->type.atype = atype_integer;
+ field->event_field->type.u.integer.size = sizeof(ino_t) * CHAR_BIT;
+ field->event_field->type.u.integer.alignment = lttng_alignof(ino_t) * CHAR_BIT;
+ field->event_field->type.u.integer.signedness = lttng_is_signed_type(ino_t);
+ field->event_field->type.u.integer.reverse_byte_order = 0;
+ field->event_field->type.u.integer.base = 10;
+ field->event_field->type.u.integer.encoding = lttng_encode_none;
field->get_size = ipc_ns_get_size;
field->record = ipc_ns_record;
field->get_value = ipc_ns_get_value;
}
static
-size_t mnt_ns_get_size(struct lttng_ctx_field *field, size_t offset)
+size_t mnt_ns_get_size(struct lttng_ust_ctx_field *field, size_t offset)
{
size_t size = 0;
}
static
-void mnt_ns_record(struct lttng_ctx_field *field,
+void mnt_ns_record(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void mnt_ns_get_value(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value)
+void mnt_ns_get_value(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value)
{
value->u.s64 = get_mnt_ns();
}
-int lttng_add_mnt_ns_to_ctx(struct lttng_ctx **ctx)
+int lttng_add_mnt_ns_to_ctx(struct lttng_ust_ctx **ctx)
{
- struct lttng_ctx_field *field;
+ struct lttng_ust_ctx_field *field;
field = lttng_append_context(ctx);
if (!field)
lttng_remove_context_field(ctx, field);
return -EEXIST;
}
- field->event_field.name = "mnt_ns";
- field->event_field.type.atype = atype_integer;
- field->event_field.type.u.integer.size = sizeof(ino_t) * CHAR_BIT;
- field->event_field.type.u.integer.alignment = lttng_alignof(ino_t) * CHAR_BIT;
- field->event_field.type.u.integer.signedness = lttng_is_signed_type(ino_t);
- field->event_field.type.u.integer.reverse_byte_order = 0;
- field->event_field.type.u.integer.base = 10;
- field->event_field.type.u.integer.encoding = lttng_encode_none;
+ field->event_field->name = "mnt_ns";
+ field->event_field->type.atype = atype_integer;
+ field->event_field->type.u.integer.size = sizeof(ino_t) * CHAR_BIT;
+ field->event_field->type.u.integer.alignment = lttng_alignof(ino_t) * CHAR_BIT;
+ field->event_field->type.u.integer.signedness = lttng_is_signed_type(ino_t);
+ field->event_field->type.u.integer.reverse_byte_order = 0;
+ field->event_field->type.u.integer.base = 10;
+ field->event_field->type.u.integer.encoding = lttng_encode_none;
field->get_size = mnt_ns_get_size;
field->record = mnt_ns_record;
field->get_value = mnt_ns_get_value;
}
static
-size_t net_ns_get_size(struct lttng_ctx_field *field, size_t offset)
+size_t net_ns_get_size(struct lttng_ust_ctx_field *field, size_t offset)
{
size_t size = 0;
}
static
-void net_ns_record(struct lttng_ctx_field *field,
+void net_ns_record(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void net_ns_get_value(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value)
+void net_ns_get_value(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value)
{
value->u.s64 = get_net_ns();
}
-int lttng_add_net_ns_to_ctx(struct lttng_ctx **ctx)
+int lttng_add_net_ns_to_ctx(struct lttng_ust_ctx **ctx)
{
- struct lttng_ctx_field *field;
+ struct lttng_ust_ctx_field *field;
field = lttng_append_context(ctx);
if (!field)
lttng_remove_context_field(ctx, field);
return -EEXIST;
}
- field->event_field.name = "net_ns";
- field->event_field.type.atype = atype_integer;
- field->event_field.type.u.integer.size = sizeof(ino_t) * CHAR_BIT;
- field->event_field.type.u.integer.alignment = lttng_alignof(ino_t) * CHAR_BIT;
- field->event_field.type.u.integer.signedness = lttng_is_signed_type(ino_t);
- field->event_field.type.u.integer.reverse_byte_order = 0;
- field->event_field.type.u.integer.base = 10;
- field->event_field.type.u.integer.encoding = lttng_encode_none;
+ field->event_field->name = "net_ns";
+ field->event_field->type.atype = atype_integer;
+ field->event_field->type.u.integer.size = sizeof(ino_t) * CHAR_BIT;
+ field->event_field->type.u.integer.alignment = lttng_alignof(ino_t) * CHAR_BIT;
+ field->event_field->type.u.integer.signedness = lttng_is_signed_type(ino_t);
+ field->event_field->type.u.integer.reverse_byte_order = 0;
+ field->event_field->type.u.integer.base = 10;
+ field->event_field->type.u.integer.encoding = lttng_encode_none;
field->get_size = net_ns_get_size;
field->record = net_ns_record;
field->get_value = net_ns_get_value;
}
static
-size_t perf_counter_get_size(struct lttng_ctx_field *field, size_t offset)
+size_t perf_counter_get_size(struct lttng_ust_ctx_field *field, size_t offset)
{
size_t size = 0;
}
static
-uint64_t wrapper_perf_counter_read(struct lttng_ctx_field *field)
+uint64_t wrapper_perf_counter_read(struct lttng_ust_ctx_field *field)
{
struct lttng_perf_counter_field *perf_field;
struct lttng_perf_counter_thread_field *perf_thread_field;
- perf_field = field->u.perf_counter;
+ perf_field = (struct lttng_perf_counter_field *) field->priv;
perf_thread_field = get_thread_field(perf_field);
return arch_read_perf_counter(perf_thread_field);
}
static
-void perf_counter_record(struct lttng_ctx_field *field,
+void perf_counter_record(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void perf_counter_get_value(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value)
+void perf_counter_get_value(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value)
{
value->u.s64 = wrapper_perf_counter_read(field);
}
/* Called with UST lock held */
static
-void lttng_destroy_perf_counter_field(struct lttng_ctx_field *field)
+void lttng_destroy_perf_counter_field(struct lttng_ust_ctx_field *field)
{
struct lttng_perf_counter_field *perf_field;
struct lttng_perf_counter_thread_field *pos, *p;
- free((char *) field->event_field.name);
- perf_field = field->u.perf_counter;
+ free((char *) field->event_field->name);
+ perf_field = (struct lttng_perf_counter_field *) field->priv;
/*
* This put is performed when no threads can concurrently
* perform a "get" concurrently, thanks to urcu-bp grace
int lttng_add_perf_counter_to_ctx(uint32_t type,
uint64_t config,
const char *name,
- struct lttng_ctx **ctx)
+ struct lttng_ust_ctx **ctx)
{
- struct lttng_ctx_field *field;
+ struct lttng_ust_ctx_field *field;
struct lttng_perf_counter_field *perf_field;
char *name_alloc;
int ret;
field->destroy = lttng_destroy_perf_counter_field;
- field->event_field.name = name_alloc;
- field->event_field.type.atype = atype_integer;
- field->event_field.type.u.integer.size =
+ field->event_field->name = name_alloc;
+ field->event_field->type.atype = atype_integer;
+ field->event_field->type.u.integer.size =
sizeof(uint64_t) * CHAR_BIT;
- field->event_field.type.u.integer.alignment =
+ field->event_field->type.u.integer.alignment =
lttng_alignof(uint64_t) * CHAR_BIT;
- field->event_field.type.u.integer.signedness =
+ field->event_field->type.u.integer.signedness =
lttng_is_signed_type(uint64_t);
- field->event_field.type.u.integer.reverse_byte_order = 0;
- field->event_field.type.u.integer.base = 10;
- field->event_field.type.u.integer.encoding = lttng_encode_none;
+ field->event_field->type.u.integer.reverse_byte_order = 0;
+ field->event_field->type.u.integer.base = 10;
+ field->event_field->type.u.integer.encoding = lttng_encode_none;
field->get_size = perf_counter_get_size;
field->record = perf_counter_record;
field->get_value = perf_counter_get_value;
perf_field->attr.config = config;
perf_field->attr.exclude_kernel = perf_get_exclude_kernel();
CDS_INIT_LIST_HEAD(&perf_field->thread_field_list);
- field->u.perf_counter = perf_field;
+ field->priv = perf_field;
/* Ensure that this perf counter can be used in this process. */
ret = open_perf_fd(&perf_field->attr);
}
static
-size_t pid_ns_get_size(struct lttng_ctx_field *field, size_t offset)
+size_t pid_ns_get_size(struct lttng_ust_ctx_field *field, size_t offset)
{
size_t size = 0;
}
static
-void pid_ns_record(struct lttng_ctx_field *field,
+void pid_ns_record(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void pid_ns_get_value(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value)
+void pid_ns_get_value(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value)
{
value->u.s64 = get_pid_ns();
}
-int lttng_add_pid_ns_to_ctx(struct lttng_ctx **ctx)
+int lttng_add_pid_ns_to_ctx(struct lttng_ust_ctx **ctx)
{
- struct lttng_ctx_field *field;
+ struct lttng_ust_ctx_field *field;
field = lttng_append_context(ctx);
if (!field)
lttng_remove_context_field(ctx, field);
return -EEXIST;
}
- field->event_field.name = "pid_ns";
- field->event_field.type.atype = atype_integer;
- field->event_field.type.u.integer.size = sizeof(ino_t) * CHAR_BIT;
- field->event_field.type.u.integer.alignment = lttng_alignof(ino_t) * CHAR_BIT;
- field->event_field.type.u.integer.signedness = lttng_is_signed_type(ino_t);
- field->event_field.type.u.integer.reverse_byte_order = 0;
- field->event_field.type.u.integer.base = 10;
- field->event_field.type.u.integer.encoding = lttng_encode_none;
+ field->event_field->name = "pid_ns";
+ field->event_field->type.atype = atype_integer;
+ field->event_field->type.u.integer.size = sizeof(ino_t) * CHAR_BIT;
+ field->event_field->type.u.integer.alignment = lttng_alignof(ino_t) * CHAR_BIT;
+ field->event_field->type.u.integer.signedness = lttng_is_signed_type(ino_t);
+ field->event_field->type.u.integer.reverse_byte_order = 0;
+ field->event_field->type.u.integer.base = 10;
+ field->event_field->type.u.integer.encoding = lttng_encode_none;
field->get_size = pid_ns_get_size;
field->record = pid_ns_record;
field->get_value = pid_ns_get_value;
}
static
-size_t procname_get_size(struct lttng_ctx_field *field, size_t offset)
+size_t procname_get_size(struct lttng_ust_ctx_field *field, size_t offset)
{
return LTTNG_UST_ABI_PROCNAME_LEN;
}
static
-void procname_record(struct lttng_ctx_field *field,
+void procname_record(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void procname_get_value(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value)
+void procname_get_value(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value)
{
value->u.str = wrapper_getprocname();
}
static const struct lttng_type procname_array_elem_type =
__type_integer(char, BYTE_ORDER, 10, UTF8);
-int lttng_add_procname_to_ctx(struct lttng_ctx **ctx)
+int lttng_add_procname_to_ctx(struct lttng_ust_ctx **ctx)
{
- struct lttng_ctx_field *field;
+ struct lttng_ust_ctx_field *field;
field = lttng_append_context(ctx);
if (!field)
lttng_remove_context_field(ctx, field);
return -EEXIST;
}
- field->event_field.name = "procname";
- field->event_field.type.atype = atype_array_nestable;
- field->event_field.type.u.array_nestable.elem_type =
+ field->event_field->name = "procname";
+ field->event_field->type.atype = atype_array_nestable;
+ field->event_field->type.u.array_nestable.elem_type =
&procname_array_elem_type;
- field->event_field.type.u.array_nestable.length = LTTNG_UST_ABI_PROCNAME_LEN;
+ field->event_field->type.u.array_nestable.length = LTTNG_UST_ABI_PROCNAME_LEN;
field->get_size = procname_get_size;
field->record = procname_record;
field->get_value = procname_get_value;
* metadata describing the context.
*/
int lttng_ust_add_app_context_to_ctx_rcu(const char *name,
- struct lttng_ctx **ctx)
+ struct lttng_ust_ctx **ctx)
{
struct lttng_ust_context_provider *provider;
- struct lttng_ctx_field new_field;
+ struct lttng_ust_ctx_field *new_field = NULL;
int ret;
if (*ctx && lttng_find_context(*ctx, name))
return -EEXIST;
- /*
- * For application context, add it by expanding
- * ctx array.
- */
- memset(&new_field, 0, sizeof(new_field));
- new_field.field_name = strdup(name);
- if (!new_field.field_name)
- return -ENOMEM;
- new_field.event_field.name = new_field.field_name;
- new_field.event_field.type.atype = atype_dynamic;
+ new_field = zmalloc(sizeof(struct lttng_ust_ctx_field));
+ if (!new_field) {
+ ret = -ENOMEM;
+ goto error_field_alloc;
+ }
+ new_field->struct_size = sizeof(struct lttng_ust_ctx_field);
+ new_field->event_field = zmalloc(sizeof(struct lttng_ust_event_field));
+ if (!new_field->event_field) {
+ ret = -ENOMEM;
+ goto error_event_field_alloc;
+ }
+ new_field->field_name = strdup(name);
+ if (!new_field->field_name) {
+ ret = -ENOMEM;
+ goto error_field_name_alloc;
+ }
+ new_field->event_field->name = new_field->field_name;
+ new_field->event_field->type.atype = atype_dynamic;
/*
* If provider is not found, we add the context anyway, but
* it will provide a dummy context.
*/
provider = lookup_provider_by_name(name);
if (provider) {
- new_field.get_size = provider->get_size;
- new_field.record = provider->record;
- new_field.get_value = provider->get_value;
+ new_field->get_size = provider->get_size;
+ new_field->record = provider->record;
+ new_field->get_value = provider->get_value;
} else {
- new_field.get_size = lttng_ust_dummy_get_size;
- new_field.record = lttng_ust_dummy_record;
- new_field.get_value = lttng_ust_dummy_get_value;
+ new_field->get_size = lttng_ust_dummy_get_size;
+ new_field->record = lttng_ust_dummy_record;
+ new_field->get_value = lttng_ust_dummy_get_value;
}
- ret = lttng_context_add_rcu(ctx, &new_field);
+ /*
+ * For application context, add it by expanding
+ * ctx array. Ownership of new_field is passed to the callee on
+ * success.
+ */
+ ret = lttng_context_add_rcu(ctx, new_field);
if (ret) {
- free(new_field.field_name);
+ free(new_field->field_name);
+ free(new_field->event_field);
+ free(new_field);
return ret;
}
return 0;
+
+error_field_name_alloc:
+ free(new_field->event_field);
+error_event_field_alloc:
+ free(new_field);
+error_field_alloc:
+ return ret;
}
#include "context-internal.h"
static
-size_t pthread_id_get_size(struct lttng_ctx_field *field, size_t offset)
+size_t pthread_id_get_size(struct lttng_ust_ctx_field *field, size_t offset)
{
size_t size = 0;
}
static
-void pthread_id_record(struct lttng_ctx_field *field,
+void pthread_id_record(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void pthread_id_get_value(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value)
+void pthread_id_get_value(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value)
{
value->u.s64 = (unsigned long) pthread_self();
}
-int lttng_add_pthread_id_to_ctx(struct lttng_ctx **ctx)
+int lttng_add_pthread_id_to_ctx(struct lttng_ust_ctx **ctx)
{
- struct lttng_ctx_field *field;
+ struct lttng_ust_ctx_field *field;
field = lttng_append_context(ctx);
if (!field)
lttng_remove_context_field(ctx, field);
return -EEXIST;
}
- field->event_field.name = "pthread_id";
- field->event_field.type.atype = atype_integer;
- field->event_field.type.u.integer.size = sizeof(unsigned long) * CHAR_BIT;
- field->event_field.type.u.integer.alignment = lttng_alignof(unsigned long) * CHAR_BIT;
- field->event_field.type.u.integer.signedness = lttng_is_signed_type(unsigned long);
- field->event_field.type.u.integer.reverse_byte_order = 0;
- field->event_field.type.u.integer.base = 10;
- field->event_field.type.u.integer.encoding = lttng_encode_none;
+ field->event_field->name = "pthread_id";
+ field->event_field->type.atype = atype_integer;
+ field->event_field->type.u.integer.size = sizeof(unsigned long) * CHAR_BIT;
+ field->event_field->type.u.integer.alignment = lttng_alignof(unsigned long) * CHAR_BIT;
+ field->event_field->type.u.integer.signedness = lttng_is_signed_type(unsigned long);
+ field->event_field->type.u.integer.reverse_byte_order = 0;
+ field->event_field->type.u.integer.base = 10;
+ field->event_field->type.u.integer.encoding = lttng_encode_none;
field->get_size = pthread_id_get_size;
field->record = pthread_id_record;
field->get_value = pthread_id_get_value;
}
static
-size_t time_ns_get_size(struct lttng_ctx_field *field, size_t offset)
+size_t time_ns_get_size(struct lttng_ust_ctx_field *field, size_t offset)
{
size_t size = 0;
}
static
-void time_ns_record(struct lttng_ctx_field *field,
+void time_ns_record(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void time_ns_get_value(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value)
+void time_ns_get_value(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value)
{
value->u.s64 = get_time_ns();
}
-int lttng_add_time_ns_to_ctx(struct lttng_ctx **ctx)
+int lttng_add_time_ns_to_ctx(struct lttng_ust_ctx **ctx)
{
- struct lttng_ctx_field *field;
+ struct lttng_ust_ctx_field *field;
field = lttng_append_context(ctx);
if (!field)
lttng_remove_context_field(ctx, field);
return -EEXIST;
}
- field->event_field.name = "time_ns";
- field->event_field.type.atype = atype_integer;
- field->event_field.type.u.integer.size = sizeof(ino_t) * CHAR_BIT;
- field->event_field.type.u.integer.alignment = lttng_alignof(ino_t) * CHAR_BIT;
- field->event_field.type.u.integer.signedness = lttng_is_signed_type(ino_t);
- field->event_field.type.u.integer.reverse_byte_order = 0;
- field->event_field.type.u.integer.base = 10;
- field->event_field.type.u.integer.encoding = lttng_encode_none;
+ field->event_field->name = "time_ns";
+ field->event_field->type.atype = atype_integer;
+ field->event_field->type.u.integer.size = sizeof(ino_t) * CHAR_BIT;
+ field->event_field->type.u.integer.alignment = lttng_alignof(ino_t) * CHAR_BIT;
+ field->event_field->type.u.integer.signedness = lttng_is_signed_type(ino_t);
+ field->event_field->type.u.integer.reverse_byte_order = 0;
+ field->event_field->type.u.integer.base = 10;
+ field->event_field->type.u.integer.encoding = lttng_encode_none;
field->get_size = time_ns_get_size;
field->record = time_ns_record;
field->get_value = time_ns_get_value;
}
static
-size_t user_ns_get_size(struct lttng_ctx_field *field, size_t offset)
+size_t user_ns_get_size(struct lttng_ust_ctx_field *field, size_t offset)
{
size_t size = 0;
}
static
-void user_ns_record(struct lttng_ctx_field *field,
+void user_ns_record(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void user_ns_get_value(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value)
+void user_ns_get_value(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value)
{
value->u.s64 = get_user_ns();
}
-int lttng_add_user_ns_to_ctx(struct lttng_ctx **ctx)
+int lttng_add_user_ns_to_ctx(struct lttng_ust_ctx **ctx)
{
- struct lttng_ctx_field *field;
+ struct lttng_ust_ctx_field *field;
field = lttng_append_context(ctx);
if (!field)
lttng_remove_context_field(ctx, field);
return -EEXIST;
}
- field->event_field.name = "user_ns";
- field->event_field.type.atype = atype_integer;
- field->event_field.type.u.integer.size = sizeof(ino_t) * CHAR_BIT;
- field->event_field.type.u.integer.alignment = lttng_alignof(ino_t) * CHAR_BIT;
- field->event_field.type.u.integer.signedness = lttng_is_signed_type(ino_t);
- field->event_field.type.u.integer.reverse_byte_order = 0;
- field->event_field.type.u.integer.base = 10;
- field->event_field.type.u.integer.encoding = lttng_encode_none;
+ field->event_field->name = "user_ns";
+ field->event_field->type.atype = atype_integer;
+ field->event_field->type.u.integer.size = sizeof(ino_t) * CHAR_BIT;
+ field->event_field->type.u.integer.alignment = lttng_alignof(ino_t) * CHAR_BIT;
+ field->event_field->type.u.integer.signedness = lttng_is_signed_type(ino_t);
+ field->event_field->type.u.integer.reverse_byte_order = 0;
+ field->event_field->type.u.integer.base = 10;
+ field->event_field->type.u.integer.encoding = lttng_encode_none;
field->get_size = user_ns_get_size;
field->record = user_ns_record;
field->get_value = user_ns_get_value;
}
static
-size_t uts_ns_get_size(struct lttng_ctx_field *field, size_t offset)
+size_t uts_ns_get_size(struct lttng_ust_ctx_field *field, size_t offset)
{
size_t size = 0;
}
static
-void uts_ns_record(struct lttng_ctx_field *field,
+void uts_ns_record(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void uts_ns_get_value(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value)
+void uts_ns_get_value(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value)
{
value->u.s64 = get_uts_ns();
}
-int lttng_add_uts_ns_to_ctx(struct lttng_ctx **ctx)
+int lttng_add_uts_ns_to_ctx(struct lttng_ust_ctx **ctx)
{
- struct lttng_ctx_field *field;
+ struct lttng_ust_ctx_field *field;
field = lttng_append_context(ctx);
if (!field)
lttng_remove_context_field(ctx, field);
return -EEXIST;
}
- field->event_field.name = "uts_ns";
- field->event_field.type.atype = atype_integer;
- field->event_field.type.u.integer.size = sizeof(ino_t) * CHAR_BIT;
- field->event_field.type.u.integer.alignment = lttng_alignof(ino_t) * CHAR_BIT;
- field->event_field.type.u.integer.signedness = lttng_is_signed_type(ino_t);
- field->event_field.type.u.integer.reverse_byte_order = 0;
- field->event_field.type.u.integer.base = 10;
- field->event_field.type.u.integer.encoding = lttng_encode_none;
+ field->event_field->name = "uts_ns";
+ field->event_field->type.atype = atype_integer;
+ field->event_field->type.u.integer.size = sizeof(ino_t) * CHAR_BIT;
+ field->event_field->type.u.integer.alignment = lttng_alignof(ino_t) * CHAR_BIT;
+ field->event_field->type.u.integer.signedness = lttng_is_signed_type(ino_t);
+ field->event_field->type.u.integer.reverse_byte_order = 0;
+ field->event_field->type.u.integer.base = 10;
+ field->event_field->type.u.integer.encoding = lttng_encode_none;
field->get_size = uts_ns_get_size;
field->record = uts_ns_record;
field->get_value = uts_ns_get_value;
}
static
-size_t vegid_get_size(struct lttng_ctx_field *field, size_t offset)
+size_t vegid_get_size(struct lttng_ust_ctx_field *field, size_t offset)
{
size_t size = 0;
}
static
-void vegid_record(struct lttng_ctx_field *field,
+void vegid_record(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void vegid_get_value(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value)
+void vegid_get_value(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value)
{
value->u.s64 = get_vegid();
}
-int lttng_add_vegid_to_ctx(struct lttng_ctx **ctx)
+int lttng_add_vegid_to_ctx(struct lttng_ust_ctx **ctx)
{
- struct lttng_ctx_field *field;
+ struct lttng_ust_ctx_field *field;
field = lttng_append_context(ctx);
if (!field)
lttng_remove_context_field(ctx, field);
return -EEXIST;
}
- field->event_field.name = "vegid";
- field->event_field.type.atype = atype_integer;
- field->event_field.type.u.integer.size = sizeof(gid_t) * CHAR_BIT;
- field->event_field.type.u.integer.alignment = lttng_alignof(gid_t) * CHAR_BIT;
- field->event_field.type.u.integer.signedness = lttng_is_signed_type(gid_t);
- field->event_field.type.u.integer.reverse_byte_order = 0;
- field->event_field.type.u.integer.base = 10;
- field->event_field.type.u.integer.encoding = lttng_encode_none;
+ field->event_field->name = "vegid";
+ field->event_field->type.atype = atype_integer;
+ field->event_field->type.u.integer.size = sizeof(gid_t) * CHAR_BIT;
+ field->event_field->type.u.integer.alignment = lttng_alignof(gid_t) * CHAR_BIT;
+ field->event_field->type.u.integer.signedness = lttng_is_signed_type(gid_t);
+ field->event_field->type.u.integer.reverse_byte_order = 0;
+ field->event_field->type.u.integer.base = 10;
+ field->event_field->type.u.integer.encoding = lttng_encode_none;
field->get_size = vegid_get_size;
field->record = vegid_record;
field->get_value = vegid_get_value;
}
static
-size_t veuid_get_size(struct lttng_ctx_field *field, size_t offset)
+size_t veuid_get_size(struct lttng_ust_ctx_field *field, size_t offset)
{
size_t size = 0;
}
static
-void veuid_record(struct lttng_ctx_field *field,
+void veuid_record(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void veuid_get_value(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value)
+void veuid_get_value(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value)
{
value->u.s64 = get_veuid();
}
-int lttng_add_veuid_to_ctx(struct lttng_ctx **ctx)
+int lttng_add_veuid_to_ctx(struct lttng_ust_ctx **ctx)
{
- struct lttng_ctx_field *field;
+ struct lttng_ust_ctx_field *field;
field = lttng_append_context(ctx);
if (!field)
lttng_remove_context_field(ctx, field);
return -EEXIST;
}
- field->event_field.name = "veuid";
- field->event_field.type.atype = atype_integer;
- field->event_field.type.u.integer.size = sizeof(uid_t) * CHAR_BIT;
- field->event_field.type.u.integer.alignment = lttng_alignof(uid_t) * CHAR_BIT;
- field->event_field.type.u.integer.signedness = lttng_is_signed_type(uid_t);
- field->event_field.type.u.integer.reverse_byte_order = 0;
- field->event_field.type.u.integer.base = 10;
- field->event_field.type.u.integer.encoding = lttng_encode_none;
+ field->event_field->name = "veuid";
+ field->event_field->type.atype = atype_integer;
+ field->event_field->type.u.integer.size = sizeof(uid_t) * CHAR_BIT;
+ field->event_field->type.u.integer.alignment = lttng_alignof(uid_t) * CHAR_BIT;
+ field->event_field->type.u.integer.signedness = lttng_is_signed_type(uid_t);
+ field->event_field->type.u.integer.reverse_byte_order = 0;
+ field->event_field->type.u.integer.base = 10;
+ field->event_field->type.u.integer.encoding = lttng_encode_none;
field->get_size = veuid_get_size;
field->record = veuid_record;
field->get_value = veuid_get_value;
}
static
-size_t vgid_get_size(struct lttng_ctx_field *field, size_t offset)
+size_t vgid_get_size(struct lttng_ust_ctx_field *field, size_t offset)
{
size_t size = 0;
}
static
-void vgid_record(struct lttng_ctx_field *field,
+void vgid_record(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void vgid_get_value(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value)
+void vgid_get_value(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value)
{
value->u.s64 = get_vgid();
}
-int lttng_add_vgid_to_ctx(struct lttng_ctx **ctx)
+int lttng_add_vgid_to_ctx(struct lttng_ust_ctx **ctx)
{
- struct lttng_ctx_field *field;
+ struct lttng_ust_ctx_field *field;
field = lttng_append_context(ctx);
if (!field)
lttng_remove_context_field(ctx, field);
return -EEXIST;
}
- field->event_field.name = "vgid";
- field->event_field.type.atype = atype_integer;
- field->event_field.type.u.integer.size = sizeof(gid_t) * CHAR_BIT;
- field->event_field.type.u.integer.alignment = lttng_alignof(gid_t) * CHAR_BIT;
- field->event_field.type.u.integer.signedness = lttng_is_signed_type(gid_t);
- field->event_field.type.u.integer.reverse_byte_order = 0;
- field->event_field.type.u.integer.base = 10;
- field->event_field.type.u.integer.encoding = lttng_encode_none;
+ field->event_field->name = "vgid";
+ field->event_field->type.atype = atype_integer;
+ field->event_field->type.u.integer.size = sizeof(gid_t) * CHAR_BIT;
+ field->event_field->type.u.integer.alignment = lttng_alignof(gid_t) * CHAR_BIT;
+ field->event_field->type.u.integer.signedness = lttng_is_signed_type(gid_t);
+ field->event_field->type.u.integer.reverse_byte_order = 0;
+ field->event_field->type.u.integer.base = 10;
+ field->event_field->type.u.integer.encoding = lttng_encode_none;
field->get_size = vgid_get_size;
field->record = vgid_record;
field->get_value = vgid_get_value;
}
static
-size_t vpid_get_size(struct lttng_ctx_field *field, size_t offset)
+size_t vpid_get_size(struct lttng_ust_ctx_field *field, size_t offset)
{
size_t size = 0;
}
static
-void vpid_record(struct lttng_ctx_field *field,
+void vpid_record(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void vpid_get_value(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value)
+void vpid_get_value(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value)
{
value->u.s64 = wrapper_getvpid();
}
-int lttng_add_vpid_to_ctx(struct lttng_ctx **ctx)
+int lttng_add_vpid_to_ctx(struct lttng_ust_ctx **ctx)
{
- struct lttng_ctx_field *field;
+ struct lttng_ust_ctx_field *field;
field = lttng_append_context(ctx);
if (!field)
lttng_remove_context_field(ctx, field);
return -EEXIST;
}
- field->event_field.name = "vpid";
- field->event_field.type.atype = atype_integer;
- field->event_field.type.u.integer.size = sizeof(pid_t) * CHAR_BIT;
- field->event_field.type.u.integer.alignment = lttng_alignof(pid_t) * CHAR_BIT;
- field->event_field.type.u.integer.signedness = lttng_is_signed_type(pid_t);
- field->event_field.type.u.integer.reverse_byte_order = 0;
- field->event_field.type.u.integer.base = 10;
- field->event_field.type.u.integer.encoding = lttng_encode_none;
+ field->event_field->name = "vpid";
+ field->event_field->type.atype = atype_integer;
+ field->event_field->type.u.integer.size = sizeof(pid_t) * CHAR_BIT;
+ field->event_field->type.u.integer.alignment = lttng_alignof(pid_t) * CHAR_BIT;
+ field->event_field->type.u.integer.signedness = lttng_is_signed_type(pid_t);
+ field->event_field->type.u.integer.reverse_byte_order = 0;
+ field->event_field->type.u.integer.base = 10;
+ field->event_field->type.u.integer.encoding = lttng_encode_none;
field->get_size = vpid_get_size;
field->record = vpid_record;
field->get_value = vpid_get_value;
}
static
-size_t vsgid_get_size(struct lttng_ctx_field *field, size_t offset)
+size_t vsgid_get_size(struct lttng_ust_ctx_field *field, size_t offset)
{
size_t size = 0;
}
static
-void vsgid_record(struct lttng_ctx_field *field,
+void vsgid_record(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void vsgid_get_value(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value)
+void vsgid_get_value(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value)
{
value->u.s64 = get_vsgid();
}
-int lttng_add_vsgid_to_ctx(struct lttng_ctx **ctx)
+int lttng_add_vsgid_to_ctx(struct lttng_ust_ctx **ctx)
{
- struct lttng_ctx_field *field;
+ struct lttng_ust_ctx_field *field;
field = lttng_append_context(ctx);
if (!field)
lttng_remove_context_field(ctx, field);
return -EEXIST;
}
- field->event_field.name = "vsgid";
- field->event_field.type.atype = atype_integer;
- field->event_field.type.u.integer.size = sizeof(gid_t) * CHAR_BIT;
- field->event_field.type.u.integer.alignment = lttng_alignof(gid_t) * CHAR_BIT;
- field->event_field.type.u.integer.signedness = lttng_is_signed_type(gid_t);
- field->event_field.type.u.integer.reverse_byte_order = 0;
- field->event_field.type.u.integer.base = 10;
- field->event_field.type.u.integer.encoding = lttng_encode_none;
+ field->event_field->name = "vsgid";
+ field->event_field->type.atype = atype_integer;
+ field->event_field->type.u.integer.size = sizeof(gid_t) * CHAR_BIT;
+ field->event_field->type.u.integer.alignment = lttng_alignof(gid_t) * CHAR_BIT;
+ field->event_field->type.u.integer.signedness = lttng_is_signed_type(gid_t);
+ field->event_field->type.u.integer.reverse_byte_order = 0;
+ field->event_field->type.u.integer.base = 10;
+ field->event_field->type.u.integer.encoding = lttng_encode_none;
field->get_size = vsgid_get_size;
field->record = vsgid_record;
field->get_value = vsgid_get_value;
}
static
-size_t vsuid_get_size(struct lttng_ctx_field *field, size_t offset)
+size_t vsuid_get_size(struct lttng_ust_ctx_field *field, size_t offset)
{
size_t size = 0;
}
static
-void vsuid_record(struct lttng_ctx_field *field,
+void vsuid_record(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void vsuid_get_value(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value)
+void vsuid_get_value(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value)
{
value->u.s64 = get_vsuid();
}
-int lttng_add_vsuid_to_ctx(struct lttng_ctx **ctx)
+int lttng_add_vsuid_to_ctx(struct lttng_ust_ctx **ctx)
{
- struct lttng_ctx_field *field;
+ struct lttng_ust_ctx_field *field;
field = lttng_append_context(ctx);
if (!field)
lttng_remove_context_field(ctx, field);
return -EEXIST;
}
- field->event_field.name = "vsuid";
- field->event_field.type.atype = atype_integer;
- field->event_field.type.u.integer.size = sizeof(uid_t) * CHAR_BIT;
- field->event_field.type.u.integer.alignment = lttng_alignof(uid_t) * CHAR_BIT;
- field->event_field.type.u.integer.signedness = lttng_is_signed_type(uid_t);
- field->event_field.type.u.integer.reverse_byte_order = 0;
- field->event_field.type.u.integer.base = 10;
- field->event_field.type.u.integer.encoding = lttng_encode_none;
+ field->event_field->name = "vsuid";
+ field->event_field->type.atype = atype_integer;
+ field->event_field->type.u.integer.size = sizeof(uid_t) * CHAR_BIT;
+ field->event_field->type.u.integer.alignment = lttng_alignof(uid_t) * CHAR_BIT;
+ field->event_field->type.u.integer.signedness = lttng_is_signed_type(uid_t);
+ field->event_field->type.u.integer.reverse_byte_order = 0;
+ field->event_field->type.u.integer.base = 10;
+ field->event_field->type.u.integer.encoding = lttng_encode_none;
field->get_size = vsuid_get_size;
field->record = vsuid_record;
field->get_value = vsuid_get_value;
}
static
-size_t vtid_get_size(struct lttng_ctx_field *field, size_t offset)
+size_t vtid_get_size(struct lttng_ust_ctx_field *field, size_t offset)
{
size_t size = 0;
}
static
-void vtid_record(struct lttng_ctx_field *field,
+void vtid_record(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void vtid_get_value(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value)
+void vtid_get_value(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value)
{
value->u.s64 = wrapper_getvtid();
}
-int lttng_add_vtid_to_ctx(struct lttng_ctx **ctx)
+int lttng_add_vtid_to_ctx(struct lttng_ust_ctx **ctx)
{
- struct lttng_ctx_field *field;
+ struct lttng_ust_ctx_field *field;
field = lttng_append_context(ctx);
if (!field)
lttng_remove_context_field(ctx, field);
return -EEXIST;
}
- field->event_field.name = "vtid";
- field->event_field.type.atype = atype_integer;
- field->event_field.type.u.integer.size = sizeof(pid_t) * CHAR_BIT;
- field->event_field.type.u.integer.alignment = lttng_alignof(pid_t) * CHAR_BIT;
- field->event_field.type.u.integer.signedness = lttng_is_signed_type(pid_t);
- field->event_field.type.u.integer.reverse_byte_order = 0;
- field->event_field.type.u.integer.base = 10;
- field->event_field.type.u.integer.encoding = lttng_encode_none;
+ field->event_field->name = "vtid";
+ field->event_field->type.atype = atype_integer;
+ field->event_field->type.u.integer.size = sizeof(pid_t) * CHAR_BIT;
+ field->event_field->type.u.integer.alignment = lttng_alignof(pid_t) * CHAR_BIT;
+ field->event_field->type.u.integer.signedness = lttng_is_signed_type(pid_t);
+ field->event_field->type.u.integer.reverse_byte_order = 0;
+ field->event_field->type.u.integer.base = 10;
+ field->event_field->type.u.integer.encoding = lttng_encode_none;
field->get_size = vtid_get_size;
field->record = vtid_record;
field->get_value = vtid_get_value;
}
static
-size_t vuid_get_size(struct lttng_ctx_field *field, size_t offset)
+size_t vuid_get_size(struct lttng_ust_ctx_field *field, size_t offset)
{
size_t size = 0;
}
static
-void vuid_record(struct lttng_ctx_field *field,
+void vuid_record(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void vuid_get_value(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value)
+void vuid_get_value(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value)
{
value->u.s64 = get_vuid();
}
-int lttng_add_vuid_to_ctx(struct lttng_ctx **ctx)
+int lttng_add_vuid_to_ctx(struct lttng_ust_ctx **ctx)
{
- struct lttng_ctx_field *field;
+ struct lttng_ust_ctx_field *field;
field = lttng_append_context(ctx);
if (!field)
lttng_remove_context_field(ctx, field);
return -EEXIST;
}
- field->event_field.name = "vuid";
- field->event_field.type.atype = atype_integer;
- field->event_field.type.u.integer.size = sizeof(uid_t) * CHAR_BIT;
- field->event_field.type.u.integer.alignment = lttng_alignof(uid_t) * CHAR_BIT;
- field->event_field.type.u.integer.signedness = lttng_is_signed_type(uid_t);
- field->event_field.type.u.integer.reverse_byte_order = 0;
- field->event_field.type.u.integer.base = 10;
- field->event_field.type.u.integer.encoding = lttng_encode_none;
+ field->event_field->name = "vuid";
+ field->event_field->type.atype = atype_integer;
+ field->event_field->type.u.integer.size = sizeof(uid_t) * CHAR_BIT;
+ field->event_field->type.u.integer.alignment = lttng_alignof(uid_t) * CHAR_BIT;
+ field->event_field->type.u.integer.signedness = lttng_is_signed_type(uid_t);
+ field->event_field->type.u.integer.reverse_byte_order = 0;
+ field->event_field->type.u.integer.base = 10;
+ field->event_field->type.u.integer.encoding = lttng_encode_none;
field->get_size = vuid_get_size;
field->record = vuid_record;
field->get_value = vuid_get_value;
* same context performed by the same thread return the same result.
*/
-int lttng_find_context(struct lttng_ctx *ctx, const char *name)
+int lttng_find_context(struct lttng_ust_ctx *ctx, const char *name)
{
unsigned int i;
const char *subname;
}
for (i = 0; i < ctx->nr_fields; i++) {
/* Skip allocated (but non-initialized) contexts */
- if (!ctx->fields[i].event_field.name)
+ if (!ctx->fields[i]->event_field->name)
continue;
- if (!strcmp(ctx->fields[i].event_field.name, subname))
+ if (!strcmp(ctx->fields[i]->event_field->name, subname))
return 1;
}
return 0;
}
-int lttng_get_context_index(struct lttng_ctx *ctx, const char *name)
+int lttng_get_context_index(struct lttng_ust_ctx *ctx, const char *name)
{
unsigned int i;
const char *subname;
}
for (i = 0; i < ctx->nr_fields; i++) {
/* Skip allocated (but non-initialized) contexts */
- if (!ctx->fields[i].event_field.name)
+ if (!ctx->fields[i]->event_field->name)
continue;
- if (!strcmp(ctx->fields[i].event_field.name, subname))
+ if (!strcmp(ctx->fields[i]->event_field->name, subname))
return i;
}
return -1;
}
-static int lttng_find_context_provider(struct lttng_ctx *ctx, const char *name)
+static int lttng_find_context_provider(struct lttng_ust_ctx *ctx, const char *name)
{
unsigned int i;
for (i = 0; i < ctx->nr_fields; i++) {
/* Skip allocated (but non-initialized) contexts */
- if (!ctx->fields[i].event_field.name)
+ if (!ctx->fields[i]->event_field->name)
continue;
- if (!strncmp(ctx->fields[i].event_field.name, name,
+ if (!strncmp(ctx->fields[i]->event_field->name, name,
strlen(name)))
return 1;
}
/*
* Note: as we append context information, the pointer location may change.
+ * lttng_add_context leaves the new last context initialized to NULL.
*/
-struct lttng_ctx_field *lttng_append_context(struct lttng_ctx **ctx_p)
+static
+int lttng_add_context(struct lttng_ust_ctx **ctx_p)
{
- struct lttng_ctx_field *field;
- struct lttng_ctx *ctx;
+ struct lttng_ust_ctx *ctx;
if (!*ctx_p) {
- *ctx_p = zmalloc(sizeof(struct lttng_ctx));
+ *ctx_p = zmalloc(sizeof(struct lttng_ust_ctx));
if (!*ctx_p)
- return NULL;
+ return -ENOMEM;
+ (*ctx_p)->struct_size = sizeof(struct lttng_ust_ctx);
(*ctx_p)->largest_align = 1;
}
ctx = *ctx_p;
if (ctx->nr_fields + 1 > ctx->allocated_fields) {
- struct lttng_ctx_field *new_fields;
+ struct lttng_ust_ctx_field **new_fields;
ctx->allocated_fields = max_t(size_t, 1, 2 * ctx->allocated_fields);
- new_fields = zmalloc(ctx->allocated_fields * sizeof(struct lttng_ctx_field));
+ new_fields = zmalloc(ctx->allocated_fields * sizeof(*new_fields));
if (!new_fields)
- return NULL;
+ return -ENOMEM;
+ /* Copy pointers */
if (ctx->fields)
memcpy(new_fields, ctx->fields, sizeof(*ctx->fields) * ctx->nr_fields);
free(ctx->fields);
ctx->fields = new_fields;
}
- field = &ctx->fields[ctx->nr_fields];
ctx->nr_fields++;
+ return 0;
+}
+
+struct lttng_ust_ctx_field *lttng_append_context(struct lttng_ust_ctx **ctx_p)
+{
+ struct lttng_ust_ctx_field *field;
+ int ret;
+
+ field = zmalloc(sizeof(struct lttng_ust_ctx_field));
+ if (!field)
+ goto error_alloc_field;
+ field->struct_size = sizeof(struct lttng_ust_ctx_field);
+ field->event_field = zmalloc(sizeof(struct lttng_ust_event_field));
+ if (!field->event_field)
+ goto error_alloc_event_field;
+ field->event_field->struct_size = sizeof(struct lttng_ust_event_field);
+
+ ret = lttng_add_context(ctx_p);
+ if (ret)
+ goto error_add_context;
+ (*ctx_p)->fields[(*ctx_p)->nr_fields - 1] = field;
return field;
+
+error_add_context:
+ free(field->event_field);
+error_alloc_event_field:
+ free(field);
+error_alloc_field:
+ return NULL;
}
-int lttng_context_add_rcu(struct lttng_ctx **ctx_p,
- const struct lttng_ctx_field *f)
+/*
+ * Takes ownership of @f on success.
+ */
+int lttng_context_add_rcu(struct lttng_ust_ctx **ctx_p,
+ struct lttng_ust_ctx_field *f)
{
- struct lttng_ctx *old_ctx = *ctx_p, *new_ctx = NULL;
- struct lttng_ctx_field *new_fields = NULL;
- struct lttng_ctx_field *nf;
+ struct lttng_ust_ctx *old_ctx = *ctx_p, *new_ctx = NULL;
+ struct lttng_ust_ctx_field **new_fields = NULL;
+ int ret;
if (old_ctx) {
- new_ctx = zmalloc(sizeof(struct lttng_ctx));
+ new_ctx = zmalloc(sizeof(struct lttng_ust_ctx));
if (!new_ctx)
return -ENOMEM;
+ new_ctx->struct_size = sizeof(struct lttng_ust_ctx);
*new_ctx = *old_ctx;
- new_fields = zmalloc(new_ctx->allocated_fields
- * sizeof(struct lttng_ctx_field));
+ new_fields = zmalloc(new_ctx->allocated_fields * sizeof(*new_fields));
if (!new_fields) {
free(new_ctx);
return -ENOMEM;
}
+ /* Copy pointers */
memcpy(new_fields, old_ctx->fields,
sizeof(*old_ctx->fields) * old_ctx->nr_fields);
new_ctx->fields = new_fields;
}
- nf = lttng_append_context(&new_ctx);
- if (!nf) {
+ ret = lttng_add_context(&new_ctx);
+ if (ret) {
free(new_fields);
free(new_ctx);
- return -ENOMEM;
+ return ret;
}
- *nf = *f;
+ /* Taking ownership of f. */
+ (*ctx_p)->fields[(*ctx_p)->nr_fields - 1] = f;
lttng_context_update(new_ctx);
lttng_ust_rcu_assign_pointer(*ctx_p, new_ctx);
lttng_ust_urcu_synchronize_rcu();
* lttng_context_update() should be called at least once between context
* modification and trace start.
*/
-void lttng_context_update(struct lttng_ctx *ctx)
+void lttng_context_update(struct lttng_ust_ctx *ctx)
{
int i;
size_t largest_align = 8; /* in bits */
struct lttng_type *type;
size_t field_align = 8;
- type = &ctx->fields[i].event_field.type;
+ type = &ctx->fields[i]->event_field->type;
switch (type->atype) {
case atype_integer:
field_align = type->u.integer.alignment;
/*
* Remove last context field.
*/
-void lttng_remove_context_field(struct lttng_ctx **ctx_p,
- struct lttng_ctx_field *field)
+void lttng_remove_context_field(struct lttng_ust_ctx **ctx_p,
+ struct lttng_ust_ctx_field *field)
{
- struct lttng_ctx *ctx;
+ struct lttng_ust_ctx *ctx;
ctx = *ctx_p;
ctx->nr_fields--;
- assert(&ctx->fields[ctx->nr_fields] == field);
+ assert(ctx->fields[ctx->nr_fields] == field);
assert(field->field_name == NULL);
- memset(&ctx->fields[ctx->nr_fields], 0, sizeof(struct lttng_ctx_field));
+ ctx->fields[ctx->nr_fields] = NULL;
}
-void lttng_destroy_context(struct lttng_ctx *ctx)
+void lttng_destroy_context(struct lttng_ust_ctx *ctx)
{
int i;
if (!ctx)
return;
for (i = 0; i < ctx->nr_fields; i++) {
- if (ctx->fields[i].destroy)
- ctx->fields[i].destroy(&ctx->fields[i]);
- free(ctx->fields[i].field_name);
+ if (ctx->fields[i]->destroy)
+ ctx->fields[i]->destroy(ctx->fields[i]);
+ free(ctx->fields[i]->field_name);
+ free(ctx->fields[i]->event_field);
+ free(ctx->fields[i]);
}
free(ctx->fields);
free(ctx);
* a single RCU read-side critical section see either all old, or all
* new handlers.
*/
-int lttng_ust_context_set_provider_rcu(struct lttng_ctx **_ctx,
+int lttng_ust_context_set_provider_rcu(struct lttng_ust_ctx **_ctx,
const char *name,
- size_t (*get_size)(struct lttng_ctx_field *field, size_t offset),
- void (*record)(struct lttng_ctx_field *field,
+ size_t (*get_size)(struct lttng_ust_ctx_field *field, size_t offset),
+ void (*record)(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan),
- void (*get_value)(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value))
+ void (*get_value)(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value))
{
int i, ret;
- struct lttng_ctx *ctx = *_ctx, *new_ctx;
- struct lttng_ctx_field *new_fields;
+ struct lttng_ust_ctx *ctx = *_ctx, *new_ctx;
+ struct lttng_ust_ctx_field **new_fields;
if (!ctx || !lttng_find_context_provider(ctx, name))
return 0;
new_ctx = zmalloc(sizeof(*new_ctx));
if (!new_ctx)
return -ENOMEM;
+ new_ctx->struct_size = sizeof(*new_ctx);
*new_ctx = *ctx;
new_fields = zmalloc(sizeof(*new_fields) * ctx->allocated_fields);
if (!new_fields) {
ret = -ENOMEM;
goto field_error;
}
+ /* Copy pointers */
memcpy(new_fields, ctx->fields,
sizeof(*new_fields) * ctx->allocated_fields);
for (i = 0; i < ctx->nr_fields; i++) {
- if (strncmp(new_fields[i].event_field.name,
+ if (strncmp(new_fields[i]->event_field->name,
name, strlen(name)) != 0)
continue;
- new_fields[i].get_size = get_size;
- new_fields[i].record = record;
- new_fields[i].get_value = get_value;
+ new_fields[i]->get_size = get_size;
+ new_fields[i]->record = record;
+ new_fields[i]->get_value = get_value;
}
new_ctx->fields = new_fields;
lttng_ust_rcu_assign_pointer(*_ctx, new_ctx);
return ret;
}
-int lttng_context_init_all(struct lttng_ctx **ctx)
+int lttng_context_init_all(struct lttng_ust_ctx **ctx)
{
int ret;
static
int lttng_create_all_ctx_enums(size_t nr_fields,
- const struct lttng_ctx_field *ctx_fields,
+ struct lttng_ust_ctx_field **ctx_fields,
struct lttng_session *session)
{
size_t i;
/* For each field, ensure enum is part of the session. */
for (i = 0; i < nr_fields; i++) {
- const struct lttng_type *type = &ctx_fields[i].event_field.type;
+ const struct lttng_type *type = &ctx_fields[i]->event_field->type;
ret = lttng_create_enum_check(type, session);
if (ret)
* we need to use.
*/
cds_list_for_each_entry(chan, &session->priv->chan_head, node) {
- const struct lttng_ctx *ctx;
- const struct lttng_ctx_field *fields = NULL;
+ const struct lttng_ust_ctx *ctx;
+ struct lttng_ust_ctx_field **fields = NULL;
size_t nr_fields = 0;
uint32_t chan_id;
int lttng_attach_context(struct lttng_ust_abi_context *context_param,
union lttng_ust_abi_args *uargs,
- struct lttng_ctx **ctx, struct lttng_session *session)
+ struct lttng_ust_ctx **ctx, struct lttng_session *session)
{
/*
* We cannot attach a context after trace has been started for a
* context (either app context callbacks, or dummy callbacks).
*/
void lttng_ust_context_set_session_provider(const char *name,
- size_t (*get_size)(struct lttng_ctx_field *field, size_t offset),
- void (*record)(struct lttng_ctx_field *field,
+ size_t (*get_size)(struct lttng_ust_ctx_field *field, size_t offset),
+ void (*record)(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan),
- void (*get_value)(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value))
+ void (*get_value)(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value))
{
struct lttng_ust_session_private *session_priv;
* context (either app context callbacks, or dummy callbacks).
*/
void lttng_ust_context_set_event_notifier_group_provider(const char *name,
- size_t (*get_size)(struct lttng_ctx_field *field, size_t offset),
- void (*record)(struct lttng_ctx_field *field,
+ size_t (*get_size)(struct lttng_ust_ctx_field *field, size_t offset),
+ void (*record)(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan),
- void (*get_value)(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value))
+ void (*get_value)(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value))
{
struct lttng_event_notifier_group *event_notifier_group;
}
static inline
-size_t ctx_get_aligned_size(size_t offset, struct lttng_ctx *ctx,
+size_t ctx_get_aligned_size(size_t offset, struct lttng_ust_ctx *ctx,
size_t ctx_len)
{
size_t orig_offset = offset;
}
static inline
-void ctx_get_struct_size(struct lttng_ctx *ctx, size_t *ctx_len,
+void ctx_get_struct_size(struct lttng_ust_ctx *ctx, size_t *ctx_len,
enum app_ctx_mode mode)
{
int i;
}
for (i = 0; i < ctx->nr_fields; i++) {
if (mode == APP_CTX_ENABLED) {
- offset += ctx->fields[i].get_size(&ctx->fields[i], offset);
+ offset += ctx->fields[i]->get_size(ctx->fields[i], offset);
} else {
- if (lttng_context_is_app(ctx->fields[i].event_field.name)) {
+ if (lttng_context_is_app(ctx->fields[i]->event_field->name)) {
/*
* Before UST 2.8, we cannot use the
* application context, because we
* concurrently with application context
* register/unregister.
*/
- offset += lttng_ust_dummy_get_size(&ctx->fields[i], offset);
+ offset += lttng_ust_dummy_get_size(ctx->fields[i], offset);
} else {
- offset += ctx->fields[i].get_size(&ctx->fields[i], offset);
+ offset += ctx->fields[i]->get_size(ctx->fields[i], offset);
}
}
}
static inline
void ctx_record(struct lttng_ust_lib_ring_buffer_ctx *bufctx,
struct lttng_channel *chan,
- struct lttng_ctx *ctx,
+ struct lttng_ust_ctx *ctx,
enum app_ctx_mode mode)
{
int i;
lib_ring_buffer_align_ctx(bufctx, ctx->largest_align);
for (i = 0; i < ctx->nr_fields; i++) {
if (mode == APP_CTX_ENABLED) {
- ctx->fields[i].record(&ctx->fields[i], bufctx, chan);
+ ctx->fields[i]->record(ctx->fields[i], bufctx, chan);
} else {
- if (lttng_context_is_app(ctx->fields[i].event_field.name)) {
+ if (lttng_context_is_app(ctx->fields[i]->event_field->name)) {
/*
* Before UST 2.8, we cannot use the
* application context, because we
* concurrently with application context
* register/unregister.
*/
- lttng_ust_dummy_record(&ctx->fields[i], bufctx, chan);
+ lttng_ust_dummy_record(ctx->fields[i], bufctx, chan);
} else {
- ctx->fields[i].record(&ctx->fields[i], bufctx, chan);
+ ctx->fields[i]->record(ctx->fields[i], bufctx, chan);
}
}
}
struct lttng_session;
struct lttng_channel;
struct lttng_event;
-struct lttng_ctx_field;
+struct lttng_ust_ctx_field;
struct lttng_ust_lib_ring_buffer_ctx;
-struct lttng_ctx_value;
+struct lttng_ust_ctx_value;
struct lttng_ust_event_notifier;
__attribute__((visibility("hidden")))
ssize_t lttng_ust_read(int fd, void *buf, size_t len);
__attribute__((visibility("hidden")))
-size_t lttng_ust_dummy_get_size(struct lttng_ctx_field *field, size_t offset);
+size_t lttng_ust_dummy_get_size(struct lttng_ust_ctx_field *field, size_t offset);
__attribute__((visibility("hidden")))
-void lttng_ust_dummy_record(struct lttng_ctx_field *field,
+void lttng_ust_dummy_record(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan);
__attribute__((visibility("hidden")))
-void lttng_ust_dummy_get_value(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value);
+void lttng_ust_dummy_get_value(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value);
__attribute__((visibility("hidden")))
void lttng_event_notifier_notification_send(
long lttng_abi_add_context(int objd,
struct lttng_ust_abi_context *context_param,
union lttng_ust_abi_args *uargs,
- struct lttng_ctx **ctx, struct lttng_session *session)
+ struct lttng_ust_ctx **ctx, struct lttng_session *session)
{
return lttng_attach_context(context_param, uargs, ctx, session);
}
return NULL;
}
-size_t lttng_ust_dummy_get_size(struct lttng_ctx_field *field, size_t offset)
+size_t lttng_ust_dummy_get_size(struct lttng_ust_ctx_field *field, size_t offset)
{
size_t size = 0;
return size;
}
-void lttng_ust_dummy_record(struct lttng_ctx_field *field,
+void lttng_ust_dummy_record(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
chan->ops->event_write(ctx, &sel_char, sizeof(sel_char));
}
-void lttng_ust_dummy_get_value(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value)
+void lttng_ust_dummy_get_value(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value)
{
value->sel = LTTNG_UST_DYNAMIC_TYPE_NONE;
}
* Unused, but kept around to make it explicit that the tracer can do
* it.
*/
- struct lttng_ctx *ctx;
+ struct lttng_ust_ctx *ctx;
};
struct lttng_event_notifier_enabler {
struct cds_list_head enablers_head;
struct cds_list_head event_notifiers_head; /* list of event_notifiers */
struct lttng_ust_event_notifier_ht event_notifiers_ht; /* hashtable of event_notifiers */
- struct lttng_ctx *ctx; /* contexts for filters. */
+ struct lttng_ust_ctx *ctx; /* contexts for filters. */
struct lttng_counter *error_counter;
size_t error_counter_len;
* Pointer to a URCU-protected pointer owned by an `struct
* lttng_session`or `struct lttng_event_notifier_group`.
*/
- struct lttng_ctx **pctx;
+ struct lttng_ust_ctx **pctx;
};
struct lttng_ust_session_private {
/* New UST 2.8 */
struct lttng_ust_enum_ht enums_ht; /* ht of enumerations */
struct cds_list_head enums_head;
- struct lttng_ctx *ctx; /* contexts for filters. */
+ struct lttng_ust_ctx *ctx; /* contexts for filters. */
};
struct lttng_enum {
*/
__attribute__((visibility("hidden")))
void lttng_enabler_link_bytecode(const struct lttng_ust_event_desc *event_desc,
- struct lttng_ctx **ctx,
+ struct lttng_ust_ctx **ctx,
struct cds_list_head *instance_bytecode_runtime_head,
struct cds_list_head *enabler_bytecode_runtime_head);
int lttng_add_perf_counter_to_ctx(uint32_t type,
uint64_t config,
const char *name,
- struct lttng_ctx **ctx);
+ struct lttng_ust_ctx **ctx);
__attribute__((visibility("hidden")))
int lttng_perf_counter_init(void);
int lttng_add_perf_counter_to_ctx(uint32_t type,
uint64_t config,
const char *name,
- struct lttng_ctx **ctx)
+ struct lttng_ust_ctx **ctx)
{
return -ENOSYS;
}
}
static
-size_t test_get_size(struct lttng_ctx_field *field, size_t offset)
+size_t test_get_size(struct lttng_ust_ctx_field *field, size_t offset)
{
int sel = test_count % _NR_LTTNG_UST_DYNAMIC_TYPES;
size_t size = 0;
}
static
-void test_record(struct lttng_ctx_field *field,
+void test_record(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void test_get_value(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value)
+void test_get_value(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value)
{
int sel = test_count % _NR_LTTNG_UST_DYNAMIC_TYPES;
}
struct lttng_ust_context_provider myprovider = {
+ .struct_size = sizeof(struct lttng_ust_context_provider),
.name = "$app.myprovider",
.get_size = test_get_size,
.record = test_record,