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

Name:rb_get_reader_page

Proto:static struct buffer_page *rb_get_reader_page(struct ring_buffer_per_cpu *cpu_buffer)

Type:struct buffer_page

Parameter:

TypeParameterName
struct ring_buffer_per_cpu *cpu_buffer
3674  struct buffer_page * reader = NULL
3677  nr_loops = 0
3680  local_irq_save(flags)
3681  r sched/core.c and kernel_lock.c: ( & lock)
3683  again :
3690  If uffer may be either ring_buffer or ring_buffer_per_cpu (cpu_buffer, ++nr_loops > 3) Then
3691  reader = NULL
3692  Go to out
3695  reader = reader_page
3698  If dex for next read < Size is determined by what has been committed Then Go to out
3702  If uffer may be either ring_buffer or ring_buffer_per_cpu (cpu_buffer, dex for next read > Size is determined by what has been committed ) Then Go to out
3707  reader = NULL
3708  If committed pages == reader_page Then Go to out
3712  If The total entries in the ring buffer is the running counter* of entries entered into the ring buffer, minus the sum of* the entries read from the ring buffer and the number of* entries that were overwritten. == 0 Then Go to out
3718  local_set( & dex for next write , 0)
3719  local_set( & ries on this page , 0)
3720  local_set( & write committed index , 0)
3721  al end of data = 0
3723  spin :
3727  reader = rb_set_head_page(cpu_buffer)
3728  If Not reader Then Go to out
3730  next = _list_head - remove any bit
3731  prev = prev
3738  pages = prev
3741  _set_list_to_head - set a list_head to be pointing to head.
3752  smp_mb()
3753  overwrite = local_read( & (overrun))
3766  ret = rb_head_page_replace(reader, reader_page)
3771  If Not ret Then Go to spin
3779  prev = list of buffer pages
3780  rb_inc_page(cpu_buffer, & ad from head )
3782  local_inc( & pages_read)
3785  reader_page = reader
3786  dex for next read = 0
3788  If overwrite != last_overrun Then
3789  lost_events = overwrite - last_overrun
3790  last_overrun = overwrite
3793  Go to again
3795  out :
3797  If reader && dex for next read == 0 Then read_stamp = page time stamp
3800  arch_spin_unlock( & lock)
3801  local_irq_restore(flags)
3803  Return reader
Caller
NameDescribe
rb_advance_reader
rb_buffer_peek
ring_buffer_read_pageg_buffer_read_page - extract a page from the ring buffer*@buffer: buffer to extract from*@data_page: the page to use allocated from ring_buffer_alloc_read_page*@len: amount to extract*@cpu: the cpu of the buffer to extract