projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cleanup: namespace 'align' macros
[lttng-tools.git]
/
src
/
common
/
tracker.c
diff --git
a/src/common/tracker.c
b/src/common/tracker.c
index 532a924b56a772b3d55d11e611028ebf7267a7fe..f3a9f258b808ffa8d4b56663915c2d95855583e8 100644
(file)
--- a/
src/common/tracker.c
+++ b/
src/common/tracker.c
@@
-59,7
+59,6
@@
static inline bool is_value_type_name(
value_type == LTTNG_PROCESS_ATTR_VALUE_TYPE_GROUP_NAME;
}
value_type == LTTNG_PROCESS_ATTR_VALUE_TYPE_GROUP_NAME;
}
-LTTNG_HIDDEN
enum lttng_error_code process_attr_value_from_comm(
enum lttng_domain_type domain,
enum lttng_process_attr process_attr,
enum lttng_error_code process_attr_value_from_comm(
enum lttng_domain_type domain,
enum lttng_process_attr process_attr,
@@
-85,6
+84,7
@@
enum lttng_error_code process_attr_value_from_comm(
name = strdup(value_view->data);
if (!name) {
ret = LTTNG_ERR_NOMEM;
name = strdup(value_view->data);
if (!name) {
ret = LTTNG_ERR_NOMEM;
+ goto error;
}
}
}
}
@@
-102,10
+102,12
@@
enum lttng_error_code process_attr_value_from_comm(
}
/* Only expect a payload for name value types. */
}
/* Only expect a payload for name value types. */
- if (is_value_type_name(value_type) && value_view->size == 0) {
+ if (is_value_type_name(value_type) &&
+ (!value_view || value_view->size == 0)) {
ret = LTTNG_ERR_INVALID_PROTOCOL;
goto error;
ret = LTTNG_ERR_INVALID_PROTOCOL;
goto error;
- } else if (!is_value_type_name(value_type) && value_view->size != 0) {
+ } else if (!is_value_type_name(value_type) && value_view &&
+ value_view->size != 0) {
ret = LTTNG_ERR_INVALID_PROTOCOL;
goto error;
}
ret = LTTNG_ERR_INVALID_PROTOCOL;
goto error;
}
@@
-173,6
+175,7
@@
enum lttng_error_code process_attr_value_from_comm(
*_value = value;
value = NULL;
*_value = value;
value = NULL;
+ free(name);
return LTTNG_OK;
error:
free(name);
return LTTNG_OK;
error:
free(name);
@@
-180,7
+183,6
@@
error:
return ret;
}
return ret;
}
-LTTNG_HIDDEN
const char *lttng_process_attr_to_string(enum lttng_process_attr process_attr)
{
switch (process_attr) {
const char *lttng_process_attr_to_string(enum lttng_process_attr process_attr)
{
switch (process_attr) {
@@
-208,7
+210,6
@@
static void process_attr_tracker_value_destructor(void *ptr)
process_attr_value_destroy(value);
}
process_attr_value_destroy(value);
}
-LTTNG_HIDDEN
struct lttng_process_attr_values *lttng_process_attr_values_create(void)
{
struct lttng_process_attr_values *values = zmalloc(sizeof(*values));
struct lttng_process_attr_values *lttng_process_attr_values_create(void)
{
struct lttng_process_attr_values *values = zmalloc(sizeof(*values));
@@
-223,7
+224,6
@@
end:
return values;
}
return values;
}
-LTTNG_HIDDEN
unsigned int _lttng_process_attr_values_get_count(
const struct lttng_process_attr_values *values)
{
unsigned int _lttng_process_attr_values_get_count(
const struct lttng_process_attr_values *values)
{
@@
-231,7
+231,6
@@
unsigned int _lttng_process_attr_values_get_count(
&values->array);
}
&values->array);
}
-LTTNG_HIDDEN
const struct process_attr_value *lttng_process_attr_tracker_values_get_at_index(
const struct lttng_process_attr_values *values,
unsigned int index)
const struct process_attr_value *lttng_process_attr_tracker_values_get_at_index(
const struct lttng_process_attr_values *values,
unsigned int index)
@@
-290,7
+289,6
@@
end:
return ret;
}
return ret;
}
-LTTNG_HIDDEN
int lttng_process_attr_values_serialize(
const struct lttng_process_attr_values *values,
struct lttng_dynamic_buffer *buffer)
int lttng_process_attr_values_serialize(
const struct lttng_process_attr_values *values,
struct lttng_dynamic_buffer *buffer)
@@
-321,7
+319,6
@@
end:
return ret;
}
return ret;
}
-LTTNG_HIDDEN
ssize_t lttng_process_attr_values_create_from_buffer(
enum lttng_domain_type domain,
enum lttng_process_attr process_attr,
ssize_t lttng_process_attr_values_create_from_buffer(
enum lttng_domain_type domain,
enum lttng_process_attr process_attr,
@@
-341,9
+338,10
@@
ssize_t lttng_process_attr_values_create_from_buffer(
header_view = lttng_buffer_view_from_view(
buffer_view, 0, sizeof(*header));
header_view = lttng_buffer_view_from_view(
buffer_view, 0, sizeof(*header));
- if (!
header_view.data
) {
+ if (!
lttng_buffer_view_is_valid(&header_view)
) {
goto error;
}
goto error;
}
+
offset = header_view.size;
header = (typeof(header)) header_view.data;
offset = header_view.size;
header = (typeof(header)) header_view.data;
@@
-366,7
+364,7
@@
ssize_t lttng_process_attr_values_create_from_buffer(
value_view = lttng_buffer_view_from_view(
buffer_view, offset, sizeof(*value_comm));
value_view = lttng_buffer_view_from_view(
buffer_view, offset, sizeof(*value_comm));
- if (!
value_view.data
) {
+ if (!
lttng_buffer_view_is_valid(&value_view)
) {
goto error;
}
goto error;
}
@@
-378,8
+376,13
@@
ssize_t lttng_process_attr_values_create_from_buffer(
value_name_view = lttng_buffer_view_from_view(
buffer_view, offset,
value_comm->value.name_len);
value_name_view = lttng_buffer_view_from_view(
buffer_view, offset,
value_comm->value.name_len);
+ if (!lttng_buffer_view_is_valid(&value_name_view)) {
+ goto error;
+ }
+
offset += value_name_view.size;
}
offset += value_name_view.size;
}
+
ret_code = process_attr_value_from_comm(domain, process_attr,
type, &value_comm->value.integral,
&value_name_view, &value);
ret_code = process_attr_value_from_comm(domain, process_attr,
type, &value_comm->value.integral,
&value_name_view, &value);
@@
-402,7
+405,6
@@
error:
return -1;
}
return -1;
}
-LTTNG_HIDDEN
void lttng_process_attr_values_destroy(struct lttng_process_attr_values *values)
{
if (!values) {
void lttng_process_attr_values_destroy(struct lttng_process_attr_values *values)
{
if (!values) {
@@
-412,7
+414,6
@@
void lttng_process_attr_values_destroy(struct lttng_process_attr_values *values)
free(values);
}
free(values);
}
-LTTNG_HIDDEN
struct process_attr_value *process_attr_value_copy(
const struct process_attr_value *value)
{
struct process_attr_value *process_attr_value_copy(
const struct process_attr_value *value)
{
@@
-450,7
+451,6
@@
error:
return NULL;
}
return NULL;
}
-LTTNG_HIDDEN
unsigned long process_attr_value_hash(const struct process_attr_value *a)
{
unsigned long hash = hash_key_ulong((void *) a->type, lttng_ht_seed);
unsigned long process_attr_value_hash(const struct process_attr_value *a)
{
unsigned long hash = hash_key_ulong((void *) a->type, lttng_ht_seed);
@@
-481,7
+481,6
@@
unsigned long process_attr_value_hash(const struct process_attr_value *a)
return hash;
}
return hash;
}
-LTTNG_HIDDEN
bool process_attr_tracker_value_equal(const struct process_attr_value *a,
const struct process_attr_value *b)
{
bool process_attr_tracker_value_equal(const struct process_attr_value *a,
const struct process_attr_value *b)
{
@@
-504,7
+503,6
@@
bool process_attr_tracker_value_equal(const struct process_attr_value *a,
}
}
}
}
-LTTNG_HIDDEN
void process_attr_value_destroy(struct process_attr_value *value)
{
if (!value) {
void process_attr_value_destroy(struct process_attr_value *value)
{
if (!value) {
This page took
0.027186 seconds
and
4
git commands to generate.