Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:action_parse

Proto:static int action_parse(struct trace_array *tr, char *str, struct action_data *data, enum handler_id handler)

Type:int

Parameter:

TypeParameterName
struct trace_array *tr
char *str
struct action_data *data
enum handler_idhandler
3974  ret = 0
3976  strsep - Split a string into tokens*@s: The string to be searched*@ct: The characters to search for* strsep() updates @s to point after the token, ready for the next call.* It returns empty tokens, too, behaving exactly like the libc function
3977  If Not str Then
3978  hist_err(tr, HIST_ERR_ACTION_NOT_FOUND, 0)
3979  ret = -EINVAL
3980  Go to out
3983  action_name = strsep - Split a string into tokens*@s: The string to be searched*@ct: The characters to search for* strsep() updates @s to point after the token, ready for the next call.* It returns empty tokens, too, behaving exactly like the libc function
3984  If Not action_name || Not str Then
3985  hist_err(tr, HIST_ERR_ACTION_NOT_FOUND, 0)
3986  ret = -EINVAL
3987  Go to out
3990  If str_has_prefix - Test if a string has a given prefix*@str: The string to test*@prefix: The string to see if @str starts with* A common way to test a prefix of a string is to do:* strncmp(str, prefix, sizeof(prefix) - 1)* But this can lead to bugs due to Then
3991  params = strsep - Split a string into tokens*@s: The string to be searched*@ct: The characters to search for* strsep() updates @s to point after the token, ready for the next call.* It returns empty tokens, too, behaving exactly like the libc function
3993  If Not params Then
3995  ret = -EINVAL
3996  Go to out
3999  ret = parse_action_params(tr, params, data)
4000  If ret Then Go to out
4003  If handler == HANDLER_ONMAX Then check_val = check_track_val_max
4005  Else if handler == HANDLER_ONCHANGE Then check_val = check_track_val_changed
4007  Else
4009  ret = -EINVAL
4010  Go to out
4013  save_data = save_track_data_vars
4014  fn = ontrack_action
4015  action = ACTION_SAVE
4016  Else if str_has_prefix - Test if a string has a given prefix*@str: The string to test*@prefix: The string to see if @str starts with* A common way to test a prefix of a string is to do:* strncmp(str, prefix, sizeof(prefix) - 1)* But this can lead to bugs due to Then
4017  params = strsep - Split a string into tokens*@s: The string to be searched*@ct: The characters to search for* strsep() updates @s to point after the token, ready for the next call.* It returns empty tokens, too, behaving exactly like the libc function
4019  If Not str Then
4021  ret = -EINVAL
4022  Go to out
4025  If handler == HANDLER_ONMAX Then check_val = check_track_val_max
4027  Else if handler == HANDLER_ONCHANGE Then check_val = check_track_val_changed
4029  Else
4031  ret = -EINVAL
4032  Go to out
4035  save_data = save_track_data_snapshot
4036  fn = ontrack_action
4037  action = ACTION_SNAPSHOT
4038  Else
4039  params = strsep - Split a string into tokens*@s: The string to be searched*@ct: The characters to search for* strsep() updates @s to point after the token, ready for the next call.* It returns empty tokens, too, behaving exactly like the libc function
4041  If str_has_prefix - Test if a string has a given prefix*@str: The string to test*@prefix: The string to see if @str starts with* A common way to test a prefix of a string is to do:* strncmp(str, prefix, sizeof(prefix) - 1)* But this can lead to bugs due to Then use_trace_keyword = true
4044  If params Then
4046  If ret Then Go to out
4050  If handler == HANDLER_ONMAX Then check_val = check_track_val_max
4052  Else if handler == HANDLER_ONCHANGE Then check_val = check_track_val_changed
4055  If handler != HANDLER_ONMATCH Then
4057  fn = ontrack_action
4058  Else fn = action_trace
4061  action = ACTION_TRACE
4064  action_name = kstrdup(action_name, GFP_KERNEL)
4065  If Not action_name Then
4066  ret = -ENOMEM
4067  Go to out
4070  handler = handler
4071  out :
4072  Return ret
Caller
NameDescribe
track_data_parse
onmatch_parse