_fields \
)
-#define lttng_kernel_static_ctx_field(_event_field, _get_size, _get_size_arg, _record, _get_value, _destroy, _priv) \
+#define lttng_kernel_static_ctx_field(_event_field, _get_size, _record, _get_value, _destroy, _priv) \
__LTTNG_COMPOUND_LITERAL(const struct lttng_kernel_ctx_field, { \
.event_field = (_event_field), \
.get_size = (_get_size), \
- .get_size_arg = (_get_size_arg), \
.record = (_record), \
.get_value = (_get_value), \
.destroy = (_destroy), \
} \
}),
-union lttng_ctx_value {
- int64_t s64;
- const char *str;
- double d;
+struct lttng_ctx_value {
+ union {
+ int64_t s64;
+ const char *str;
+ double d;
+ } u;
};
/*
struct lttng_kernel_ctx_field {
const struct lttng_kernel_event_field *event_field;
- size_t (*get_size)(size_t offset);
- size_t (*get_size_arg)(size_t offset, struct lttng_kernel_ctx_field *field,
- struct lib_ring_buffer_ctx *ctx,
- struct lttng_channel *chan);
- void (*record)(struct lttng_kernel_ctx_field *field,
- struct lib_ring_buffer_ctx *ctx,
- struct lttng_channel *chan);
- void (*get_value)(struct lttng_kernel_ctx_field *field,
- struct lttng_probe_ctx *lttng_probe_ctx,
- union lttng_ctx_value *value);
- void (*destroy)(struct lttng_kernel_ctx_field *field);
+ size_t (*get_size)(void *priv, struct lttng_probe_ctx *probe_ctx,
+ size_t offset);
+ void (*record)(void *priv, struct lttng_probe_ctx *probe_ctx,
+ struct lib_ring_buffer_ctx *ctx,
+ struct lttng_channel *chan);
+ void (*get_value)(void *priv, struct lttng_probe_ctx *probe_ctx,
+ struct lttng_ctx_value *value);
+ void (*destroy)(void *priv);
void *priv;
};
struct lttng_kernel_ctx_field *ctx_field;
const struct lttng_kernel_event_field *field;
- union lttng_ctx_value v;
+ struct lttng_ctx_value v;
ctx_field = <tng_static_ctx->fields[idx];
field = ctx_field->event_field;
switch (field->type->type) {
case lttng_kernel_type_integer:
- ctx_field->get_value(ctx_field, lttng_probe_ctx, &v);
+ ctx_field->get_value(ctx_field->priv, lttng_probe_ctx, &v);
if (lttng_kernel_get_type_integer(field->type)->signedness) {
ptr->object_type = OBJECT_TYPE_S64;
- ptr->u.s64 = v.s64;
+ ptr->u.s64 = v.u.s64;
ptr->ptr = &ptr->u.s64;
} else {
ptr->object_type = OBJECT_TYPE_U64;
- ptr->u.u64 = v.s64; /* Cast. */
+ ptr->u.u64 = v.u.s64; /* Cast. */
ptr->ptr = &ptr->u.u64;
}
break;
const struct lttng_kernel_type_enum *enum_type = lttng_kernel_get_type_enum(field->type);
const struct lttng_kernel_type_integer *integer_type = lttng_kernel_get_type_integer(enum_type->container_type);
- ctx_field->get_value(ctx_field, lttng_probe_ctx, &v);
+ ctx_field->get_value(ctx_field->priv, lttng_probe_ctx, &v);
if (integer_type->signedness) {
ptr->object_type = OBJECT_TYPE_SIGNED_ENUM;
- ptr->u.s64 = v.s64;
+ ptr->u.s64 = v.u.s64;
ptr->ptr = &ptr->u.s64;
} else {
ptr->object_type = OBJECT_TYPE_UNSIGNED_ENUM;
- ptr->u.u64 = v.s64; /* Cast. */
+ ptr->u.u64 = v.u.s64; /* Cast. */
ptr->ptr = &ptr->u.u64;
}
break;
return -EINVAL;
}
ptr->object_type = OBJECT_TYPE_STRING;
- ctx_field->get_value(ctx_field, lttng_probe_ctx, &v);
- ptr->ptr = v.str;
+ ctx_field->get_value(ctx_field->priv, lttng_probe_ctx, &v);
+ ptr->ptr = v.u.str;
break;
}
case lttng_kernel_type_sequence:
return -EINVAL;
}
ptr->object_type = OBJECT_TYPE_STRING;
- ctx_field->get_value(ctx_field, lttng_probe_ctx, &v);
- ptr->ptr = v.str;
+ ctx_field->get_value(ctx_field->priv, lttng_probe_ctx, &v);
+ ptr->ptr = v.u.str;
break;
}
case lttng_kernel_type_string:
ptr->object_type = OBJECT_TYPE_STRING;
- ctx_field->get_value(ctx_field, lttng_probe_ctx, &v);
- ptr->ptr = v.str;
+ ctx_field->get_value(ctx_field->priv, lttng_probe_ctx, &v);
+ ptr->ptr = v.u.str;
break;
case lttng_kernel_type_struct:
printk(KERN_WARNING "LTTng: bytecode: Structure type cannot be loaded.\n");
struct load_op *insn = (struct load_op *) pc;
struct field_ref *ref = (struct field_ref *) insn->data;
struct lttng_kernel_ctx_field *ctx_field;
- union lttng_ctx_value v;
+ struct lttng_ctx_value v;
dbg_printk("get context ref offset %u type string\n",
ref->offset);
ctx_field = <tng_static_ctx->fields[ref->offset];
- ctx_field->get_value(ctx_field, lttng_probe_ctx, &v);
+ ctx_field->get_value(ctx_field->priv, lttng_probe_ctx, &v);
estack_push(stack, top, ax, bx, ax_t, bx_t);
- estack_ax(stack, top)->u.s.str = v.str;
+ estack_ax(stack, top)->u.s.str = v.u.str;
if (unlikely(!estack_ax(stack, top)->u.s.str)) {
dbg_printk("Bytecode warning: loading a NULL string.\n");
ret = -EINVAL;
struct load_op *insn = (struct load_op *) pc;
struct field_ref *ref = (struct field_ref *) insn->data;
struct lttng_kernel_ctx_field *ctx_field;
- union lttng_ctx_value v;
+ struct lttng_ctx_value v;
dbg_printk("get context ref offset %u type s64\n",
ref->offset);
ctx_field = <tng_static_ctx->fields[ref->offset];
- ctx_field->get_value(ctx_field, lttng_probe_ctx, &v);
+ ctx_field->get_value(ctx_field->priv, lttng_probe_ctx, &v);
estack_push(stack, top, ax, bx, ax_t, bx_t);
- estack_ax_v = v.s64;
+ estack_ax_v = v.u.s64;
estack_ax_t = REG_S64;
dbg_printk("ref get context s64 %lld\n",
(long long) estack_ax_v);
/* Keep track of nesting inside userspace callstack context code */
DEFINE_PER_CPU(int, callstack_user_nesting);
+/*
+ * Note: these callbacks expect to be invoked with preemption disabled across
+ * get_size and record due to its use of a per-cpu stack.
+ */
static
-struct stack_trace *stack_trace_context(struct lttng_kernel_ctx_field *field,
- struct lib_ring_buffer_ctx *ctx)
+struct stack_trace *stack_trace_context(struct field_data *fdata, int cpu)
{
int buffer_nesting, cs_user_nesting;
struct lttng_cs *cs;
- struct field_data *fdata = field->priv;
/*
* Do not gather the userspace callstack context when the event was
* triggered by the userspace callstack context saving mechanism.
*/
- cs_user_nesting = per_cpu(callstack_user_nesting, ctx->priv.reserve_cpu);
+ cs_user_nesting = per_cpu(callstack_user_nesting, cpu);
if (fdata->mode == CALLSTACK_USER && cs_user_nesting >= 1)
return NULL;
* max nesting is checked in lib_ring_buffer_get_cpu().
* Check it again as a safety net.
*/
- cs = per_cpu_ptr(fdata->cs_percpu, ctx->priv.reserve_cpu);
- buffer_nesting = per_cpu(lib_ring_buffer_nesting, ctx->priv.reserve_cpu) - 1;
+ cs = per_cpu_ptr(fdata->cs_percpu, cpu);
+ buffer_nesting = per_cpu(lib_ring_buffer_nesting, cpu) - 1;
if (buffer_nesting >= RING_BUFFER_MAX_NESTING)
return NULL;
}
static
-size_t lttng_callstack_length_get_size(size_t offset, struct lttng_kernel_ctx_field *field,
- struct lib_ring_buffer_ctx *ctx,
- struct lttng_channel *chan)
+size_t lttng_callstack_length_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t orig_offset = offset;
* resulting callstack is saved to be accessed in the record step.
*/
static
-size_t lttng_callstack_sequence_get_size(size_t offset, struct lttng_kernel_ctx_field *field,
- struct lib_ring_buffer_ctx *ctx,
- struct lttng_channel *chan)
+size_t lttng_callstack_sequence_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
struct stack_trace *trace;
- struct field_data *fdata = field->priv;
+ struct field_data *fdata = (struct field_data *) priv;
size_t orig_offset = offset;
+ int cpu = smp_processor_id();
/* do not write data if no space is available */
- trace = stack_trace_context(field, ctx);
+ trace = stack_trace_context(fdata, cpu);
if (unlikely(!trace)) {
offset += lib_ring_buffer_align(offset, lttng_alignof(unsigned long));
return offset - orig_offset;
trace->nr_entries = 0;
if (fdata->mode == CALLSTACK_USER)
- ++per_cpu(callstack_user_nesting, ctx->priv.reserve_cpu);
+ ++per_cpu(callstack_user_nesting, cpu);
/* do the real work and reserve space */
cs_types[fdata->mode].save_func(trace);
if (fdata->mode == CALLSTACK_USER)
- per_cpu(callstack_user_nesting, ctx->priv.reserve_cpu)--;
+ per_cpu(callstack_user_nesting, cpu)--;
/*
* Remove final ULONG_MAX delimiter. If we cannot find it, add
}
static
-void lttng_callstack_length_record(struct lttng_kernel_ctx_field *field,
+void lttng_callstack_length_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
- struct stack_trace *trace = stack_trace_context(field, ctx);
+ int cpu = ctx->priv.reserve_cpu;
+ struct field_data *fdata = (struct field_data *) priv;
+ struct stack_trace *trace = stack_trace_context(fdata, cpu);
unsigned int nr_seq_entries;
lib_ring_buffer_align_ctx(ctx, lttng_alignof(unsigned int));
chan->ops->event_write(ctx, &nr_seq_entries, sizeof(unsigned int));
}
static
-void lttng_callstack_sequence_record(struct lttng_kernel_ctx_field *field,
+void lttng_callstack_sequence_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
- struct stack_trace *trace = stack_trace_context(field, ctx);
+ int cpu = ctx->priv.reserve_cpu;
+ struct field_data *fdata = (struct field_data *) priv;
+ struct stack_trace *trace = stack_trace_context(fdata, cpu);
unsigned int nr_seq_entries;
lib_ring_buffer_align_ctx(ctx, lttng_alignof(unsigned long));
/* Keep track of nesting inside userspace callstack context code */
DEFINE_PER_CPU(int, callstack_user_nesting);
+/*
+ * Note: these callbacks expect to be invoked with preemption disabled across
+ * get_size and record due to its use of a per-cpu stack.
+ */
static
-struct lttng_stack_trace *stack_trace_context(struct lttng_kernel_ctx_field *field,
- struct lib_ring_buffer_ctx *ctx)
+struct lttng_stack_trace *stack_trace_context(struct field_data *fdata, int cpu)
{
int buffer_nesting, cs_user_nesting;
struct lttng_cs *cs;
- struct field_data *fdata = field->priv;
/*
* Do not gather the userspace callstack context when the event was
* triggered by the userspace callstack context saving mechanism.
*/
- cs_user_nesting = per_cpu(callstack_user_nesting, ctx->priv.reserve_cpu);
+ cs_user_nesting = per_cpu(callstack_user_nesting, cpu);
if (fdata->mode == CALLSTACK_USER && cs_user_nesting >= 1)
return NULL;
* max nesting is checked in lib_ring_buffer_get_cpu().
* Check it again as a safety net.
*/
- cs = per_cpu_ptr(fdata->cs_percpu, ctx->priv.reserve_cpu);
- buffer_nesting = per_cpu(lib_ring_buffer_nesting, ctx->priv.reserve_cpu) - 1;
+ cs = per_cpu_ptr(fdata->cs_percpu, cpu);
+ buffer_nesting = per_cpu(lib_ring_buffer_nesting, cpu) - 1;
if (buffer_nesting >= RING_BUFFER_MAX_NESTING)
return NULL;
}
static
-size_t lttng_callstack_length_get_size(size_t offset, struct lttng_kernel_ctx_field *field,
- struct lib_ring_buffer_ctx *ctx,
- struct lttng_channel *chan)
+size_t lttng_callstack_length_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t orig_offset = offset;
* resulting callstack is saved to be accessed in the record step.
*/
static
-size_t lttng_callstack_sequence_get_size(size_t offset, struct lttng_kernel_ctx_field *field,
- struct lib_ring_buffer_ctx *ctx,
- struct lttng_channel *chan)
+size_t lttng_callstack_sequence_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
struct lttng_stack_trace *trace;
- struct field_data *fdata = field->priv;
+ struct field_data *fdata = (struct field_data *) priv;
size_t orig_offset = offset;
+ int cpu = smp_processor_id();
/* do not write data if no space is available */
- trace = stack_trace_context(field, ctx);
+ trace = stack_trace_context(fdata, cpu);
if (unlikely(!trace)) {
offset += lib_ring_buffer_align(offset, lttng_alignof(unsigned long));
return offset - orig_offset;
MAX_ENTRIES, 0);
break;
case CALLSTACK_USER:
- ++per_cpu(callstack_user_nesting, ctx->priv.reserve_cpu);
+ ++per_cpu(callstack_user_nesting, cpu);
/* do the real work and reserve space */
trace->nr_entries = save_func_user(trace->entries,
MAX_ENTRIES);
- per_cpu(callstack_user_nesting, ctx->priv.reserve_cpu)--;
+ per_cpu(callstack_user_nesting, cpu)--;
break;
default:
WARN_ON_ONCE(1);
}
static
-void lttng_callstack_length_record(struct lttng_kernel_ctx_field *field,
+void lttng_callstack_length_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
- struct lttng_stack_trace *trace = stack_trace_context(field, ctx);
+ int cpu = ctx->priv.reserve_cpu;
+ struct field_data *fdata = (struct field_data *) priv;
+ struct lttng_stack_trace *trace = stack_trace_context(fdata, cpu);
unsigned int nr_seq_entries;
lib_ring_buffer_align_ctx(ctx, lttng_alignof(unsigned int));
}
static
-void lttng_callstack_sequence_record(struct lttng_kernel_ctx_field *field,
+void lttng_callstack_sequence_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
- struct lttng_stack_trace *trace = stack_trace_context(field, ctx);
+ int cpu = ctx->priv.reserve_cpu;
+ struct field_data *fdata = (struct field_data *) priv;
+ struct lttng_stack_trace *trace = stack_trace_context(fdata, cpu);
unsigned int nr_seq_entries;
lib_ring_buffer_align_ctx(ctx, lttng_alignof(unsigned long));
}
static
-void lttng_callstack_sequence_destroy(struct lttng_kernel_ctx_field *field)
+void lttng_callstack_sequence_destroy(void *priv)
{
- struct field_data *fdata = field->priv;
+ struct field_data *fdata = priv;
field_data_free(fdata);
}
}
memset(&ctx_field, 0, sizeof(ctx_field));
ctx_field.event_field = event_fields[0];
- ctx_field.get_size_arg = lttng_callstack_length_get_size;
+ ctx_field.get_size = lttng_callstack_length_get_size;
ctx_field.record = lttng_callstack_length_record;
ctx_field.priv = fdata;
ret = lttng_kernel_context_append(ctx, &ctx_field);
memset(&ctx_field, 0, sizeof(ctx_field));
ctx_field.event_field = event_fields[1];
- ctx_field.get_size_arg = lttng_callstack_sequence_get_size;
+ ctx_field.get_size = lttng_callstack_sequence_get_size;
ctx_field.record = lttng_callstack_sequence_record;
ctx_field.destroy = lttng_callstack_sequence_destroy;
ctx_field.priv = fdata;
LTTNG_UBUNTU_KERNEL_RANGE(4,4,0,0, 4,5,0,0))
static
-size_t cgroup_ns_get_size(size_t offset)
+size_t cgroup_ns_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t size = 0;
}
static
-void cgroup_ns_record(struct lttng_kernel_ctx_field *field,
+void cgroup_ns_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void cgroup_ns_get_value(struct lttng_kernel_ctx_field *field,
+void cgroup_ns_get_value(void *priv,
struct lttng_probe_ctx *lttng_probe_ctx,
- union lttng_ctx_value *value)
+ struct lttng_ctx_value *value)
{
unsigned int cgroup_ns_inum = 0;
if (current->nsproxy)
cgroup_ns_inum = current->nsproxy->cgroup_ns->lttng_ns_inum;
- value->s64 = cgroup_ns_inum;
+ value->u.s64 = cgroup_ns_inum;
}
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_type_integer_from_type(unsigned int, __BYTE_ORDER, 10),
false, false, false),
cgroup_ns_get_size,
- NULL,
cgroup_ns_record,
cgroup_ns_get_value,
NULL, NULL);
#include <lttng/tracer.h>
static
-size_t cpu_id_get_size(size_t offset)
+size_t cpu_id_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t size = 0;
}
static
-void cpu_id_record(struct lttng_kernel_ctx_field *field,
+void cpu_id_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void cpu_id_get_value(struct lttng_kernel_ctx_field *field,
+void cpu_id_get_value(void *priv,
struct lttng_probe_ctx *lttng_probe_ctx,
- union lttng_ctx_value *value)
+ struct lttng_ctx_value *value)
{
- value->s64 = smp_processor_id();
+ value->u.s64 = smp_processor_id();
}
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_type_integer_from_type(int, __BYTE_ORDER, 10),
false, false, false),
cpu_id_get_size,
- NULL,
cpu_id_record,
cpu_id_get_value,
NULL, NULL);
#include <wrapper/user_namespace.h>
static
-size_t egid_get_size(size_t offset)
+size_t egid_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t size = 0;
}
static
-void egid_record(struct lttng_kernel_ctx_field *field,
+void egid_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void egid_get_value(struct lttng_kernel_ctx_field *field,
+void egid_get_value(void *priv,
struct lttng_probe_ctx *lttng_probe_ctx,
- union lttng_ctx_value *value)
+ struct lttng_ctx_value *value)
{
- value->s64 = lttng_current_egid();
+ value->u.s64 = lttng_current_egid();
}
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_type_integer_from_type(gid_t, __BYTE_ORDER, 10),
false, false, false),
egid_get_size,
- NULL,
egid_record,
egid_get_value,
NULL, NULL);
#include <wrapper/user_namespace.h>
static
-size_t euid_get_size(size_t offset)
+size_t euid_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t size = 0;
}
static
-void euid_record(struct lttng_kernel_ctx_field *field,
+void euid_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void euid_get_value(struct lttng_kernel_ctx_field *field,
+void euid_get_value(void *priv,
struct lttng_probe_ctx *lttng_probe_ctx,
- union lttng_ctx_value *value)
+ struct lttng_ctx_value *value)
{
- value->s64 = lttng_current_euid();
+ value->u.s64 = lttng_current_euid();
}
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_type_integer_from_type(uid_t, __BYTE_ORDER, 10),
false, false, false),
euid_get_size,
- NULL,
euid_record,
euid_get_value,
NULL, NULL);
#include <wrapper/user_namespace.h>
static
-size_t gid_get_size(size_t offset)
+size_t gid_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t size = 0;
}
static
-void gid_record(struct lttng_kernel_ctx_field *field,
+void gid_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void gid_get_value(struct lttng_kernel_ctx_field *field,
+void gid_get_value(void *priv,
struct lttng_probe_ctx *lttng_probe_ctx,
- union lttng_ctx_value *value)
+ struct lttng_ctx_value *value)
{
- value->s64 = lttng_current_gid();
+ value->u.s64 = lttng_current_gid();
}
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_type_integer_from_type(gid_t, __BYTE_ORDER, 10),
false, false, false),
gid_get_size,
- NULL,
gid_record,
gid_get_value,
NULL, NULL);
#define LTTNG_HOSTNAME_CTX_LEN (__NEW_UTS_LEN + 1)
static
-size_t hostname_get_size(size_t offset)
+size_t hostname_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t size = 0;
}
static
-void hostname_record(struct lttng_kernel_ctx_field *field,
+void hostname_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void hostname_get_value(struct lttng_kernel_ctx_field *field,
+void hostname_get_value(void *priv,
struct lttng_probe_ctx *lttng_probe_ctx,
- union lttng_ctx_value *value)
+ struct lttng_ctx_value *value)
{
struct nsproxy *nsproxy;
struct uts_namespace *ns;
} else {
hostname = "";
}
- value->str = hostname;
+ value->u.str = hostname;
}
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_type_array_text(LTTNG_HOSTNAME_CTX_LEN),
false, false, false),
hostname_get_size,
- NULL,
hostname_record,
hostname_get_value,
NULL, NULL);
*/
static
-size_t interruptible_get_size(size_t offset)
+size_t interruptible_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t size = 0;
}
static
-void interruptible_record(struct lttng_kernel_ctx_field *field,
+void interruptible_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void interruptible_get_value(struct lttng_kernel_ctx_field *field,
+void interruptible_get_value(void *priv,
struct lttng_probe_ctx *lttng_probe_ctx,
- union lttng_ctx_value *value)
+ struct lttng_ctx_value *value)
{
int8_t interruptible = lttng_probe_ctx->interruptible;
- value->s64 = interruptible;
+ value->u.s64 = interruptible;
}
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_type_integer_from_type(int8_t, __BYTE_ORDER, 10),
false, false, false),
interruptible_get_size,
- NULL,
interruptible_record,
interruptible_get_value,
NULL, NULL);
(LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
static
-size_t ipc_ns_get_size(size_t offset)
+size_t ipc_ns_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t size = 0;
}
static
-void ipc_ns_record(struct lttng_kernel_ctx_field *field,
+void ipc_ns_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void ipc_ns_get_value(struct lttng_kernel_ctx_field *field,
+void ipc_ns_get_value(void *priv,
struct lttng_probe_ctx *lttng_probe_ctx,
- union lttng_ctx_value *value)
+ struct lttng_ctx_value *value)
{
unsigned int ipc_ns_inum = 0;
if (current->nsproxy)
ipc_ns_inum = current->nsproxy->ipc_ns->lttng_ns_inum;
- value->s64 = ipc_ns_inum;
+ value->u.s64 = ipc_ns_inum;
}
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_type_integer_from_type(unsigned int, __BYTE_ORDER, 10),
false, false, false),
ipc_ns_get_size,
- NULL,
ipc_ns_record,
ipc_ns_get_value,
NULL, NULL);
#include <lttng/tracer.h>
static
-size_t migratable_get_size(size_t offset)
+size_t migratable_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t size = 0;
}
static
-void migratable_record(struct lttng_kernel_ctx_field *field,
+void migratable_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void migratable_get_value(struct lttng_kernel_ctx_field *field,
+void migratable_get_value(void *priv,
struct lttng_probe_ctx *lttng_probe_ctx,
- union lttng_ctx_value *value)
+ struct lttng_ctx_value *value)
{
- value->s64 = !current->migrate_disable;
+ value->u.s64 = !current->migrate_disable;
}
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_type_integer_from_type(uint8_t, __BYTE_ORDER, 10),
false, false, false),
migratable_get_size,
- NULL,
migratable_record,
migratable_get_value,
NULL, NULL);
#include <../fs/mount.h>
static
-size_t mnt_ns_get_size(size_t offset)
+size_t mnt_ns_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t size = 0;
}
static
-void mnt_ns_record(struct lttng_kernel_ctx_field *field,
+void mnt_ns_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void mnt_ns_get_value(struct lttng_kernel_ctx_field *field,
+void mnt_ns_get_value(void *priv,
struct lttng_probe_ctx *lttng_probe_ctx,
- union lttng_ctx_value *value)
+ struct lttng_ctx_value *value)
{
unsigned int mnt_ns_inum = 0;
if (current->nsproxy)
mnt_ns_inum = current->nsproxy->mnt_ns->lttng_ns_inum;
- value->s64 = mnt_ns_inum;
+ value->u.s64 = mnt_ns_inum;
}
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_type_integer_from_type(unsigned int, __BYTE_ORDER, 10),
false, false, false),
mnt_ns_get_size,
- NULL,
mnt_ns_record,
mnt_ns_get_value,
NULL, NULL);
#include <lttng/tracer.h>
static
-size_t need_reschedule_get_size(size_t offset)
+size_t need_reschedule_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t size = 0;
}
static
-void need_reschedule_record(struct lttng_kernel_ctx_field *field,
+void need_reschedule_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void need_reschedule_get_value(struct lttng_kernel_ctx_field *field,
+void need_reschedule_get_value(void *priv,
struct lttng_probe_ctx *lttng_probe_ctx,
- union lttng_ctx_value *value)
+ struct lttng_ctx_value *value)
{
- value->s64 = test_tsk_need_resched(current);;
+ value->u.s64 = test_tsk_need_resched(current);;
}
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_type_integer_from_type(uint8_t, __BYTE_ORDER, 10),
false, false, false),
need_reschedule_get_size,
- NULL,
need_reschedule_record,
need_reschedule_get_value,
NULL, NULL);
(LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
static
-size_t net_ns_get_size(size_t offset)
+size_t net_ns_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t size = 0;
}
static
-void net_ns_record(struct lttng_kernel_ctx_field *field,
+void net_ns_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void net_ns_get_value(struct lttng_kernel_ctx_field *field,
+void net_ns_get_value(void *priv,
struct lttng_probe_ctx *lttng_probe_ctx,
- union lttng_ctx_value *value)
+ struct lttng_ctx_value *value)
{
unsigned int net_ns_inum = 0;
if (current->nsproxy)
net_ns_inum = current->nsproxy->net_ns->lttng_ns_inum;
- value->s64 = net_ns_inum;
+ value->u.s64 = net_ns_inum;
}
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_type_integer_from_type(unsigned int, __BYTE_ORDER, 10),
false, false, false),
net_ns_get_size,
- NULL,
net_ns_record,
net_ns_get_value,
NULL, NULL);
#include <lttng/tracer.h>
static
-size_t nice_get_size(size_t offset)
+size_t nice_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t size = 0;
}
static
-void nice_record(struct lttng_kernel_ctx_field *field,
+void nice_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void nice_get_value(struct lttng_kernel_ctx_field *field,
+void nice_get_value(void *priv,
struct lttng_probe_ctx *lttng_probe_ctx,
- union lttng_ctx_value *value)
+ struct lttng_ctx_value *value)
{
- value->s64 = task_nice(current);
+ value->u.s64 = task_nice(current);
}
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_type_integer_from_type(int, __BYTE_ORDER, 10),
false, false, false),
nice_get_size,
- NULL,
nice_record,
nice_get_value,
NULL, NULL);
#include <lttng/tracer.h>
static
-size_t perf_counter_get_size(size_t offset)
+size_t perf_counter_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t size = 0;
}
static
-void perf_counter_record(struct lttng_kernel_ctx_field *field,
+void perf_counter_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
- struct lttng_perf_counter_field *perf_field = field->priv;
+ struct lttng_perf_counter_field *perf_field = (struct lttng_perf_counter_field *) priv;
struct perf_event *event;
uint64_t value;
#endif
static
-void lttng_destroy_perf_counter_ctx_field(struct lttng_kernel_ctx_field *field)
+void lttng_destroy_perf_counter_ctx_field(void *priv)
{
- struct lttng_perf_counter_field *perf_field = field->priv;
+ struct lttng_perf_counter_field *perf_field = priv;
struct perf_event **events = perf_field->e;
#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,10,0))
(LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
static
-size_t pid_ns_get_size(size_t offset)
+size_t pid_ns_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t size = 0;
}
static
-void pid_ns_record(struct lttng_kernel_ctx_field *field,
+void pid_ns_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void pid_ns_get_value(struct lttng_kernel_ctx_field *field,
+void pid_ns_get_value(void *priv,
struct lttng_probe_ctx *lttng_probe_ctx,
- union lttng_ctx_value *value)
+ struct lttng_ctx_value *value)
{
struct pid_namespace *ns;
unsigned int pid_ns_inum = 0;
if (ns)
pid_ns_inum = ns->lttng_ns_inum;
- value->s64 = pid_ns_inum;
+ value->u.s64 = pid_ns_inum;
}
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_type_integer_from_type(unsigned int, __BYTE_ORDER, 10),
false, false, false),
pid_ns_get_size,
- NULL,
pid_ns_record,
pid_ns_get_value,
NULL, NULL);
#include <lttng/tracer.h>
static
-size_t pid_get_size(size_t offset)
+size_t pid_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t size = 0;
}
static
-void pid_record(struct lttng_kernel_ctx_field *field,
+void pid_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void pid_get_value(struct lttng_kernel_ctx_field *field,
+void pid_get_value(void *priv,
struct lttng_probe_ctx *lttng_probe_ctx,
- union lttng_ctx_value *value)
+ struct lttng_ctx_value *value)
{
- value->s64 = task_tgid_nr(current);
+ value->u.s64 = task_tgid_nr(current);
}
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_type_integer_from_type(pid_t, __BYTE_ORDER, 10),
false, false, false),
pid_get_size,
- NULL,
pid_record,
pid_get_value,
NULL, NULL);
#include <lttng/tracer.h>
static
-size_t ppid_get_size(size_t offset)
+size_t ppid_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t size = 0;
}
static
-void ppid_record(struct lttng_kernel_ctx_field *field,
+void ppid_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void ppid_get_value(struct lttng_kernel_ctx_field *field,
+void ppid_get_value(void *priv,
struct lttng_probe_ctx *lttng_probe_ctx,
- union lttng_ctx_value *value)
+ struct lttng_ctx_value *value)
{
pid_t ppid;
rcu_read_lock();
ppid = task_tgid_nr(current->real_parent);
rcu_read_unlock();
- value->s64 = ppid;
+ value->u.s64 = ppid;
}
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_type_integer_from_type(pid_t, __BYTE_ORDER, 10),
false, false, false),
ppid_get_size,
- NULL,
ppid_record,
ppid_get_value,
NULL, NULL);
}
static
-size_t prio_get_size(size_t offset)
+size_t prio_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t size = 0;
}
static
-void prio_record(struct lttng_kernel_ctx_field *field,
+void prio_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void prio_get_value(struct lttng_kernel_ctx_field *field,
+void prio_get_value(void *priv,
struct lttng_probe_ctx *lttng_probe_ctx,
- union lttng_ctx_value *value)
+ struct lttng_ctx_value *value)
{
- value->s64 = wrapper_task_prio_sym(current);
+ value->u.s64 = wrapper_task_prio_sym(current);
}
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_type_integer_from_type(int, __BYTE_ORDER, 10),
false, false, false),
prio_get_size,
- NULL,
prio_record,
prio_get_value,
NULL, NULL);
#include <lttng/endian.h>
static
-size_t procname_get_size(size_t offset)
+size_t procname_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t size = 0;
* could lead to crash in IRQ context and deadlock of the lockdep tracer.
*/
static
-void procname_record(struct lttng_kernel_ctx_field *field,
+void procname_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void procname_get_value(struct lttng_kernel_ctx_field *field,
+void procname_get_value(void *priv,
struct lttng_probe_ctx *lttng_probe_ctx,
- union lttng_ctx_value *value)
+ struct lttng_ctx_value *value)
{
- value->str = current->comm;
+ value->u.str = current->comm;
}
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_type_array_text(sizeof(current->comm)),
false, false, false),
procname_get_size,
- NULL,
procname_record,
procname_get_value,
NULL, NULL);
#include <wrapper/user_namespace.h>
static
-size_t sgid_get_size(size_t offset)
+size_t sgid_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t size = 0;
}
static
-void sgid_record(struct lttng_kernel_ctx_field *field,
+void sgid_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void sgid_get_value(struct lttng_kernel_ctx_field *field,
+void sgid_get_value(void *priv,
struct lttng_probe_ctx *lttng_probe_ctx,
- union lttng_ctx_value *value)
+ struct lttng_ctx_value *value)
{
- value->s64 = lttng_current_sgid();
+ value->u.s64 = lttng_current_sgid();
}
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_type_integer_from_type(gid_t, __BYTE_ORDER, 10),
false, false, false),
sgid_get_size,
- NULL,
sgid_record,
sgid_get_value,
NULL, NULL);
#include <wrapper/user_namespace.h>
static
-size_t suid_get_size(size_t offset)
+size_t suid_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t size = 0;
}
static
-void suid_record(struct lttng_kernel_ctx_field *field,
+void suid_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void suid_get_value(struct lttng_kernel_ctx_field *field,
+void suid_get_value(void *priv,
struct lttng_probe_ctx *lttng_probe_ctx,
- union lttng_ctx_value *value)
+ struct lttng_ctx_value *value)
{
- value->s64 = lttng_current_suid();
+ value->u.s64 = lttng_current_suid();
}
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_type_integer_from_type(uid_t, __BYTE_ORDER, 10),
false, false, false),
suid_get_size,
- NULL,
suid_record,
suid_get_value,
NULL, NULL);
#include <lttng/tracer.h>
static
-size_t tid_get_size(size_t offset)
+size_t tid_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t size = 0;
}
static
-void tid_record(struct lttng_kernel_ctx_field *field,
+void tid_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void tid_get_value(struct lttng_kernel_ctx_field *field,
+void tid_get_value(void *priv,
struct lttng_probe_ctx *lttng_probe_ctx,
- union lttng_ctx_value *value)
+ struct lttng_ctx_value *value)
{
pid_t tid;
tid = task_pid_nr(current);
- value->s64 = tid;
+ value->u.s64 = tid;
}
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_type_integer_from_type(pid_t, __BYTE_ORDER, 10),
false, false, false),
tid_get_size,
- NULL,
tid_record,
tid_get_value,
NULL, NULL);
#if defined(CONFIG_TIME_NS)
static
-size_t time_ns_get_size(size_t offset)
+size_t time_ns_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t size = 0;
}
static
-void time_ns_record(struct lttng_kernel_ctx_field *field,
+void time_ns_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void time_ns_get_value(struct lttng_kernel_ctx_field *field,
+void time_ns_get_value(void *priv,
struct lttng_probe_ctx *lttng_probe_ctx,
- union lttng_ctx_value *value)
+ struct lttng_ctx_value *value)
{
unsigned int time_ns_inum = 0;
if (current->nsproxy)
time_ns_inum = current->nsproxy->time_ns->lttng_ns_inum;
- value->s64 = time_ns_inum;
+ value->u.s64 = time_ns_inum;
}
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_type_integer_from_type(unsigned int, __BYTE_ORDER, 10),
false, false, false),
time_ns_get_size,
- NULL,
time_ns_record,
time_ns_get_value,
NULL, NULL);
#include <wrapper/user_namespace.h>
static
-size_t uid_get_size(size_t offset)
+size_t uid_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t size = 0;
}
static
-void uid_record(struct lttng_kernel_ctx_field *field,
+void uid_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void uid_get_value(struct lttng_kernel_ctx_field *field,
+void uid_get_value(void *priv,
struct lttng_probe_ctx *lttng_probe_ctx,
- union lttng_ctx_value *value)
+ struct lttng_ctx_value *value)
{
- value->s64 = lttng_current_uid();
+ value->u.s64 = lttng_current_uid();
}
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_type_integer_from_type(uid_t, __BYTE_ORDER, 10),
false, false, false),
uid_get_size,
- NULL,
uid_record,
uid_get_value,
NULL, NULL);
(LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
static
-size_t user_ns_get_size(size_t offset)
+size_t user_ns_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t size = 0;
}
static
-void user_ns_record(struct lttng_kernel_ctx_field *field,
+void user_ns_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void user_ns_get_value(struct lttng_kernel_ctx_field *field,
+void user_ns_get_value(void *priv,
struct lttng_probe_ctx *lttng_probe_ctx,
- union lttng_ctx_value *value)
+ struct lttng_ctx_value *value)
{
unsigned int user_ns_inum = 0;
if (current_user_ns())
user_ns_inum = current_user_ns()->lttng_ns_inum;
- value->s64 = user_ns_inum;
+ value->u.s64 = user_ns_inum;
}
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_type_integer_from_type(unsigned int, __BYTE_ORDER, 10),
false, false, false),
user_ns_get_size,
- NULL,
user_ns_record,
user_ns_get_value,
NULL, NULL);
(LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
static
-size_t uts_ns_get_size(size_t offset)
+size_t uts_ns_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t size = 0;
}
static
-void uts_ns_record(struct lttng_kernel_ctx_field *field,
+void uts_ns_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void uts_ns_get_value(struct lttng_kernel_ctx_field *field,
+void uts_ns_get_value(void *priv,
struct lttng_probe_ctx *lttng_probe_ctx,
- union lttng_ctx_value *value)
+ struct lttng_ctx_value *value)
{
unsigned int uts_ns_inum = 0;
if (current->nsproxy)
uts_ns_inum = current->nsproxy->uts_ns->lttng_ns_inum;
- value->s64 = uts_ns_inum;
+ value->u.s64 = uts_ns_inum;
}
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_type_integer_from_type(unsigned int, __BYTE_ORDER, 10),
false, false, false),
uts_ns_get_size,
- NULL,
uts_ns_record,
uts_ns_get_value,
NULL, NULL);
#include <wrapper/user_namespace.h>
static
-size_t vegid_get_size(size_t offset)
+size_t vegid_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t size = 0;
}
static
-void vegid_record(struct lttng_kernel_ctx_field *field,
+void vegid_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void vegid_get_value(struct lttng_kernel_ctx_field *field,
+void vegid_get_value(void *priv,
struct lttng_probe_ctx *lttng_probe_ctx,
- union lttng_ctx_value *value)
+ struct lttng_ctx_value *value)
{
- value->s64 = lttng_current_vegid();
+ value->u.s64 = lttng_current_vegid();
}
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_type_integer_from_type(gid_t, __BYTE_ORDER, 10),
false, false, false),
vegid_get_size,
- NULL,
vegid_record,
vegid_get_value,
NULL, NULL);
#include <wrapper/user_namespace.h>
static
-size_t veuid_get_size(size_t offset)
+size_t veuid_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t size = 0;
}
static
-void veuid_record(struct lttng_kernel_ctx_field *field,
+void veuid_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void veuid_get_value(struct lttng_kernel_ctx_field *field,
+void veuid_get_value(void *priv,
struct lttng_probe_ctx *lttng_probe_ctx,
- union lttng_ctx_value *value)
+ struct lttng_ctx_value *value)
{
- value->s64 = lttng_current_veuid();
+ value->u.s64 = lttng_current_veuid();
}
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_type_integer_from_type(uid_t, __BYTE_ORDER, 10),
false, false, false),
veuid_get_size,
- NULL,
veuid_record,
veuid_get_value,
NULL, NULL);
#include <wrapper/user_namespace.h>
static
-size_t vgid_get_size(size_t offset)
+size_t vgid_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t size = 0;
}
static
-void vgid_record(struct lttng_kernel_ctx_field *field,
+void vgid_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void vgid_get_value(struct lttng_kernel_ctx_field *field,
+void vgid_get_value(void *priv,
struct lttng_probe_ctx *lttng_probe_ctx,
- union lttng_ctx_value *value)
+ struct lttng_ctx_value *value)
{
- value->s64 = lttng_current_vgid();
+ value->u.s64 = lttng_current_vgid();
}
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_type_integer_from_type(gid_t, __BYTE_ORDER, 10),
false, false, false),
vgid_get_size,
- NULL,
vgid_record,
vgid_get_value,
NULL, NULL);
#include <lttng/tracer.h>
static
-size_t vpid_get_size(size_t offset)
+size_t vpid_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t size = 0;
}
static
-void vpid_record(struct lttng_kernel_ctx_field *field,
+void vpid_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void vpid_get_value(struct lttng_kernel_ctx_field *field,
+void vpid_get_value(void *priv,
struct lttng_probe_ctx *lttng_probe_ctx,
- union lttng_ctx_value *value)
+ struct lttng_ctx_value *value)
{
pid_t vpid;
vpid = 0;
else
vpid = task_tgid_vnr(current);
- value->s64 = vpid;
+ value->u.s64 = vpid;
}
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_type_integer_from_type(pid_t, __BYTE_ORDER, 10),
false, false, false),
vpid_get_size,
- NULL,
vpid_record,
vpid_get_value,
NULL, NULL);
#include <lttng/tracer.h>
static
-size_t vppid_get_size(size_t offset)
+size_t vppid_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t size = 0;
}
static
-void vppid_record(struct lttng_kernel_ctx_field *field,
+void vppid_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void vppid_get_value(struct lttng_kernel_ctx_field *field,
+void vppid_get_value(void *priv,
struct lttng_probe_ctx *lttng_probe_ctx,
- union lttng_ctx_value *value)
+ struct lttng_ctx_value *value)
{
struct task_struct *parent;
pid_t vppid;
else
vppid = task_tgid_vnr(parent);
rcu_read_unlock();
- value->s64 = vppid;
+ value->u.s64 = vppid;
}
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_type_integer_from_type(pid_t, __BYTE_ORDER, 10),
false, false, false),
vppid_get_size,
- NULL,
vppid_record,
vppid_get_value,
NULL, NULL);
#include <wrapper/user_namespace.h>
static
-size_t vsgid_get_size(size_t offset)
+size_t vsgid_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t size = 0;
}
static
-void vsgid_record(struct lttng_kernel_ctx_field *field,
+void vsgid_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void vsgid_get_value(struct lttng_kernel_ctx_field *field,
+void vsgid_get_value(void *priv,
struct lttng_probe_ctx *lttng_probe_ctx,
- union lttng_ctx_value *value)
+ struct lttng_ctx_value *value)
{
- value->s64 = lttng_current_vsgid();
+ value->u.s64 = lttng_current_vsgid();
}
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_type_integer_from_type(gid_t, __BYTE_ORDER, 10),
false, false, false),
vsgid_get_size,
- NULL,
vsgid_record,
vsgid_get_value,
NULL, NULL);
#include <wrapper/user_namespace.h>
static
-size_t vsuid_get_size(size_t offset)
+size_t vsuid_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t size = 0;
}
static
-void vsuid_record(struct lttng_kernel_ctx_field *field,
+void vsuid_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void vsuid_get_value(struct lttng_kernel_ctx_field *field,
+void vsuid_get_value(void *priv,
struct lttng_probe_ctx *lttng_probe_ctx,
- union lttng_ctx_value *value)
+ struct lttng_ctx_value *value)
{
- value->s64 = lttng_current_vsuid();
+ value->u.s64 = lttng_current_vsuid();
}
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_type_integer_from_type(uid_t, __BYTE_ORDER, 10),
false, false, false),
vsuid_get_size,
- NULL,
vsuid_record,
vsuid_get_value,
NULL, NULL);
#include <lttng/tracer.h>
static
-size_t vtid_get_size(size_t offset)
+size_t vtid_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t size = 0;
}
static
-void vtid_record(struct lttng_kernel_ctx_field *field,
+void vtid_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void vtid_get_value(struct lttng_kernel_ctx_field *field,
+void vtid_get_value(void *priv,
struct lttng_probe_ctx *lttng_probe_ctx,
- union lttng_ctx_value *value)
+ struct lttng_ctx_value *value)
{
pid_t vtid;
vtid = 0;
else
vtid = task_pid_vnr(current);
- value->s64 = vtid;
+ value->u.s64 = vtid;
}
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_type_integer_from_type(pid_t, __BYTE_ORDER, 10),
false, false, false),
vtid_get_size,
- NULL,
vtid_record,
vtid_get_value,
NULL, NULL);
#include <wrapper/user_namespace.h>
static
-size_t vuid_get_size(size_t offset)
+size_t vuid_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
{
size_t size = 0;
}
static
-void vuid_record(struct lttng_kernel_ctx_field *field,
+void vuid_record(void *priv, struct lttng_probe_ctx *probe_ctx,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
}
static
-void vuid_get_value(struct lttng_kernel_ctx_field *field,
+void vuid_get_value(void *priv,
struct lttng_probe_ctx *lttng_probe_ctx,
- union lttng_ctx_value *value)
+ struct lttng_ctx_value *value)
{
- value->s64 = lttng_current_vuid();
+ value->u.s64 = lttng_current_vuid();
}
static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
lttng_kernel_static_type_integer_from_type(uid_t, __BYTE_ORDER, 10),
false, false, false),
vuid_get_size,
- NULL,
vuid_record,
vuid_get_value,
NULL, NULL);
return;
for (i = 0; i < ctx->nr_fields; i++) {
if (ctx->fields[i].destroy)
- ctx->fields[i].destroy(&ctx->fields[i]);
+ ctx->fields[i].destroy(ctx->fields[i].priv);
}
lttng_kvfree(ctx->fields);
kfree(ctx);
return;
}
for (i = 0; i < ctx->nr_fields; i++) {
- if (ctx->fields[i].get_size)
- offset += ctx->fields[i].get_size(offset);
- if (ctx->fields[i].get_size_arg)
- offset += ctx->fields[i].get_size_arg(offset,
- &ctx->fields[i], bufctx, chan);
+ offset += ctx->fields[i].get_size(ctx->fields[i].priv,
+ bufctx->probe_ctx, offset);
}
*ctx_len = offset;
}
return;
lib_ring_buffer_align_ctx(bufctx, ctx->largest_align);
for (i = 0; i < ctx->nr_fields; i++)
- ctx->fields[i].record(&ctx->fields[i], bufctx, chan);
+ ctx->fields[i].record(ctx->fields[i].priv, bufctx->probe_ctx,
+ bufctx, chan);
}
/*