diff --git a/include/maestro/pool.h b/include/maestro/pool.h index a37e1d2d31ae19e96c1c98baecfe657cdbc0eb21..532b7282f09c73bf78020579a03c6d89bb14cb90 100644 --- a/include/maestro/pool.h +++ b/include/maestro/pool.h @@ -387,6 +387,7 @@ mstro_subscribe(mstro_cdo_selector cdos, mstro_pool_event_kinds events, struct mstro_pool_event_ { enum mstro_pool_event_kind kind; /**< the event kind */ uint64_t serial; /**< the event identifier */ + mstro_nanosec_t ctime; /**< the time the event was created at the source */ union { /* for DECLARE events */ struct { diff --git a/maestro/subscription_registry.c b/maestro/subscription_registry.c index bd3056a1bfec345e7cad2ab3623d8efb6dda6960..0ccd7c6d38674d2a7e0ced83c0e17f8101743a33 100644 --- a/maestro/subscription_registry.c +++ b/maestro/subscription_registry.c @@ -1863,6 +1863,10 @@ mstro_pool_event_consume(const Mstro__Pool__Event *eventmsg) eventmsg->kind, ev->kind, mstro_pool_event_description(ev->kind)); ev->serial = eventmsg->serial; + assert(eventmsg->ctime!=NULL); + + ev->ctime = (eventmsg->ctime->sec * NSEC_PER_SEC) + eventmsg->ctime->nsec; + switch(ev->kind) { case MSTRO_POOL_EVENT_APP_JOIN: assert(eventmsg->payload_case==MSTRO__POOL__EVENT__PAYLOAD_JOIN);