X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Fnotification.cpp;h=51e5693cd464fb2bb4ebd96c0c60862da6b5ca3d;hb=c15e2d3d72435e0e1e73db51b1ef896a75740ef0;hp=989c20ade5e1f126ffcf2609e7f0eea21e2f4028;hpb=a6bc4ca9d659caf016ef932fcd944029737ac57c;p=lttng-tools.git diff --git a/src/common/notification.cpp b/src/common/notification.cpp index 989c20ade..51e5693cd 100644 --- a/src/common/notification.cpp +++ b/src/common/notification.cpp @@ -5,14 +5,14 @@ * */ -#include -#include -#include +#include +#include +#include #include #include -#include -#include -#include +#include +#include +#include struct lttng_notification *lttng_notification_create( struct lttng_trigger *trigger, @@ -24,7 +24,7 @@ struct lttng_notification *lttng_notification_create( goto end; } - notification = (lttng_notification *) zmalloc(sizeof(struct lttng_notification)); + notification = zmalloc(); if (!notification) { goto end; } @@ -40,9 +40,11 @@ int lttng_notification_serialize(const struct lttng_notification *notification, { int ret; size_t header_offset, size_before_payload; - struct lttng_notification_comm notification_comm = { 0 }; + struct lttng_notification_comm notification_comm; struct lttng_notification_comm *header; + notification_comm.length = 0; + header_offset = payload->buffer.size; ret = lttng_dynamic_buffer_append(&payload->buffer, ¬ification_comm, sizeof(notification_comm)); @@ -175,6 +177,24 @@ const struct lttng_evaluation *lttng_notification_get_evaluation( return notification ? notification->evaluation : NULL; } +const struct lttng_condition *lttng_notification_get_const_condition( + const struct lttng_notification *notification) +{ + return notification ? lttng_trigger_get_const_condition(notification->trigger) : NULL; +} + +const struct lttng_evaluation *lttng_notification_get_const_evaluation( + const struct lttng_notification *notification) +{ + return notification ? notification->evaluation : NULL; +} + +const struct lttng_trigger *lttng_notification_get_const_trigger( + const struct lttng_notification *notification) +{ + return notification ? notification->trigger : NULL; +} + const struct lttng_trigger *lttng_notification_get_trigger( struct lttng_notification *notification) {