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:12
Last Modify:2020-03-17 19:30:04 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:rb_buffer_peek

Proto:static struct ring_buffer_event *rb_buffer_peek(struct ring_buffer_per_cpu *cpu_buffer, u64 *ts, unsigned long *lost_events)

Type:struct ring_buffer_event

Parameter:

TypeParameterName
struct ring_buffer_per_cpu *cpu_buffer
u64 *ts
unsigned long *lost_events
3882  nr_loops = 0
3884  If ts Then ts = 0
3886  again :
3893  If uffer may be either ring_buffer or ring_buffer_per_cpu (cpu_buffer, ++nr_loops > 2) Then Return NULL
3896  reader = rb_get_reader_page(cpu_buffer)
3897  If Not reader Then Return NULL
3900  event = rb_reader_event(cpu_buffer)
3903  Case type_len == RINGBUF_TYPE_PADDING
3904  If rb_null_event(event) Then uffer may be either ring_buffer or ring_buffer_per_cpu (cpu_buffer, 1)
3914  Return event
3916  Case type_len == RINGBUF_TYPE_TIME_EXTEND
3918  rb_advance_reader(cpu_buffer)
3919  Go to again
3921  Case type_len == RINGBUF_TYPE_TIME_STAMP
3922  If ts Then
3928  rb_advance_reader(cpu_buffer)
3929  Go to again
3931  Case type_len == define RINGBUF_TYPE_DATA for 'case RINGBUF_TYPE_DATA:'
3932  If ts && Not ts Then
3933  ts = read_stamp + time_delta
3937  If lost_events Then lost_events = rb_lost_events(cpu_buffer)
3939  Return event
3941  Default
3942  BUG()
3945  Return NULL
Caller
NameDescribe
ring_buffer_peekg_buffer_peek - peek at the next event to be read*@buffer: The ring buffer to read*@cpu: The cpu to peak at*@ts: The timestamp counter of this event
ring_buffer_consumeg_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