Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:rb_remove_pages

Proto:static int rb_remove_pages(struct ring_buffer_per_cpu *cpu_buffer, unsigned long nr_pages)

Type:int

Parameter:

TypeParameterName
struct ring_buffer_per_cpu *cpu_buffer
unsigned longnr_pages
1504  head_bit = 0
1506  raw_spin_lock_irq( & serialize readers )
1507  atomic_inc( & record_disabled)
1517  tail_page = list of buffer pages
1523  If write to tail == reader_page Then tail_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  When nr_removed < nr_pages cycle
1532  to_remove = next
1533  head_bit |= to_remove & RB_PAGE_HEAD
1536  next_page = next
1543  next = next_page | head_bit
1545  next_page = _list_head - remove any bit
1546  prev = tail_page
1549  pages = next_page
1552  If head_bit Then ad 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, list_empty - tests whether a list is empty*@head: the list to test.)
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  Do
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  If page_entries Then
1596  Also stolen from mm/slob.c. Thanks to Mathieu Desnoyers for pointing* this issue out.
1597  nr_removed--
1599  When to_remove_page != last_page cycle
1601  uffer may be either ring_buffer or ring_buffer_per_cpu (cpu_buffer, nr_removed)
1603  Return nr_removed == 0
Caller
NameDescribe
rb_update_pages