函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:rb_try_to_discard

函数原型:static inline int rb_try_to_discard(struct ring_buffer_per_cpu *cpu_buffer, struct ring_buffer_event *event)

返回类型:int

参数:

类型参数名称
struct ring_buffer_per_cpu *cpu_buffer
struct ring_buffer_event *event
2423  new_index等于rb_event_index(event)
2424  old_index等于new_indexReturn total length of time extend and data,* or just the event length for all other events.
2425  addr等于event
2426  addr与等于PAGE_MASK
2428  bpage等于READ_ONCE(write to tail )
2430  如果Actual data page 恒等于addrrb_page_write(bpage)恒等于old_index
2431  write_mask等于local_read( & dex for next write )按位与The buffer page counters, write and entries, must be reset* atomically when crossing page boundaries. To synchronize this* update, two counters are inserted into the number. One is* the actual counter for the write position or count on the page.的反
2433  event_length等于Return the length of the given event. Will return* the length of the time extend if the event is a* time extend.
2440  old_index加等于write_mask
2441  new_index加等于write_mask
2442  index等于local_cmpxchg( & dex for next write , old_index, new_index)
2443  如果index恒等于old_index
2446  返回:1
2451  返回:0
调用者
名称描述
ring_buffer_discard_commitg_buffer_commit_discard - discard an event that has not been committed*@buffer: the ring buffer*@event: non committed event to discard* Sometimes an event that is in the ring buffer needs to be ignored