Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:_handle_head_page - writer hit the head page* Returns: +1 to retry page* 0 to continue* -1 on error

Proto:static int rb_handle_head_page(struct ring_buffer_per_cpu *cpu_buffer, struct buffer_page *tail_page, struct buffer_page *next_page)

Type:int

Parameter:

TypeParameterName
struct ring_buffer_per_cpu *cpu_buffer
struct buffer_page *tail_page
struct buffer_page *next_page
1984  entries = rb_page_entries(next_page)
1991  type = rb_head_page_set_update(cpu_buffer, next_page, tail_page, RB_PAGE_HEAD)
2006  Case type == RB_PAGE_HEAD
2012  local_add(entries, & overrun)
2013  local_sub(BUF_PAGE_SIZE, & entries_bytes)
2021  Break
2023  Case type == RB_PAGE_UPDATE
2028  Break
2029  Case type == Making the ring buffer lockless makes things tricky
2035  Return 1
2036  Case type == PAGE_MOVED is not part of the mask
2042  Return 1
2043  Default
2044  uffer may be either ring_buffer or ring_buffer_per_cpu (cpu_buffer, 1)
2045  Return -1
2062  new_head = next_page
2063  rb_inc_page(cpu_buffer, & new_head)
2065  ret = rb_head_page_set_head(cpu_buffer, new_head, next_page, Making the ring buffer lockless makes things tricky)
2077  Case ret == RB_PAGE_HEAD
2078  Case ret == Making the ring buffer lockless makes things tricky
2080  Break
2081  Default
2082  uffer may be either ring_buffer or ring_buffer_per_cpu (cpu_buffer, 1)
2083  Return -1
2096  If ret == Making the ring buffer lockless makes things tricky Then
2099  buffer_tail_page = READ_ONCE(write to tail )
2104  If buffer_tail_page != tail_page && buffer_tail_page != next_page Then rb_head_page_set_normal(cpu_buffer, new_head, next_page, RB_PAGE_HEAD)
2116  If type == RB_PAGE_HEAD Then
2117  ret = rb_head_page_set_normal(cpu_buffer, next_page, tail_page, RB_PAGE_UPDATE)
2120  If uffer may be either ring_buffer or ring_buffer_per_cpu (cpu_buffer, ret != RB_PAGE_UPDATE) Then Return -1
2125  Return 0
Caller
NameDescribe
rb_move_tailThis is the slow path, force gcc not to inline it.