函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:g_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

函数原型:int ring_buffer_read_page(struct ring_buffer *buffer, void **data_page, size_t len, int cpu, int full)

返回类型:int

参数:

类型参数名称
struct ring_buffer *buffer
void **data_page
size_tlen
intcpu
intfull
4703  cpu_buffer等于buffers[cpu]
4712  ret等于负1
4714  如果非测试CPU信息则转到:out
4721  如果len小于等于BUF_PAGE_HDR_SIZE则转到:out
4724  len减等于BUF_PAGE_HDR_SIZE
4726  如果非data_page则转到:out
4729  bpage等于data_page
4730  如果非bpage则转到:out
4733  raw_spin_lock_irqsave( & serialize readers , flags)
4735  reader等于rb_get_reader_page(cpu_buffer)
4736  如果非reader则转到:out_unlock
4739  event等于rb_reader_event(cpu_buffer)
4741  read等于dex for next read
4742  commit等于rb_page_commit(reader)
4745  missed_events等于lost_events
4754  如果readlen小于commitreadreader_page恒等于committed pages
4756  rpage等于Actual data page
4757  rpos等于read
4758  pos等于0
4761  如果full则转到:out_unlock
4764  如果len大于commitreadlen等于commitread
4768  size等于Return total length of time extend and data,* or just the event length for all other events.
4770  如果len小于size则转到:out_unlock
4774  save_timestamp等于read_stamp
4777  循环
4787  len减等于size
4791  pos加等于size
4793  如果rpos大于等于commit退出
4799 len大于等于size循环
4802  local_set( & write committed index , pos)
4803  page time stamp 等于save_timestamp
4806  read等于0
4807  否则
4809  read加等于rb_page_entries(reader)
4810  read_bytes加等于BUF_PAGE_SIZE
4813  rb_init_page(bpage)
4814  bpage等于Actual data page
4815  Actual data page 等于data_page
4816  local_set( & dex for next write , 0)
4817  local_set( & ries on this page , 0)
4818  dex for next read 等于0
4819  data_page等于bpage
4826  如果al end of data local_set( & write committed index , al end of data )
4829  ret等于read
4831  lost_events等于0
4833  commit等于local_read( & write committed index )
4837  如果missed_events
4841  如果BUF_PAGE_SIZEcommit大于等于missed_events的长度则
4845  commit加等于missed_events的长度
4847  local_add(Flag when events were overwritten , & write committed index )
4853  如果commit小于BUF_PAGE_SIZEmemset( & data of buffer page [commit], 0, BUF_PAGE_SIZE - commit)
4856  out_unlock :
4857  raw_spin_unlock_irqrestore( & serialize readers , flags)
4859  out :
4860  返回:ret
调用者
名称描述
read_page
tracing_buffers_read
tracing_buffers_splice_read