函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称: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

函数原型:int trace_get_user(struct trace_parser *parser, const char __user *ubuf, size_t cnt, loff_t *ppos)

返回类型:int

参数:

类型参数名称
struct trace_parser *parser
const char __user *ubuf
size_tcnt
loff_t *ppos
1424  read等于0
1427  如果非ppostrace_parser_clear(parser)
1430  ret等于Careful: we have to cast the result to the type of the pointer* for sign reasons(ch, ubuf++)
1431  如果ret则转到:out
1434  read自加
1435  cnt自减
1441  如果非cont
1445  如果ret则转到:out
1447  read自加
1448  cnt自减
1451  idx等于0
1455  ppos加等于read
1456  ret等于read
1457  转到:out
1462 cnt且非Note: isspace() must return false for %NUL-terminator (ch)且ch循环
1463  如果idx小于size减1则buffer[idx++]等于ch
1465  否则
1466  ret等于负EINVAL
1467  转到:out
1469  ret等于Careful: we have to cast the result to the type of the pointer* for sign reasons(ch, ubuf++)
1470  如果ret则转到:out
1472  read自加
1473  cnt自减
1477  如果Note: isspace() must return false for %NUL-terminator (ch)或非ch
1478  buffer[idx]等于0
1479  cont = false
1480  否则如果idx小于size减1则
1481  cont = true
1482  buffer[idx++]等于ch
1484  buffer[idx]等于0
1485  否则
1486  ret等于负EINVAL
1487  转到:out
1490  ppos加等于read
1491  ret等于read
1493  out :
1494  返回:ret
调用者
名称描述
trace_pid_write
ftrace_event_write