函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:gister_tracer - register a tracer with the ftrace system.*@type: the plugin for the tracer* Register a new plugin tracer.

函数原型:int __init register_tracer(struct tracer *type)

返回类型:int

参数:

类型参数名称
struct tracer *type
1881  ret等于0
1883  如果非name
1884  打印信息("Tracer must have a name\n")
1885  返回:负1
1888  如果strlen - Find the length of a string*@s: The string to be sized大于等于MAX_TRACER_SIZE
1889  打印信息("Tracer has a name longer than %d\n", MAX_TRACER_SIZE)
1890  返回:负1
1893  如果security_locked_down(LOCKDOWN_TRACEFS)则
1894  打印警告信息("Can not register tracer %s due to lockdown\n", name)
1896  返回:负EPERM
1899  mutex_lock( & race_types_lock is used to protect the trace_types list.)
1901  We need to change this state when a selftest is running.* A selftest will lurk into the ring-buffer to count the* entries inserted during the selftest although some concurrent* insertions into the ring-buffer such as trace_printk could occurred = true
1903 t循环
1904  如果字符串比较恒等于0则
1906  打印信息("Tracer %s already registered\n", name)
1908  ret等于负1
1909  转到:out
1913  如果非set_flagset_flag等于dummy_set_flag
1915  如果非flags
1917  flags等于开辟内存
1918  如果非flags
1919  ret等于负ENOMEM
1920  转到:out
1922  val等于0
1923  opts等于For tracers that don't implement custom flags
1924  否则如果非opts
1926  opts等于For tracers that don't implement custom flags
1929  trace等于type
1931  ret等于run_tracer_selftest(type)
1932  如果ret小于0则转到:out
1935  next等于race_types holds a link list of available tracers.
1936  race_types holds a link list of available tracers. 等于type
1937  add_tracer_options( & The global_trace is the descriptor that holds the top-level tracing* buffers for the live tracing., type)
1939  out :
1940  We need to change this state when a selftest is running.* A selftest will lurk into the ring-buffer to count the* entries inserted during the selftest although some concurrent* insertions into the ring-buffer such as trace_printk could occurred = false
1941  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.
1943  如果ret或非default_bootup_tracer则转到:out_unlock
1946  如果字符串指定长度比较则转到:out_unlock
1949  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
1951  tracing_set_tracer( & The global_trace is the descriptor that holds the top-level tracing* buffers for the live tracing., name)
1952  default_bootup_tracer = NULL
1954  apply_trace_boot_options()
1957  If a tracer is running, we do not want to run SELFTEST. = true
1963  out_unlock :
1964  返回:ret
调用者
名称描述
tracer_alloc_buffers
init_function_trace
init_irqsoff_tracer
init_wakeup_tracer
init_hwlat_tracer
init_mmio_trace
init_graph_trace