Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\trace\trace.c Create Date:2022-07-28 12:03:26
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:allocate_trace_buffer

Proto:static int allocate_trace_buffer(struct trace_array *tr, struct trace_buffer *buf, int size)

Type:int

Parameter:

TypeParameterName
struct trace_array *tr
struct trace_buffer *buf
intsize
8371  rb_flags = If trace_flags & TRACE_ITER_OVERWRITE Then RB_FL_OVERWRITE Else 0
8373  tr = tr
8375  buffer = Because the ring buffer is generic, if other users of the ring buffer get* traced by ftrace, it can produce lockdep warnings. We need to keep each* ring buffer's lock class separate.(size, rb_flags)
8376  If Not buffer Then Return -ENOMEM
8379  data = alloc_percpu(structtrace_array_cpu)
8380  If Not data Then
8381  g_buffer_free - free a ring buffer.*@buffer: the buffer to free.
8382  buffer = NULL
8383  Return -ENOMEM
8387  set_buffer_entries( & trace_buffer, g_buffer_size - return the size of the ring buffer (in bytes)*@buffer: The ring buffer.)
8390  Return 0
Caller
NameDescribe
allocate_trace_buffers