Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\trace\ring_buffer.c Create Date:2022-07-28 11:55:21
Last Modify:2020-03-17 19:30:04 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:g_buffer_consume - return an event and consume it*@buffer: The ring buffer to get the next event from*@cpu: the cpu to read the buffer from*@ts: a variable to store the timestamp (may be NULL)*@lost_events: a variable to store if events were lost (may be

Proto:struct ring_buffer_event *ring_buffer_consume(struct ring_buffer *buffer, int cpu, u64 *ts, unsigned long *lost_events)

Type:struct ring_buffer_event

Parameter:

TypeParameterName
struct ring_buffer *buffer
intcpu
u64 *ts
unsigned long *lost_events
4148  struct ring_buffer_event * event = NULL
4152  again :
4154  Even if we don't have any preemption, we need preempt disable/enable* to be barriers, so that we don't have things like get_user/put_user* that can cause faults and scheduling migrate into our preempt-protected* region.()
4156  If Not pumask_test_cpu - test for a cpu in a cpumask*@cpu: cpu number (< nr_cpu_ids)*@cpumask: the cpumask pointer* Returns 1 if @cpu is set in @cpumask, else returns 0 Then Go to out
4159  cpu_buffer = buffers[cpu]
4160  local_irq_save(flags)
4161  dolock = rb_reader_lock(cpu_buffer)
4163  event = rb_buffer_peek(cpu_buffer, ts, lost_events)
4164  If event Then
4165  lost_events = 0
4166  rb_advance_reader(cpu_buffer)
4169  rb_reader_unlock(cpu_buffer, dolock)
4170  local_irq_restore(flags)
4172  out :
4173  preempt_enable()
4175  If event && type_len == RINGBUF_TYPE_PADDING Then Go to again
4178  Return event
Caller
NameDescribe
read_event
trace_consume
get_return_for_leaf