Lines Matching refs:lqe
192 log_queue_entry_state(const log_queue_entry_t lqe) in log_queue_entry_state() argument
194 log_queue_entry_state_t state = read_dependency(&lqe->lqe_state); in log_queue_entry_state()
212 log_queue_entry_t lqe = logmem_alloc(&lq->lq_mem[i], &lqe_size); in log_queue_entry_alloc() local
213 if (lqe) { in log_queue_entry_alloc()
217 lqe->lqe_size = (uint16_t)lqe_size; in log_queue_entry_alloc()
218 lqe->lqe_lm_id = i; in log_queue_entry_alloc()
219 return lqe; in log_queue_entry_alloc()
227 log_queue_entry_free(log_queue_t lq, log_queue_entry_t lqe) in log_queue_entry_free() argument
229 const size_t lqe_size = lqe->lqe_size; in log_queue_entry_free()
230 const uint16_t lqe_lm_id = lqe->lqe_lm_id; in log_queue_entry_free()
232 bzero(lqe, lqe_size); in log_queue_entry_free()
233 logmem_free(&lq->lq_mem[lqe_lm_id], lqe, lqe_size); in log_queue_entry_free()
240 log_queue_entry_t lqe = log_queue_entry_alloc(lq, log_queue_entry_size(lp), lp->lp_stream); in log_queue_add_entry() local
241 if (!lqe) { in log_queue_add_entry()
245 assert(lqe->lqe_size >= lp->lp_data_size); in log_queue_add_entry()
247 lqe->lqe_payload = *lp; in log_queue_add_entry()
248 (void) memcpy((uint8_t *)lqe + sizeof(*lqe), lp_data, lqe->lqe_payload.lp_data_size); in log_queue_add_entry()
249 STAILQ_INSERT_TAIL(&lq->lq_log_list, lqe, lqe_link); in log_queue_add_entry()
250 publish(&lqe->lqe_state, LOG_QUEUE_ENTRY_STATE_STORED); in log_queue_add_entry()
263 log_queue_entry_t lqe, lqe_tmp; in dispatch_list_cleanup() local
266 STAILQ_FOREACH_SAFE(lqe, &lq->lq_dispatch_list, lqe_link, lqe_tmp) { in dispatch_list_cleanup()
267 log_queue_entry_state_t lqe_state = log_queue_entry_state(lqe); in dispatch_list_cleanup()
271 STAILQ_REMOVE(&lq->lq_dispatch_list, lqe, log_queue_entry, lqe_link); in dispatch_list_cleanup()
272 publish(&lqe->lqe_state, LOG_QUEUE_ENTRY_STATE_INVALID); in dispatch_list_cleanup()
273 log_queue_entry_free(lq, lqe); in dispatch_list_cleanup()
290 log_queue_entry_t lqe, lqe_tmp; in log_dispatch_prepare() local
293 STAILQ_FOREACH(lqe, &lq->lq_dispatch_list, lqe_link) { in log_dispatch_prepare()
294 log_queue_entry_state_t lqe_state = log_queue_entry_state(lqe); in log_dispatch_prepare()
298 publish(&lqe->lqe_state, LOG_QUEUE_ENTRY_STATE_DISPATCHED); in log_dispatch_prepare()
299 buf[collected++] = lqe; in log_dispatch_prepare()
308 STAILQ_FOREACH_SAFE(lqe, &lq->lq_log_list, lqe_link, lqe_tmp) { in log_dispatch_prepare()
309 assert(log_queue_entry_state(lqe) == LOG_QUEUE_ENTRY_STATE_STORED); in log_dispatch_prepare()
311 STAILQ_REMOVE(&lq->lq_log_list, lqe, log_queue_entry, lqe_link); in log_dispatch_prepare()
312 STAILQ_INSERT_TAIL(&lq->lq_dispatch_list, lqe, lqe_link); in log_dispatch_prepare()
313 publish(&lqe->lqe_state, LOG_QUEUE_ENTRY_STATE_DISPATCHED); in log_dispatch_prepare()
315 buf[collected++] = lqe; in log_dispatch_prepare()
333 const log_queue_entry_t lqe = logs[i]; in log_queue_dispatch_logs() local
334 log_queue_entry_state_t lqe_state = log_queue_entry_state(lqe); in log_queue_dispatch_logs()
337 const log_payload_t lqe_lp = &lqe->lqe_payload; in log_queue_dispatch_logs()
346 const void *lp_data = (uint8_t *)lqe + sizeof(*lqe); in log_queue_dispatch_logs()
355 publish(&lqe->lqe_state, LOG_QUEUE_ENTRY_STATE_SENT); in log_queue_dispatch_logs()
358 publish(&lqe->lqe_state, LOG_QUEUE_ENTRY_STATE_FAILED); in log_queue_dispatch_logs()