函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:tracing_set_tracer

函数原型:static int tracing_set_tracer(struct trace_array *tr, const char *buf)

返回类型:int

参数:

类型参数名称
struct trace_array *tr
const char *buf
5731  ret等于0
5733  mutex_lock( & race_types_lock is used to protect the trace_types list.)
5735  如果非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.
5736  ret等于__tracing_resize_ring_buffer(tr, trace_buf_size, RING_BUFFER_ALL_CPUS)
5738  如果ret小于0则转到:out
5740  ret等于0
5743 t循环
5744  如果字符串比较恒等于0则退出
5747  如果非t
5748  ret等于负EINVAL
5749  转到:out
5751  如果t恒等于current_trace则转到:out
5765  如果Values used for system_state. Ordering of the states must not be changed* as code checks for <, <=, >, >= STATE.小于SYSTEM_RUNNING True if tracer cannot be enabled in kernel param
5766  打印警告信息("Tracer '%s' is not allowed on command line, ignored\n", name)
5768  转到:out
5772  如果非Some tracers are not suitable for instance buffers.* A tracer is always available for the global array (toplevel)* or if it explicitly states that it is.
5773  ret等于负EINVAL
5774  转到:out
5778  如果ref
5779  ret等于负EBUSY
5780  转到:out
5783  trace_branch_disable()
5785  enabled自减
5787  如果resetreset(tr)
5791  current_trace等于nop_trace
5817  如果init
5818  ret等于tracer_init(t, tr)
5819  如果ret则转到:out
5823  current_trace等于t
5824  enabled自加
5825  trace_branch_enable(tr)
5826  out :
5827  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
5829  返回:ret
调用者
名称描述
register_tracergister_tracer - register a tracer with the ftrace system.*@type: the plugin for the tracer* Register a new plugin tracer.
tracing_set_trace_write