Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:race_get_user - reads the user input string separated by space* (matched by isspace(ch))* For each string found the 'struct trace_parser' is updated,* and the function returns.* Returns number of bytes read.* See kernel/trace/trace

Proto:int trace_get_user(struct trace_parser *parser, const char __user *ubuf, size_t cnt, loff_t *ppos)

Type:int

Parameter:

TypeParameterName
struct trace_parser *parser
const char __user *ubuf
size_tcnt
loff_t *ppos
1424  read = 0
1427  If Not ppos Then trace_parser_clear(parser)
1430  ret = Get a simple variable from user space(ch, ubuf++)
1431  If ret Then Go to out
1434  read++
1435  cnt--
1441  If Not cont Then
1445  If ret Then Go to out
1447  read++
1448  cnt--
1451  idx = 0
1455  ppos += read
1456  ret = read
1457  Go to out
1462  When cnt && Not Note: isspace() must return false for %NUL-terminator (ch) && ch cycle
1463  If idx < size - 1 Then buffer[idx++] = ch
1465  Else
1466  ret = -EINVAL
1467  Go to out
1469  ret = Get a simple variable from user space(ch, ubuf++)
1470  If ret Then Go to out
1472  read++
1473  cnt--
1477  If Note: isspace() must return false for %NUL-terminator (ch) || Not ch Then
1478  buffer[idx] = 0
1479  cont = false
1480  Else if idx < size - 1 Then
1481  cont = true
1482  buffer[idx++] = ch
1484  buffer[idx] = 0
1485  Else
1486  ret = -EINVAL
1487  Go to out
1490  ppos += read
1491  ret = read
1493  out :
1494  Return ret
Caller
NameDescribe
trace_pid_write
ftrace_event_write