X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Flib%2Flttng-ctl%2Fevent.cpp;h=b136640dfce031a557cec8a01c98e1d754c17c3c;hb=cd9adb8b829564212158943a0d279bb35322ab30;hp=c33adf1197e15485469921417f5654c3958028b5;hpb=64803277bbdbe0a943360d918298a48157d9da55;p=lttng-tools.git diff --git a/src/lib/lttng-ctl/event.cpp b/src/lib/lttng-ctl/event.cpp index c33adf119..b136640df 100644 --- a/src/lib/lttng-ctl/event.cpp +++ b/src/lib/lttng-ctl/event.cpp @@ -10,15 +10,16 @@ */ #define _LGPL_SOURCE -#include - #include #include + #include #include #include #include +#include + struct lttng_event *lttng_event_create(void) { struct lttng_event *event; @@ -40,7 +41,7 @@ end: return event; error: free(event); - event = NULL; + event = nullptr; goto end; } @@ -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; @@ -81,7 +80,7 @@ int lttng_event_get_filter_expression(struct lttng_event *event, * This can happen since the lttng_event structure is * used for other tasks where this pointer is never set. */ - *filter_expression = NULL; + *filter_expression = nullptr; goto end; } @@ -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; } @@ -158,7 +157,7 @@ end: const struct lttng_userspace_probe_location * lttng_event_get_userspace_probe_location(const struct lttng_event *event) { - struct lttng_userspace_probe_location *probe_location = NULL; + struct lttng_userspace_probe_location *probe_location = nullptr; struct lttng_event_extended *event_extended; if (!event) { @@ -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: