Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:tracing_set_tracer

Proto:static int tracing_set_tracer(struct trace_array *tr, const char *buf)

Type:int

Parameter:

TypeParameterName
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  If Not 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. Then
5736  ret = __tracing_resize_ring_buffer(tr, trace_buf_size, RING_BUFFER_ALL_CPUS)
5738  If ret < 0 Then Go to out
5740  ret = 0
5743  When t cycle
5744  If strcmp(name, buf) == 0 Then Break
5747  If Not t Then
5748  ret = -EINVAL
5749  Go to out
5751  If t == current_trace Then Go to out
5765  If 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 Then
5766  pr_warn("Tracer '%s' is not allowed on command line, ignored\n", name)
5768  Go to out
5772  If Not 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. Then
5773  ret = -EINVAL
5774  Go to out
5778  If ref Then
5779  ret = -EBUSY
5780  Go to out
5783  trace_branch_disable()
5785  enabled--
5787  If reset Then reset(tr)
5791  current_trace = nop_trace
5817  If init Then
5818  ret = tracer_init(t, tr)
5819  If ret Then Go to 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  Return ret
Caller
NameDescribe
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