/* If this function is called, do not call ring_buffer_unlock_commit on the event.  */
void ring_buffer_discard_commit(struct ring_buffer *buffer, struct ring_buffer_event *event)
/* If this function is called, do not call ring_buffer_unlock_commit on the event.  */
void ring_buffer_discard_commit(struct ring_buffer *buffer, struct ring_buffer_event *event)
{
	struct ring_buffer_per_cpu *cpu_buffer;
	int cpu;
	rb_event_discard(event);
	cpu = smp_processor_id();
	cpu_buffer = buffer->buffers[cpu];
	RB_WARN_ON(buffer, !local_read(&cpu_buffer->committing));
	rb_decrement_entry(cpu_buffer, event);
	if (rb_try_to_discard(cpu_buffer, event))
		goto out;
	rb_update_write_stamp(cpu_buffer, event);
 out:
	rb_end_commit(cpu_buffer);
	trace_recursive_unlock();
	if (preempt_count() == 1)
		ftrace_preempt_enable(per_cpu(rb_need_resched, cpu));
	else
		preempt_enable_no_resched_notrace();
}