函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:rb_reserve_next_event

函数原型:static __always_inline struct ring_buffer_event *rb_reserve_next_event(struct ring_buffer *buffer, struct ring_buffer_per_cpu *cpu_buffer, unsigned long length)

返回类型:struct ring_buffer_event

参数:

类型参数名称
struct ring_buffer *buffer
struct ring_buffer_per_cpu *cpu_buffer
unsigned longlength
2877  nr_loops等于0
2880  rb_start_commit(cpu_buffer)
2897  length等于rb_calculate_event_length(length)
2898  again :
2899  add_timestamp等于0
2900  delta等于0
2911  如果uffer may be either ring_buffer or ring_buffer_per_cpu (cpu_buffer, ++nr_loops > 1000)则转到:out_fail
2914  ts等于rb_time_stamp(buffer)
2915  diff等于tswrite_stamp
2918  The "volatile" is due to gcc bugs ()
2920  如果ring_buffer_time_stamp_abs(buffer)则
2921  delta等于ts
2922  rb_handle_timestamp(cpu_buffer, & info)
2923  否则如果此条件成立可能性大(为编译器优化)(ts >= write_stamp)则
2925  delta等于diff
2926  如果此条件成立可能性小(为编译器优化)(We need to fit the time_stamp delta into 27 bits.)则rb_handle_timestamp(cpu_buffer, & info)
2930  event等于__rb_reserve_next(cpu_buffer, & info)
2932  如果此条件成立可能性小(为编译器优化)(错误 == - EAGAIN)则
2933  如果add_timestamplength减等于RB_LEN_TIME_EXTEND
2935  转到:again
2938  如果非event则转到:out_fail
2941  返回:event
2943  out_fail :
2944  rb_end_commit(cpu_buffer)
2945  返回:NULL
调用者
名称描述
ring_buffer_lock_reserveg_buffer_lock_reserve - reserve a part of the buffer*@buffer: the ring buffer to reserve from*@length: the length of the data to reserve (excluding event header)* Returns a reserved event on the ring buffer to copy directly to
ring_buffer_writeg_buffer_write - write data to the buffer without reserving*@buffer: The ring buffer to write to