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:29:58
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:parse_hist_trigger_attrs

Proto:static struct hist_trigger_attrs *parse_hist_trigger_attrs(struct trace_array *tr, char *trigger_str)

Type:struct hist_trigger_attrs

Parameter:

TypeParameterName
struct trace_array *tr
char *trigger_str
2170  ret = 0
2172  attrs = 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).
2173  If Not attrs Then Return ERR_PTR( - ENOMEM)
2176  When trigger_str cycle
2177  str = 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
2180  rhs = strchr - Find the first occurrence of the character c in the string s.*@s: the string to be searched*@c: the character to search for
2181  If rhs Then
2183  ret = -EINVAL
2184  Go to free
2187  If ret Then Go to free
2189  Else if strcmp(str, "pause") == 0 Then pause = true
2191  Else if strcmp(str, "cont") == 0 || strcmp(str, "continue") == 0 Then cont = true
2194  Else if strcmp(str, "clear") == 0 Then clear = true
2196  Else
2197  ret = parse_action(str, attrs)
2198  If ret Then Go to free
2203  If Not keys_str Then
2204  ret = -EINVAL
2205  Go to free
2208  If Not clock Then
2209  clock = kstrdup("global", GFP_KERNEL)
2210  If Not clock Then
2211  ret = -ENOMEM
2212  Go to free
2216  Return attrs
2217  free :
2218  destroy_hist_trigger_attrs(attrs)
2220  Return ERR_PTR(ret)
Caller
NameDescribe
event_hist_trigger_func