函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:rb_remove_pages

函数原型:static int rb_remove_pages(struct ring_buffer_per_cpu *cpu_buffer, unsigned long nr_pages)

返回类型:int

参数:

类型参数名称
struct ring_buffer_per_cpu *cpu_buffer
unsigned longnr_pages
1504  head_bit等于0
1506  关闭本地中断,获取所要保护的运行队列(runqueue)的自旋锁(spinlock),为查找可运行进程做准备。( & serialize readers )
1507  atomic_inc( & record_disabled)
1517  tail_page等于list of buffer pages
1523  如果write to tail 恒等于reader_pagetail_page等于_list_head - remove any bit
1525  to_remove等于tail_page
1528  first_page等于list_entry - get the struct for this entry*@ptr: the &struct list_head pointer.*@type: the type of the struct this is embedded in.*@member: the name of the list_head within the struct.(_list_head - remove any bit, structbuffer_page, list)
1531 nr_removed小于nr_pages循环
1532  to_remove等于链表后项
1533  head_bit或等于to_remove按位与RB_PAGE_HEAD
1536  next_page等于链表后项
1543  链表后项等于next_page按位或head_bit
1545  next_page等于_list_head - remove any bit
1546  链表前项等于tail_page
1549  pages等于next_page
1552  如果head_bitad from head 等于list_entry - get the struct for this entry*@ptr: the &struct list_head pointer.*@type: the type of the struct this is embedded in.*@member: the name of the list_head within the struct.(next_page, structbuffer_page, list)
1560  read等于0
1563  atomic_dec( & record_disabled)
1564  raw_spin_unlock_irq( & serialize readers )
1566  uffer may be either ring_buffer or ring_buffer_per_cpu (cpu_buffer, 链表为空)
1569  last_page等于list_entry - get the struct for this entry*@ptr: the &struct list_head pointer.*@type: the type of the struct this is embedded in.*@member: the name of the list_head within the struct.(_list_head - remove any bit, structbuffer_page, list)
1571  tmp_iter_page等于first_page
1573  循环
1574  cond_resched()
1576  to_remove_page等于tmp_iter_page
1577  rb_inc_page(cpu_buffer, & tmp_iter_page)
1580  page_entries等于rb_page_entries(to_remove_page)
1581  如果page_entries
1596  Also stolen from mm/slob.c. Thanks to Mathieu Desnoyers for pointing* this issue out.
1597  nr_removed自减
1599 to_remove_page不等于last_page循环
1601  uffer may be either ring_buffer or ring_buffer_per_cpu (cpu_buffer, nr_removed)
1603  返回:nr_removed恒等于0
调用者
名称描述
rb_update_pages