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

Name:g_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

Proto:struct ring_buffer_event *ring_buffer_lock_reserve(struct ring_buffer *buffer, unsigned long length)

Type:struct ring_buffer_event

Parameter:

TypeParameterName
struct ring_buffer *buffer
unsigned longlength
2971  preempt_disable_notrace()
2973  If Value for the false possibility is greater at compile time(atomic_read( & record_disabled)) Then Go to out
2976  cpu = These macros fold the SMP functionality into a single CPU system()
2978  If Value for the false possibility is greater at compile time(!pumask_test_cpu - test for a cpu in a cpumask*@cpu: cpu number (< nr_cpu_ids)*@cpumask: the cpumask pointer* Returns 1 if @cpu is set in @cpumask, else returns 0) Then Go to out
2981  cpu_buffer = buffers[cpu]
2983  If Value for the false possibility is greater at compile time(atomic_read( & record_disabled)) Then Go to out
2986  If Value for the false possibility is greater at compile time(length > Max payload is BUF_PAGE_SIZE - header (8bytes) ) Then Go to out
2989  If Value for the false possibility is greater at compile time(The lock and unlock are done within a preempt disable section) Then Go to out
2992  event = rb_reserve_next_event(buffer, cpu_buffer, length)
2993  If Not event Then Go to out_unlock
2996  Return event
2998  out_unlock :
2999  trace_recursive_unlock(cpu_buffer)
3000  out :
3001  preempt_enable_notrace()
3002  Return NULL
Caller
NameDescribe
ring_buffer_producer
__trace_buffer_lock_reserve