int (*event_reserve)(struct lttng_kernel_ring_buffer_ctx *ctx);
void (*event_commit)(struct lttng_kernel_ring_buffer_ctx *ctx);
void (*event_write)(struct lttng_kernel_ring_buffer_ctx *ctx, const void *src,
- size_t len);
+ size_t len, size_t alignment);
void (*event_write_from_user)(struct lttng_kernel_ring_buffer_ctx *ctx,
- const void *src, size_t len);
+ const void *src, size_t len, size_t alignment);
void (*event_memset)(struct lttng_kernel_ring_buffer_ctx *ctx,
int c, size_t len);
void (*event_strcpy)(struct lttng_kernel_ring_buffer_ctx *ctx, const char *src,
#define _ctf_integer_ext_fetched(_type, _item, _src, _byte_order, _base, _nowrite) \
{ \
_type __tmp = _src; \
- lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(__tmp));\
- __chan->ops->event_write(&__ctx, &__tmp, sizeof(__tmp));\
+ __chan->ops->event_write(&__ctx, &__tmp, sizeof(__tmp), lttng_alignof(__tmp)); \
}
#undef _ctf_integer_ext_isuser0
#undef _ctf_array_encoded
#define _ctf_array_encoded(_type, _item, _src, _length, _encoding, _byte_order, _base, _user, _nowrite) \
- lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_type)); \
if (_user) { \
- __chan->ops->event_write_from_user(&__ctx, _src, sizeof(_type) * (_length)); \
+ __chan->ops->event_write_from_user(&__ctx, _src, sizeof(_type) * (_length), lttng_alignof(_type)); \
} else { \
- __chan->ops->event_write(&__ctx, _src, sizeof(_type) * (_length)); \
+ __chan->ops->event_write(&__ctx, _src, sizeof(_type) * (_length), lttng_alignof(_type)); \
}
#if (__BYTE_ORDER == __LITTLE_ENDIAN)
#undef _ctf_array_bitfield
#define _ctf_array_bitfield(_type, _item, _src, _length, _user, _nowrite) \
- lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_type)); \
if (_user) { \
- __chan->ops->event_write_from_user(&__ctx, _src, sizeof(_type) * (_length)); \
+ __chan->ops->event_write_from_user(&__ctx, _src, sizeof(_type) * (_length), lttng_alignof(_type)); \
} else { \
- __chan->ops->event_write(&__ctx, _src, sizeof(_type) * (_length)); \
+ __chan->ops->event_write(&__ctx, _src, sizeof(_type) * (_length), lttng_alignof(_type)); \
}
#else /* #if (__BYTE_ORDER == __LITTLE_ENDIAN) */
/*
default: \
BUG_ON(1); \
} \
- __chan->ops->event_write(&__ctx, &_tmp, sizeof(_type)); \
+ __chan->ops->event_write(&__ctx, &_tmp, sizeof(_type), 1); \
} \
}
#endif /* #else #if (__BYTE_ORDER == __LITTLE_ENDIAN) */
_src_length, _encoding, _byte_order, _base, _user, _nowrite) \
{ \
_length_type __tmpl = this_cpu_ptr(<tng_dynamic_len_stack)->stack[__dynamic_len_idx]; \
- lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_length_type));\
- __chan->ops->event_write(&__ctx, &__tmpl, sizeof(_length_type));\
+ __chan->ops->event_write(&__ctx, &__tmpl, sizeof(_length_type), lttng_alignof(_length_type));\
} \
- lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_type)); \
if (_user) { \
__chan->ops->event_write_from_user(&__ctx, _src, \
- sizeof(_type) * __get_dynamic_len(dest)); \
+ sizeof(_type) * __get_dynamic_len(dest), lttng_alignof(_type)); \
} else { \
__chan->ops->event_write(&__ctx, _src, \
- sizeof(_type) * __get_dynamic_len(dest)); \
+ sizeof(_type) * __get_dynamic_len(dest), lttng_alignof(_type)); \
}
#if (__BYTE_ORDER == __LITTLE_ENDIAN)
_user, _nowrite) \
{ \
_length_type __tmpl = this_cpu_ptr(<tng_dynamic_len_stack)->stack[__dynamic_len_idx] * sizeof(_type) * CHAR_BIT; \
- lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_length_type));\
- __chan->ops->event_write(&__ctx, &__tmpl, sizeof(_length_type));\
+ __chan->ops->event_write(&__ctx, &__tmpl, sizeof(_length_type), lttng_alignof(_length_type)); \
} \
- lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_type)); \
if (_user) { \
__chan->ops->event_write_from_user(&__ctx, _src, \
- sizeof(_type) * __get_dynamic_len(dest)); \
+ sizeof(_type) * __get_dynamic_len(dest), lttng_alignof(_type)); \
} else { \
__chan->ops->event_write(&__ctx, _src, \
- sizeof(_type) * __get_dynamic_len(dest)); \
+ sizeof(_type) * __get_dynamic_len(dest), lttng_alignof(_type)); \
}
#else /* #if (__BYTE_ORDER == __LITTLE_ENDIAN) */
/*
_user, _nowrite) \
{ \
_length_type __tmpl = this_cpu_ptr(<tng_dynamic_len_stack)->stack[__dynamic_len_idx] * sizeof(_type) * CHAR_BIT; \
- lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_length_type));\
- __chan->ops->event_write(&__ctx, &__tmpl, sizeof(_length_type));\
+ __chan->ops->event_write(&__ctx, &__tmpl, sizeof(_length_type), lttng_alignof(_length_type)); \
} \
lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_type)); \
{ \
default: \
BUG_ON(1); \
} \
- __chan->ops->event_write(&__ctx, &_tmp, sizeof(_type)); \
+ __chan->ops->event_write(&__ctx, &_tmp, sizeof(_type), 1); \
} \
}
#endif /* #else #if (__BYTE_ORDER == __LITTLE_ENDIAN) */
struct stack_trace *trace = stack_trace_context(fdata, cpu);
unsigned int nr_seq_entries;
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(unsigned int));
if (unlikely(!trace)) {
nr_seq_entries = 0;
} else {
if (trace->nr_entries == trace->max_entries)
nr_seq_entries++;
}
- chan->ops->event_write(ctx, &nr_seq_entries, sizeof(unsigned int));
+ chan->ops->event_write(ctx, &nr_seq_entries, sizeof(unsigned int), lttng_alignof(unsigned int));
}
static
void lttng_callstack_sequence_record(void *priv, struct lttng_kernel_probe_ctx *probe_ctx,
struct stack_trace *trace = stack_trace_context(fdata, cpu);
unsigned int nr_seq_entries;
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(unsigned long));
if (unlikely(!trace)) {
+ lib_ring_buffer_align_ctx(ctx, lttng_alignof(unsigned long));
return;
}
nr_seq_entries = trace->nr_entries;
if (trace->nr_entries == trace->max_entries)
nr_seq_entries++;
chan->ops->event_write(ctx, trace->entries,
- sizeof(unsigned long) * trace->nr_entries);
+ sizeof(unsigned long) * trace->nr_entries, lttng_alignof(unsigned long));
/* Add our own ULONG_MAX delimiter to show incomplete stack. */
if (trace->nr_entries == trace->max_entries) {
unsigned long delim = ULONG_MAX;
- chan->ops->event_write(ctx, &delim, sizeof(unsigned long));
+ chan->ops->event_write(ctx, &delim, sizeof(unsigned long), 1);
}
}
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));
if (unlikely(!trace)) {
nr_seq_entries = 0;
} else {
if (trace->nr_entries == MAX_ENTRIES)
nr_seq_entries++;
}
- chan->ops->event_write(ctx, &nr_seq_entries, sizeof(unsigned int));
+ chan->ops->event_write(ctx, &nr_seq_entries, sizeof(unsigned int), lttng_alignof(unsigned int));
}
static
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));
if (unlikely(!trace)) {
+ /* We need to align even if there are 0 elements. */
+ lib_ring_buffer_align_ctx(ctx, lttng_alignof(unsigned long));
return;
}
nr_seq_entries = trace->nr_entries;
if (trace->nr_entries == MAX_ENTRIES)
nr_seq_entries++;
chan->ops->event_write(ctx, trace->entries,
- sizeof(unsigned long) * trace->nr_entries);
+ sizeof(unsigned long) * trace->nr_entries, lttng_alignof(unsigned long));
/* Add our own ULONG_MAX delimiter to show incomplete stack. */
if (trace->nr_entries == MAX_ENTRIES) {
unsigned long delim = ULONG_MAX;
- chan->ops->event_write(ctx, &delim, sizeof(unsigned long));
+ chan->ops->event_write(ctx, &delim, sizeof(unsigned long), 1);
}
}
if (current->nsproxy)
cgroup_ns_inum = current->nsproxy->cgroup_ns->lttng_ns_inum;
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(cgroup_ns_inum));
- chan->ops->event_write(ctx, &cgroup_ns_inum, sizeof(cgroup_ns_inum));
+ chan->ops->event_write(ctx, &cgroup_ns_inum, sizeof(cgroup_ns_inum), lttng_alignof(cgroup_ns_inum));
}
static
int cpu;
cpu = ctx->priv.reserve_cpu;
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(cpu));
- chan->ops->event_write(ctx, &cpu, sizeof(cpu));
+ chan->ops->event_write(ctx, &cpu, sizeof(cpu), lttng_alignof(cpu));
}
static
gid_t egid;
egid = lttng_current_egid();
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(egid));
- chan->ops->event_write(ctx, &egid, sizeof(egid));
+ chan->ops->event_write(ctx, &egid, sizeof(egid), lttng_alignof(egid));
}
static
uid_t euid;
euid = lttng_current_euid();
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(euid));
- chan->ops->event_write(ctx, &euid, sizeof(euid));
+ chan->ops->event_write(ctx, &euid, sizeof(euid), lttng_alignof(euid));
}
static
gid_t gid;
gid = lttng_current_gid();
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(gid));
- chan->ops->event_write(ctx, &gid, sizeof(gid));
+ chan->ops->event_write(ctx, &gid, sizeof(gid), lttng_alignof(gid));
}
static
ns = nsproxy->uts_ns;
hostname = ns->name.nodename;
chan->ops->event_write(ctx, hostname,
- LTTNG_HOSTNAME_CTX_LEN);
+ LTTNG_HOSTNAME_CTX_LEN, 1);
} else {
chan->ops->event_memset(ctx, 0,
LTTNG_HOSTNAME_CTX_LEN);
struct lttng_kernel_probe_ctx *lttng_probe_ctx = ctx->probe_ctx;
int8_t interruptible = lttng_probe_ctx->interruptible;
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(interruptible));
- chan->ops->event_write(ctx, &interruptible, sizeof(interruptible));
+ chan->ops->event_write(ctx, &interruptible, sizeof(interruptible), lttng_alignof(interruptible));
}
static
if (current->nsproxy)
ipc_ns_inum = current->nsproxy->ipc_ns->lttng_ns_inum;
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(ipc_ns_inum));
- chan->ops->event_write(ctx, &ipc_ns_inum, sizeof(ipc_ns_inum));
+ chan->ops->event_write(ctx, &ipc_ns_inum, sizeof(ipc_ns_inum), lttng_alignof(ipc_ns_inum));
}
static
{
uint8_t migratable = !current->migrate_disable;
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(migratable));
- chan->ops->event_write(ctx, &migratable, sizeof(migratable));
+ chan->ops->event_write(ctx, &migratable, sizeof(migratable), lttng_alignof(migratable));
}
static
if (current->nsproxy)
mnt_ns_inum = current->nsproxy->mnt_ns->lttng_ns_inum;
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(mnt_ns_inum));
- chan->ops->event_write(ctx, &mnt_ns_inum, sizeof(mnt_ns_inum));
+ chan->ops->event_write(ctx, &mnt_ns_inum, sizeof(mnt_ns_inum), lttng_alignof(mnt_ns_inum));
}
static
{
uint8_t need_reschedule = test_tsk_need_resched(current);
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(need_reschedule));
- chan->ops->event_write(ctx, &need_reschedule, sizeof(need_reschedule));
+ chan->ops->event_write(ctx, &need_reschedule, sizeof(need_reschedule), lttng_alignof(need_reschedule));
}
static
if (current->nsproxy)
net_ns_inum = current->nsproxy->net_ns->lttng_ns_inum;
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(net_ns_inum));
- chan->ops->event_write(ctx, &net_ns_inum, sizeof(net_ns_inum));
+ chan->ops->event_write(ctx, &net_ns_inum, sizeof(net_ns_inum), lttng_alignof(net_ns_inum));
}
static
int nice;
nice = task_nice(current);
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(nice));
- chan->ops->event_write(ctx, &nice, sizeof(nice));
+ chan->ops->event_write(ctx, &nice, sizeof(nice), lttng_alignof(nice));
}
static
*/
value = 0;
}
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(value));
- chan->ops->event_write(ctx, &value, sizeof(value));
+ chan->ops->event_write(ctx, &value, sizeof(value), lttng_alignof(value));
}
#if defined(CONFIG_PERF_EVENTS) && (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,1,0))
if (ns)
pid_ns_inum = ns->lttng_ns_inum;
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(pid_ns_inum));
- chan->ops->event_write(ctx, &pid_ns_inum, sizeof(pid_ns_inum));
+ chan->ops->event_write(ctx, &pid_ns_inum, sizeof(pid_ns_inum), lttng_alignof(pid_ns_inum));
}
static
pid_t pid;
pid = task_tgid_nr(current);
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(pid));
- chan->ops->event_write(ctx, &pid, sizeof(pid));
+ chan->ops->event_write(ctx, &pid, sizeof(pid), lttng_alignof(pid));
}
static
rcu_read_lock();
ppid = task_tgid_nr(current->real_parent);
rcu_read_unlock();
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(ppid));
- chan->ops->event_write(ctx, &ppid, sizeof(ppid));
+ chan->ops->event_write(ctx, &ppid, sizeof(ppid), lttng_alignof(ppid));
}
static
WARN_ON_ONCE(pc < LTTNG_PREEMPT_DISABLE_NESTING);
if (pc == LTTNG_PREEMPT_DISABLE_NESTING)
preemptible = 1;
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(preemptible));
- chan->ops->event_write(ctx, &preemptible, sizeof(preemptible));
+ chan->ops->event_write(ctx, &preemptible, sizeof(preemptible), lttng_alignof(preemptible));
}
static
int prio;
prio = wrapper_task_prio_sym(current);
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(prio));
- chan->ops->event_write(ctx, &prio, sizeof(prio));
+ chan->ops->event_write(ctx, &prio, sizeof(prio), lttng_alignof(prio));
}
static
struct lttng_kernel_ring_buffer_ctx *ctx,
struct lttng_kernel_channel_buffer *chan)
{
- chan->ops->event_write(ctx, current->comm, sizeof(current->comm));
+ chan->ops->event_write(ctx, current->comm, sizeof(current->comm), 1);
}
static
gid_t sgid;
sgid = lttng_current_sgid();
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(sgid));
- chan->ops->event_write(ctx, &sgid, sizeof(sgid));
+ chan->ops->event_write(ctx, &sgid, sizeof(sgid), lttng_alignof(sgid));
}
static
uid_t suid;
suid = lttng_current_suid();
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(suid));
- chan->ops->event_write(ctx, &suid, sizeof(suid));
+ chan->ops->event_write(ctx, &suid, sizeof(suid), lttng_alignof(suid));
}
static
pid_t tid;
tid = task_pid_nr(current);
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(tid));
- chan->ops->event_write(ctx, &tid, sizeof(tid));
+ chan->ops->event_write(ctx, &tid, sizeof(tid), lttng_alignof(tid));
}
static
if (current->nsproxy)
time_ns_inum = current->nsproxy->time_ns->lttng_ns_inum;
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(time_ns_inum));
- chan->ops->event_write(ctx, &time_ns_inum, sizeof(time_ns_inum));
+ chan->ops->event_write(ctx, &time_ns_inum, sizeof(time_ns_inum), lttng_alignof(time_ns_inum));
}
static
uid_t uid;
uid = lttng_current_uid();
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(uid));
- chan->ops->event_write(ctx, &uid, sizeof(uid));
+ chan->ops->event_write(ctx, &uid, sizeof(uid), lttng_alignof(uid));
}
static
if (current_user_ns())
user_ns_inum = current_user_ns()->lttng_ns_inum;
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(user_ns_inum));
- chan->ops->event_write(ctx, &user_ns_inum, sizeof(user_ns_inum));
+ chan->ops->event_write(ctx, &user_ns_inum, sizeof(user_ns_inum), lttng_alignof(user_ns_inum));
}
static
if (current->nsproxy)
uts_ns_inum = current->nsproxy->uts_ns->lttng_ns_inum;
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(uts_ns_inum));
- chan->ops->event_write(ctx, &uts_ns_inum, sizeof(uts_ns_inum));
+ chan->ops->event_write(ctx, &uts_ns_inum, sizeof(uts_ns_inum), lttng_alignof(uts_ns_inum));
}
static
gid_t vegid;
vegid = lttng_current_vegid();
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(vegid));
- chan->ops->event_write(ctx, &vegid, sizeof(vegid));
+ chan->ops->event_write(ctx, &vegid, sizeof(vegid), lttng_alignof(vegid));
}
static
uid_t veuid;
veuid = lttng_current_veuid();
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(veuid));
- chan->ops->event_write(ctx, &veuid, sizeof(veuid));
+ chan->ops->event_write(ctx, &veuid, sizeof(veuid), lttng_alignof(veuid));
}
static
gid_t vgid;
vgid = lttng_current_vgid();
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(vgid));
- chan->ops->event_write(ctx, &vgid, sizeof(vgid));
+ chan->ops->event_write(ctx, &vgid, sizeof(vgid), lttng_alignof(vgid));
}
static
vpid = 0;
else
vpid = task_tgid_vnr(current);
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(vpid));
- chan->ops->event_write(ctx, &vpid, sizeof(vpid));
+ chan->ops->event_write(ctx, &vpid, sizeof(vpid), lttng_alignof(vpid));
}
static
else
vppid = task_tgid_vnr(parent);
rcu_read_unlock();
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(vppid));
- chan->ops->event_write(ctx, &vppid, sizeof(vppid));
+ chan->ops->event_write(ctx, &vppid, sizeof(vppid), lttng_alignof(vppid));
}
static
gid_t vsgid;
vsgid = lttng_current_vsgid();
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(vsgid));
- chan->ops->event_write(ctx, &vsgid, sizeof(vsgid));
+ chan->ops->event_write(ctx, &vsgid, sizeof(vsgid), lttng_alignof(vsgid));
}
static
uid_t vsuid;
vsuid = lttng_current_vsuid();
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(vsuid));
- chan->ops->event_write(ctx, &vsuid, sizeof(vsuid));
+ chan->ops->event_write(ctx, &vsuid, sizeof(vsuid), lttng_alignof(vsuid));
}
static
vtid = 0;
else
vtid = task_pid_vnr(current);
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(vtid));
- chan->ops->event_write(ctx, &vtid, sizeof(vtid));
+ chan->ops->event_write(ctx, &vtid, sizeof(vtid), lttng_alignof(vtid));
}
static
uid_t vuid;
vuid = lttng_current_vuid();
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(vuid));
- chan->ops->event_write(ctx, &vuid, sizeof(vuid));
+ chan->ops->event_write(ctx, &vuid, sizeof(vuid), lttng_alignof(vuid));
}
static
return;
}
- lib_ring_buffer_align_ctx(&ctx, lttng_alignof(kernel_notif));
-
/* Write the notif structure. */
event_notifier_group->ops->event_write(&ctx, &kernel_notif,
- sizeof(kernel_notif));
+ sizeof(kernel_notif), lttng_alignof(kernel_notif));
/*
* Write the capture buffer. No need to realigned as the below is a raw
* char* buffer.
*/
event_notifier_group->ops->event_write(&ctx, ¬if->capture_buf,
- capture_buffer_content_len);
+ capture_buffer_content_len, 1);
event_notifier_group->ops->event_commit(&ctx);
irq_work_queue(&event_notifier_group->wakeup_pending);
}
stream->transport->ops.event_write(&ctx,
stream->metadata_cache->data + stream->metadata_in,
- reserve_len);
+ reserve_len, 1);
stream->transport->ops.event_commit(&ctx);
stream->metadata_in += reserve_len;
if (reserve_len < len)
static
void lttng_event_write(struct lttng_kernel_ring_buffer_ctx *ctx, const void *src,
- size_t len)
+ size_t len, size_t alignment)
{
+ lib_ring_buffer_align_ctx(ctx, alignment);
lib_ring_buffer_write(&client_config, ctx, src, len);
}
static
void lttng_event_write_from_user(struct lttng_kernel_ring_buffer_ctx *ctx,
- const void __user *src, size_t len)
+ const void __user *src, size_t len, size_t alignment)
{
+ lib_ring_buffer_align_ctx(ctx, alignment);
lib_ring_buffer_copy_from_user_inatomic(&client_config, ctx, src, len);
}
static
void lttng_event_write(struct lttng_kernel_ring_buffer_ctx *ctx, const void *src,
- size_t len)
+ size_t len, size_t alignment)
{
+ lib_ring_buffer_align_ctx(ctx, alignment);
lib_ring_buffer_write(&client_config, ctx, src, len);
}
static
void lttng_event_write_from_user(struct lttng_kernel_ring_buffer_ctx *ctx,
- const void __user *src, size_t len)
+ const void __user *src, size_t len, size_t alignment)
{
+ lib_ring_buffer_align_ctx(ctx, alignment);
lib_ring_buffer_copy_from_user_inatomic(&client_config, ctx, src, len);
}
static
void lttng_event_write(struct lttng_kernel_ring_buffer_ctx *ctx, const void *src,
- size_t len)
+ size_t len, size_t alignment)
{
+ lib_ring_buffer_align_ctx(ctx, alignment);
lib_ring_buffer_write(&client_config, ctx, src, len);
}
static
void lttng_event_write_from_user(struct lttng_kernel_ring_buffer_ctx *ctx,
- const void __user *src, size_t len)
+ const void __user *src, size_t len, size_t alignment)
{
+ lib_ring_buffer_align_ctx(ctx, alignment);
lib_ring_buffer_copy_from_user_inatomic(&client_config, ctx, src, len);
}
ret = chan->ops->event_reserve(&ctx);
if (ret < 0)
return 0;
- lib_ring_buffer_align_ctx(&ctx, lttng_alignof(data));
- chan->ops->event_write(&ctx, &data, sizeof(data));
+ chan->ops->event_write(&ctx, &data, sizeof(data), lttng_alignof(data));
chan->ops->event_commit(&ctx);
break;
}
ret = chan->ops->event_reserve(&ctx);
if (ret < 0)
return 0;
- lib_ring_buffer_align_ctx(&ctx, lttng_alignof(payload));
- chan->ops->event_write(&ctx, &payload, sizeof(payload));
+ chan->ops->event_write(&ctx, &payload, sizeof(payload), lttng_alignof(payload));
chan->ops->event_commit(&ctx);
break;
}
/* Event payload. */
payload.ip = (unsigned long)instruction_pointer(regs);
- lib_ring_buffer_align_ctx(&ctx, lttng_alignof(payload));
- chan->ops->event_write(&ctx, &payload, sizeof(payload));
+ chan->ops->event_write(&ctx, &payload, sizeof(payload), lttng_alignof(payload));
chan->ops->event_commit(&ctx);
break;
}