函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\trace\trace.c Create Date:2022-07-27 13:05:02
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:__ftrace_trace_stack

函数原型:static void __ftrace_trace_stack(struct ring_buffer *buffer, unsigned long flags, int skip, int pc, struct pt_regs *regs)

返回类型:void

参数:

类型参数名称
struct ring_buffer *buffer
unsigned longflags
intskip
intpc
struct pt_regs *regs
2892  call等于event_kernel_stack
2904  如果非regsskip自加
2914  preempt_disable_notrace()
2916  stackidx等于__this_cpu_inc_return(ftrace_stack_reserve)减1
2919  如果WARN_ON_ONCE(stackidx > Allow 4 levels of nesting: normal, softirq, irq, NMI )则转到:out
2929  The "volatile" is due to gcc bugs ()
2931  fstack等于this_cpu_ptr(stacks)加stackidx
2932  size等于ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(calls)
2934  如果regs
2935  nr_entries等于stack_trace_save_regs - Save a stack trace based on pt_regs into a storage array*@regs: Pointer to pt_regs to examine*@store: Pointer to storage array*@size: Size of the storage array*@skipnr: Number of entries to skip at the start of the stack trace
2937  否则
2938  nr_entries等于stack_trace_save - Save a stack trace into a storage array*@store: Pointer to storage array*@size: Size of the storage array*@skipnr: Number of entries to skip at the start of the stack trace* Return: Number of trace entries stored.
2941  size等于nr_entriessizeof(unsignedlong)
2942  event等于__trace_buffer_lock_reserve(buffer, TRACE_STACK, entry的长度 + size, flags, pc)
2944  如果非event则转到:out
2946  entry等于g_buffer_event_data - return the data of the event*@event: the event to get the data from
2948  内存复制( & caller, calls, size)
2949  size等于nr_entries
2951  如果非call_filter_check_discard(call, entry, buffer, event)则__buffer_unlock_commit(buffer, event)
2954  out :
2956  The "volatile" is due to gcc bugs ()
2957  __this_cpu_dec(ftrace_stack_reserve)
2958  preempt_enable_notrace()
调用者
名称描述
ftrace_trace_stack
__trace_stack
trace_dump_stackrace_dump_stack - record a stack back trace in the trace buffer*@skip: Number of functions to skip (helper handlers)