/* ring_buffer_event_length - return the length of the event @event: the event to get the length of  */
unsigned ring_buffer_event_length(struct ring_buffer_event *event)
/* ring_buffer_event_length - return the length of the event @event: the event to get the length of  */
unsigned ring_buffer_event_length(struct ring_buffer_event *event)
{
	unsigned length = rb_event_length(event);
	if (event->type_len > RINGBUF_TYPE_DATA_TYPE_LEN_MAX)
		return length;
	length -= RB_EVNT_HDR_SIZE;
	if (length > RB_MAX_SMALL_DATA + sizeof(event->array[0]))
                length -= sizeof(event->array[0]);
	return length;
}