函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:event_hist_trigger_func

函数原型:static int event_hist_trigger_func(struct event_command *cmd_ops, struct trace_event_file *file, char *glob, char *cmd, char *param)

返回类型:int

参数:

类型参数名称
struct event_command *cmd_ops
struct trace_event_file *file
char *glob
char *cmd
char *param
6177  hist_trigger_bits等于TRACING_MAP_BITS_DEFAULT
6184  bool remove = false
6186  ret等于0
6188  lockdep_assert_held( & event_mutex)
6190  如果globstrlen - Find the length of a string*@s: The string to be sized
6191  hist_err_clear()
6192  last_cmd_set(file, param)
6195  如果非param则返回:负EINVAL
6198  如果glob[0]恒等于'!'则remove = true
6205  p等于trigger等于param
6206  循环
6207  p等于strstr - Find the first substring in a %NUL terminated string*@s1: The string to be searched*@s2: The string to search for
6208  如果非p退出
6210  如果p恒等于param则返回:负EINVAL
6212  如果*p减1的差不等于' '且*p减1的差不等于'\t'则
6213  p自加
6214  继续下一循环
6216  如果p大于等于paramstrlen - Find the length of a string*@s: The string to be sized减"if"的长度减1减1则返回:负EINVAL
6218  如果*p加"if"的长度减1的差不等于' '且*p加"if"的长度减1的差不等于'\t'则
6219  p自加
6220  继续下一循环
6222  退出
6223 p循环
6225  如果非pparam = NULL
6227  否则
6228  *p减1的差等于'\0'
6229  param等于strstrip(p)
6230  trigger等于strstrip(trigger)
6233  attrs等于parse_hist_trigger_attrs(tr, trigger)
6234  如果是错误则返回:错误
6237  如果map_bitshist_trigger_bits等于map_bits
6240  hist_data等于create_hist_data(hist_trigger_bits, attrs, file, remove)
6241  如果是错误
6242  destroy_hist_trigger_attrs(attrs)
6243  返回:错误
6246  trigger_ops等于get_trigger_ops(cmd, trigger)
6248  trigger_data等于分配内存并置零
6249  如果非trigger_data
6250  ret等于负ENOMEM
6251  转到:out_free
6254  count等于负1
6255  ops等于trigger_ops
6256  cmd_ops等于cmd_ops
6258  初始化链表头
6259  RCU_INIT_POINTER() - initialize an RCU protected pointer*@p: The pointer to be initialized.*@v: The value to initialized the pointer to.* Initialize an RCU-protected pointer in special cases where readers(filter, NULL)
6261  private_data等于hist_data
6264  如果paramset_filter
6265  ret等于set_filter(param, trigger_data, file)
6266  如果ret小于0则转到:out_free
6270  如果remove
6271  如果非have_hist_trigger_match(trigger_data, file)则转到:out_free
6275  ret等于负EBUSY
6276  转到:out_free
6279  unreg(glob + 1, trigger_ops, trigger_data, file)
6280  se_name等于trace_event_name(event_call)
6281  se等于find_synth_event(se_name)
6282  如果seref自减
6284  ret等于0
6285  转到:out_free
6288  ret等于reg(glob, trigger_ops, trigger_data, file)
6294  如果非ret
6295  如果非pausecontclear的值则ret等于负ENOENT
6297  转到:out_free
6298  否则如果ret小于0则转到:out_free
6301  如果get_named_trigger_data(trigger_data)则转到:enable
6304  如果has_hist_vars(hist_data)则save_hist_vars(hist_data)
6307  ret等于create_actions(hist_data)
6308  如果ret则转到:out_unreg
6311  ret等于racing_map_init - Allocate and clear a map's tracing_map_elts*@map: The tracing_map to initialize* Allocates a clears a pool of tracing_map_elts equal to the* user-specified size of 2 ** map_bits (internally maintained as
6312  如果ret则转到:out_unreg
6314  enable :
6315  ret等于hist_trigger_enable(trigger_data, file)
6316  如果ret则转到:out_unreg
6319  se_name等于trace_event_name(event_call)
6320  se等于find_synth_event(se_name)
6321  如果seref自加
6324  ret等于0
6325  out :
6326  如果ret恒等于0则hist_err_clear()
6329  返回:ret
6330  out_unreg :
6331  unreg(glob + 1, trigger_ops, trigger_data, file)
6332  out_free :
6333  如果set_filterset_filter(NULL, trigger_data, NULL)
6336  remove_hist_vars(hist_data)
6338  kfree(trigger_data)
6340  destroy_hist_data(hist_data)
6341  转到:out
调用者
名称描述
create_field_var_histreate_field_var_hist - Automatically create a histogram and var for a field*@target_hist_data: The target hist trigger*@subsys_name: Optional subsystem name*@event_name: Optional event name*@field_name: The name of the field (and the resulting variable)*
unregister_field_var_hists