函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:gister_trace_event - register output for an event type*@event: the event type to register* Event types are stored in a hash and this hash is used to* find a way to print an event

函数原型:int register_trace_event(struct trace_event *event)

返回类型:int

参数:

类型参数名称
struct trace_event *event
734  ret等于0
736  lock for writing
738  如果WARN_ON(!event)则转到:out
741  如果WARN_ON(!funcs)则转到:out
744  初始化链表头
746  如果非type
747  struct list_head * list = NULL
751  type等于trace_search_list( & list)
752  如果非type则转到:out
755  否则
757  type等于next_event_type自加
758  list等于ftrace_event_list
761  如果WARN_ON(race_find_event - find a registered event*@type: the type of event to look for* Returns an event of type @type otherwise NULL* Called with trace_event_read_lock() held.)则转到:out
764  添加链表项
766  否则如果type大于__TRACE_LAST_TYPE
767  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
768  WARN_ON(1)
769  转到:out
770  否则
772  如果race_find_event - find a registered event*@type: the type of event to look for* Returns an event of type @type otherwise NULL* Called with trace_event_read_lock() held.则转到:out
776  如果(trace == NULL)则trace等于Standard events
778  如果(raw == NULL)则raw等于Standard events
780  如果(hex == NULL)则hex等于Standard events
782  如果(binary == NULL)则binary等于Standard events
785  key等于type按位与must be a power of 2 减1
787  hlist_add_head( & node, & event_hash[key])
789  ret等于type
790  out :
791  lease a write lock
793  返回:ret
调用者
名称描述
init_events
init_graph_trace
trace_event_raw_init
register_synth_event
trace_probe_register_event_call