Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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

Proto:int register_trace_event(struct trace_event *event)

Type:int

Parameter:

TypeParameterName
struct trace_event *event
734  ret = 0
736  lock for writing
738  If WARN_ON(!event) Then Go to out
741  If WARN_ON(!funcs) Then Go to out
744  Initialization list head
746  If Not type Then
747  struct list_head * list = NULL
752  If Not type Then Go to out
755  Else
757  type = next_event_type++
761  If 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.) Then Go to out
764  list_add_tail - add a new entry*@new: new entry to be added*@head: list head to add it before* Insert a new entry before the specified head.* This is useful for implementing queues.
766  Else if type > __TRACE_LAST_TYPE Then
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  Go to out
770  Else
772  If 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. Then Go to out
776  If (trace == NULL) Then trace = Standard events
778  If (raw == NULL) Then raw = Standard events
780  If (hex == NULL) Then hex = Standard events
782  If (binary == NULL) Then 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  Return ret
Caller
NameDescribe
init_events
init_graph_trace
trace_event_raw_init
register_synth_event
trace_probe_register_event_call