| Function report | 
| Source Code: kernel\trace\trace_events_hist.c | Create Date:2022-07-28 12:34:11 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:event_hist_trigger_func
Proto:static int event_hist_trigger_func(struct event_command *cmd_ops, struct trace_event_file *file, char *glob, char *cmd, char *param)
Type:int
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| struct event_command * | cmd_ops | |
| struct trace_event_file * | file | |
| char * | glob | |
| char * | cmd | |
| char * | param | 
| 6184 | bool remove = false | 
| 6186 | ret = 0 | 
| 6188 | lockdep_assert_held( & event_mutex) | 
| 6190 | If glob && strlen - Find the length of a string*@s: The string to be sized Then | 
| 6191 | hist_err_clear() | 
| 6192 | last_cmd_set(file, param) | 
| 6206 | Do | 
| 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 | If Not p Then Break | 
| 6213 | p++ | 
| 6214 | Continue | 
| 6216 | If p >= param + strlen - Find the length of a string*@s: The string to be sized - size of "if" - 1 - 1 Then Return -EINVAL | 
| 6219 | p++ | 
| 6220 | Continue | 
| 6222 | Break | 
| 6227 | Else | 
| 6233 | attrs = parse_hist_trigger_attrs(tr, trigger) | 
| 6237 | If map_bits Then hist_trigger_bits = map_bits | 
| 6240 | hist_data = create_hist_data(hist_trigger_bits, attrs, file, remove) | 
| 6246 | trigger_ops = get_trigger_ops(cmd, trigger) | 
| 6248 | trigger_data = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc). | 
| 6249 | If Not trigger_data Then | 
| 6254 | count = -1 | 
| 6255 | ops = trigger_ops | 
| 6261 | private_data = hist_data | 
| 6264 | If param && set_filter Then | 
| 6265 | ret = set_filter(param, trigger_data, file) | 
| 6270 | If remove Then | 
| 6271 | If Not have_hist_trigger_match(trigger_data, file) Then Go to out_free | 
| 6274 | If hist_trigger_check_refs(trigger_data, file) Then | 
| 6279 | unreg(glob + 1, trigger_ops, trigger_data, file) | 
| 6280 | se_name = trace_event_name(event_call) | 
| 6281 | se = find_synth_event(se_name) | 
| 6284 | ret = 0 | 
| 6285 | Go to out_free | 
| 6288 | ret = reg(glob, trigger_ops, trigger_data, file) | 
| 6294 | If Not ret Then | 
| 6301 | If get_named_trigger_data(trigger_data) Then Go to enable | 
| 6304 | If has_hist_vars(hist_data) Then save_hist_vars(hist_data) | 
| 6307 | ret = create_actions(hist_data) | 
| 6314 | enable : | 
| 6315 | ret = hist_trigger_enable(trigger_data, file) | 
| 6319 | se_name = trace_event_name(event_call) | 
| 6320 | se = find_synth_event(se_name) | 
| 6324 | ret = 0 | 
| 6325 | out : | 
| 6326 | If ret == 0 Then hist_err_clear() | 
| 6329 | Return ret | 
| 6330 | out_unreg : | 
| 6331 | unreg(glob + 1, trigger_ops, trigger_data, file) | 
| 6332 | out_free : | 
| 6333 | If set_filter Then set_filter(NULL, trigger_data, NULL) | 
| 6336 | remove_hist_vars(hist_data) | 
| 6338 | kfree(trigger_data) | 
| 6340 | destroy_hist_data(hist_data) | 
| 6341 | Go to out | 
| Name | Describe | 
|---|---|
| create_field_var_hist | reate_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 | 
| Source code conversion tool public plug-in interface | X | 
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |