函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\trace\ring_buffer.c Create Date:2022-07-27 13:00:34
Last Modify:2020-03-17 19:30:04 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:rb_get_reader_page

函数原型:static struct buffer_page *rb_get_reader_page(struct ring_buffer_per_cpu *cpu_buffer)

返回类型:struct buffer_page

参数:

类型参数名称
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  如果uffer may be either ring_buffer or ring_buffer_per_cpu (cpu_buffer, ++nr_loops > 3)则
3691  reader = NULL
3692  转到:out
3695  reader等于reader_page
3698  如果dex for next read 小于Size is determined by what has been committed 则转到:out
3702  如果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 )则转到:out
3707  reader = NULL
3708  如果committed pages 恒等于reader_page则转到:out
3712  如果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则转到: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  如果非reader则转到:out
3730  链表后项等于_list_head - remove any bit
3731  链表前项等于链表前项
3738  pages等于链表前项
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  如果非ret则转到:spin
3779  链表前项等于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  如果overwrite不等于last_overrun
3789  lost_events等于overwritelast_overrun
3790  last_overrun等于overwrite
3793  转到:again
3795  out :
3797  如果readerdex for next read 恒等于0则read_stamp等于 page time stamp
3800  arch_spin_unlock( & lock)
3801  local_irq_restore(flags)
3803  返回:reader
调用者
名称描述
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