函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:tracer_alloc_buffers

函数原型:__init static int tracer_alloc_buffers(void)

返回类型:int

参数:

9253  ret等于负ENOMEM
9256  如果security_locked_down(LOCKDOWN_TRACEFS)则
9257  打印警告信息("Tracing disabled due to lockdown\n")
9258  返回:负EPERM
9265  BUILD_BUG_ON - break compile if a condition is true( Make sure we don't go more than we have bits for > TRACE_FLAGS_MAX_SIZE)
9267  如果非分配CPU掩码则转到:out
9270  如果非分配CPU掩码则转到:out_free_buffer_mask
9274  如果__stop___trace_bprintk_fmt不等于__start___trace_bprintk_fmttrace_printk_init_buffers()
9279  如果On boot up, the ring buffer is set to the minimum size, so that* we do not waste memory on systems that are not using tracing.ring_buf_size等于trace_buf_size
9281  否则ring_buf_size等于1
9284  pumask_copy - *dstp = *srcp*@dstp: the result*@srcp: the input cpumask
9285  pumask_copy - *dstp = *srcp*@dstp: the result*@srcp: the input cpumask
9287  raw_spin_lock_init( & start_lock)
9295  ret等于puhp_setup_state_multi - Add callbacks for multi state*@state: The state for which the calls are installed*@name: Name of the callback
9298  如果ret小于0则转到:out_free_cpumask
9301  ret等于负ENOMEM
9302  temp_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.(PAGE_SIZE, RB_FL_OVERWRITE)
9303  如果非temp_buffer则转到:out_rm_hp_state
9306  如果trace_create_savedcmd()小于0则转到:out_free_temp_buffer
9310  如果allocate_trace_buffers( & The global_trace is the descriptor that holds the top-level tracing* buffers for the live tracing., ring_buf_size)小于0则
9311  printk - print a kernel message*@fmt: format string* This is printk(). It can be called from any context. We want it to work.* We try to grab the console_lock. If we succeed, it's easy - we log the* output and call the console drivers
9312  WARN_ON(1)
9313  转到:out_free_savedcmd
9316  如果buffer_disabledracing_off - turn off tracing buffers* This function stops the tracing buffers from recording data.* It does not disable any overhead the tracers themselves may* be causing. This function simply causes all recording to* the ring buffers to fail.
9319  如果trace_boot_clock
9320  ret等于tracing_set_clock( & The global_trace is the descriptor that holds the top-level tracing* buffers for the live tracing., trace_boot_clock)
9321  如果ret小于0则打印警告信息("Trace clock %s not defined, going back to default\n", trace_boot_clock)
9331  current_trace等于nop_trace
9333  * max_lock is used to protect the swapping of buffers * when taking a max snapshot. The buffers themselves are * protected by per_cpu spinlocks. But the action of the swap * needs its own lock. * This is defined as a arch_spinlock_t in order to help * with = (arch_spinlock_t)
9335  ftrace_init_global_array_ops( & The global_trace is the descriptor that holds the top-level tracing* buffers for the live tracing.)
9337  init_trace_flags_index( & The global_trace is the descriptor that holds the top-level tracing* buffers for the live tracing.)
9339  gister_tracer - register a tracer with the ftrace system.*@type: the plugin for the tracer* Register a new plugin tracer.
9342  init_function_trace()
9345  Kill all tracing for good (never come back).* It is initialized to 1 but will turn to zero if the initialization* of the tracer is successful. But that is the only place that sets* this back to zero.等于0
9347  atomic_notifier_chain_register - Add notifier to an atomic notifier chain*@nh: Pointer to head of the atomic notifier chain*@n: New entry in notifier chain* Adds a notifier to an atomic notifier chain.* Currently always returns zero.
9350  register_die_notifier( & trace_die_notifier)
9352  flags等于TRACE_ARRAY_FL_GLOBAL
9354  初始化链表头
9355  初始化链表头
9356  初始化链表头
9357  初始化链表头
9358  添加链表项
9360  apply_trace_boot_options()
9362  register_snapshot_cmd()
9364  返回:0
9366  out_free_savedcmd :
9367  free_saved_cmdlines_buffer(savedcmd)
9368  out_free_temp_buffer :
9369  g_buffer_free - free a ring buffer.*@buffer: the buffer to free.
9370  out_rm_hp_state :
9371  puhp_remove_multi_state - Remove hotplug multi state callback*@state: The state for which the calls are removed* Removes the callback functions from a multi state. This is the reverse of* cpuhp_setup_state_multi()
9372  out_free_cpumask :
9373  释放CPU掩码
9374  out_free_buffer_mask :
9375  释放CPU掩码
9376  out :
9377  返回:ret
调用者
名称描述
early_trace_init