X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Flib%2Flttng-ctl%2Fevent.cpp;h=141fb56842ca5723d71444bf61bfd6d8aac3f99e;hb=28ab034a2c3582d07d3423d2d746731f87d3969f;hp=3a6bf22b2ec90987014acd5f085230d04fdf638e;hpb=4bd69c5f1161cd065f487da0f4c1aa03a73c47e4;p=lttng-tools.git diff --git a/src/lib/lttng-ctl/event.cpp b/src/lib/lttng-ctl/event.cpp index 3a6bf22b2..141fb5684 100644 --- a/src/lib/lttng-ctl/event.cpp +++ b/src/lib/lttng-ctl/event.cpp @@ -10,27 +10,28 @@ */ #define _LGPL_SOURCE -#include +#include +#include -#include -#include -#include +#include #include #include -#include +#include + +#include struct lttng_event *lttng_event_create(void) { struct lttng_event *event; struct lttng_event_extended *event_extended; - event = (lttng_event *) zmalloc(sizeof(*event)); + event = zmalloc(); if (!event) { PERROR("Error allocating event structure"); goto end; } - event_extended = (lttng_event_extended *) zmalloc(sizeof(*event_extended)); + event_extended = zmalloc(); if (!event_extended) { PERROR("Error allocating event extended structure"); goto error; @@ -56,16 +57,14 @@ void lttng_event_destroy(struct lttng_event *event) if (event_extended) { if (event_extended->probe_location) { - lttng_userspace_probe_location_destroy( - event_extended->probe_location); + lttng_userspace_probe_location_destroy(event_extended->probe_location); } free(event_extended); } free(event); } -int lttng_event_get_filter_expression(struct lttng_event *event, - const char **filter_expression) +int lttng_event_get_filter_expression(struct lttng_event *event, const char **filter_expression) { int ret = 0; struct lttng_event_extended *event_extended; @@ -119,7 +118,8 @@ end: } int lttng_event_get_exclusion_name(struct lttng_event *event, - size_t index, const char **exclusion_name) + size_t index, + const char **exclusion_name) { int ret = 0; struct lttng_event_extended *event_extended; @@ -149,8 +149,7 @@ int lttng_event_get_exclusion_name(struct lttng_event *event, goto end; } - *exclusion_name = event_extended->exclusions.strings + - (index * LTTNG_SYMBOL_NAME_LEN); + *exclusion_name = event_extended->exclusions.strings + (index * LTTNG_SYMBOL_NAME_LEN); end: return ret; } @@ -175,7 +174,7 @@ end: } int lttng_event_set_userspace_probe_location(struct lttng_event *event, - struct lttng_userspace_probe_location *probe_location) + struct lttng_userspace_probe_location *probe_location) { int ret = 0; struct lttng_event_extended *event_extended; @@ -188,8 +187,7 @@ int lttng_event_set_userspace_probe_location(struct lttng_event *event, event_extended = (struct lttng_event_extended *) event->extended.ptr; LTTNG_ASSERT(event_extended); if (event_extended->probe_location) { - lttng_userspace_probe_location_destroy( - event_extended->probe_location); + lttng_userspace_probe_location_destroy(event_extended->probe_location); } event_extended->probe_location = probe_location; end: