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:17
Last Modify:2020-03-17 19:30:04 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:rb_try_to_discard

Proto:static inline int rb_try_to_discard(struct ring_buffer_per_cpu *cpu_buffer, struct ring_buffer_event *event)

Type:int

Parameter:

TypeParameterName
struct ring_buffer_per_cpu *cpu_buffer
struct ring_buffer_event *event
2423  new_index = rb_event_index(event)
2424  old_index = new_index + Return 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  If Actual data page == addr && rb_page_write(bpage) == old_index Then
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  If index == old_index Then
2446  Return 1
2451  Return 0
Caller
NameDescribe
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