summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
3f6807b)
The release of GCC 9 added the following warning:
-Waddress-of-packed-member, enabled by default, warns about an
unaligned pointer value from the address of a packed member of a
struct or union.
The warning is triggered in some place in LTTng-UST in cases where we
pass a pointer to get a result. Rather than passing the pointer directly
from the struct member, we get the result into a local storage, then
write into in the struct.
Signed-off-by: Gabriel-Andrew Pollo-Guilbert <gabriel.pollo-guilbert@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
int serialize_integer_type(struct ustctl_integer_type *uit,
const struct lttng_integer_type *lit)
{
int serialize_integer_type(struct ustctl_integer_type *uit,
const struct lttng_integer_type *lit)
{
uit->size = lit->size;
uit->signedness = lit->signedness;
uit->reverse_byte_order = lit->reverse_byte_order;
uit->base = lit->base;
uit->size = lit->size;
uit->signedness = lit->signedness;
uit->reverse_byte_order = lit->reverse_byte_order;
uit->base = lit->base;
- if (serialize_string_encoding(&uit->encoding, lit->encoding))
+ if (serialize_string_encoding(&encoding, lit->encoding))
+ uit->encoding = encoding;
uit->alignment = lit->alignment;
return 0;
}
uit->alignment = lit->alignment;
return 0;
}
- if (serialize_string_encoding(&ubt->string.encoding,
- lbt->string.encoding))
+ int32_t encoding;
+
+ if (serialize_string_encoding(&encoding, lbt->string.encoding))
+ ubt->string.encoding = encoding;
*uatype = ustctl_atype_string;
break;
}
*uatype = ustctl_atype_string;
break;
}
{
struct ustctl_field *uf = &fields[*iter_output];
struct ustctl_type *ut = &uf->type;
{
struct ustctl_field *uf = &fields[*iter_output];
struct ustctl_type *ut = &uf->type;
+ enum ustctl_abstract_types atype;
strncpy(uf->name, lf->name, LTTNG_UST_SYM_NAME_LEN);
uf->name[LTTNG_UST_SYM_NAME_LEN - 1] = '\0';
strncpy(uf->name, lf->name, LTTNG_UST_SYM_NAME_LEN);
uf->name[LTTNG_UST_SYM_NAME_LEN - 1] = '\0';
- ret = serialize_basic_type(session, &ut->atype, lt->atype,
+ ret = serialize_basic_type(session, &atype, lt->atype,
&ut->u.basic, <->u.basic);
if (ret)
return ret;
&ut->u.basic, <->u.basic);
if (ret)
return ret;
(*iter_output)++;
break;
}
(*iter_output)++;
break;
}
struct ustctl_type *ut = &uf->type;
struct ustctl_basic_type *ubt;
const struct lttng_basic_type *lbt;
struct ustctl_type *ut = &uf->type;
struct ustctl_basic_type *ubt;
const struct lttng_basic_type *lbt;
+ enum ustctl_abstract_types atype;
strncpy(uf->name, lf->name, LTTNG_UST_SYM_NAME_LEN);
uf->name[LTTNG_UST_SYM_NAME_LEN - 1] = '\0';
strncpy(uf->name, lf->name, LTTNG_UST_SYM_NAME_LEN);
uf->name[LTTNG_UST_SYM_NAME_LEN - 1] = '\0';
ubt = &ut->u.array.elem_type;
lbt = <->u.array.elem_type;
ut->u.array.length = lt->u.array.length;
ubt = &ut->u.array.elem_type;
lbt = <->u.array.elem_type;
ut->u.array.length = lt->u.array.length;
- ret = serialize_basic_type(session, &ubt->atype, lbt->atype,
+ ret = serialize_basic_type(session, &atype, lbt->atype,
&ubt->u.basic, &lbt->u.basic);
if (ret)
return -EINVAL;
&ubt->u.basic, &lbt->u.basic);
if (ret)
return -EINVAL;
ut->atype = ustctl_atype_array;
(*iter_output)++;
break;
ut->atype = ustctl_atype_array;
(*iter_output)++;
break;
struct ustctl_type *ut = &uf->type;
struct ustctl_basic_type *ubt;
const struct lttng_basic_type *lbt;
struct ustctl_type *ut = &uf->type;
struct ustctl_basic_type *ubt;
const struct lttng_basic_type *lbt;
+ enum ustctl_abstract_types atype;
int ret;
strncpy(uf->name, lf->name, LTTNG_UST_SYM_NAME_LEN);
int ret;
strncpy(uf->name, lf->name, LTTNG_UST_SYM_NAME_LEN);
uf->type.atype = ustctl_atype_sequence;
ubt = &ut->u.sequence.length_type;
lbt = <->u.sequence.length_type;
uf->type.atype = ustctl_atype_sequence;
ubt = &ut->u.sequence.length_type;
lbt = <->u.sequence.length_type;
- ret = serialize_basic_type(session, &ubt->atype, lbt->atype,
+ ret = serialize_basic_type(session, &atype, lbt->atype,
&ubt->u.basic, &lbt->u.basic);
if (ret)
return -EINVAL;
&ubt->u.basic, &lbt->u.basic);
if (ret)
return -EINVAL;
ubt = &ut->u.sequence.elem_type;
lbt = <->u.sequence.elem_type;
ubt = &ut->u.sequence.elem_type;
lbt = <->u.sequence.elem_type;
- ret = serialize_basic_type(session, &ubt->atype, lbt->atype,
+ ret = serialize_basic_type(session, &atype, lbt->atype,
&ubt->u.basic, &lbt->u.basic);
if (ret)
return -EINVAL;
&ubt->u.basic, &lbt->u.basic);
if (ret)
return -EINVAL;
ut->atype = ustctl_atype_sequence;
(*iter_output)++;
break;
ut->atype = ustctl_atype_sequence;
(*iter_output)++;
break;
}
case LTTNG_UST_STREAM:
{
}
case LTTNG_UST_STREAM:
{
+ uint64_t memory_map_size;
+
/* Receive shm_fd, wakeup_fd */
ret = ustcomm_recv_stream_from_sessiond(sock,
/* Receive shm_fd, wakeup_fd */
ret = ustcomm_recv_stream_from_sessiond(sock,
&args.stream.shm_fd,
&args.stream.wakeup_fd);
if (ret) {
goto error;
}
&args.stream.shm_fd,
&args.stream.wakeup_fd);
if (ret) {
goto error;
}
+ lum->u.stream.len = memory_map_size;
+
if (ops->cmd)
ret = ops->cmd(lum->handle, lum->cmd,
(unsigned long) &lum->u,
if (ops->cmd)
ret = ops->cmd(lum->handle, lum->cmd,
(unsigned long) &lum->u,