From: Marius Vlad Date: Wed, 7 Aug 2019 14:18:37 +0000 (+0300) Subject: weston-log-flight-rec: Don't allow more than one flight recorder to be X-Git-Tag: upstream/9.0.0~240 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0ba0b8e86ff57bda309782482ecebc360e3d1d00;p=platform%2Fupstream%2Fweston.git weston-log-flight-rec: Don't allow more than one flight recorder to be created Having a (single) global variable which others depend on it implies having a single flight recorder present. Until we have a reason to support multiple flight recorders limit the amount to a maximum of one. Signed-off-by: Marius Vlad Reported-by: Pekka Paalanen --- diff --git a/libweston/weston-log-flight-rec.c b/libweston/weston-log-flight-rec.c index 1a209340..17aca148 100644 --- a/libweston/weston-log-flight-rec.c +++ b/libweston/weston-log-flight-rec.c @@ -233,6 +233,9 @@ weston_log_subscriber_create_flight_rec(size_t size) struct weston_debug_log_flight_recorder *flight_rec; char *weston_rb; + assert("Can't create more than one flight recorder." && + !weston_primary_flight_recorder_ring_buffer); + flight_rec = zalloc(sizeof(*flight_rec)); if (!flight_rec) return NULL;