Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:trace_parse_run_command

Proto:ssize_t trace_parse_run_command(struct file *file, const char __user *buffer, size_t count, loff_t *ppos, int (*createfn)(int , char **))

Type:ssize_t

Parameter:

TypeParameterName
struct file *file
const char __user *buffer
size_tcount
loff_t *ppos
int (*createfn
9190  ret = 0
9191  done = 0
9194  kbuf = Allocation memory
9195  If Not kbuf Then Return -ENOMEM
9198  When done < count cycle
9199  size = count - done
9201  If size >= WRITE_BUFSIZE Then size = WRITE_BUFSIZE - 1
9204  If copy_from_user(kbuf, buffer + done, size) Then
9205  ret = -EFAULT
9206  Go to out
9208  kbuf[size] = '\0'
9209  buf = kbuf
9210  Do
9212  If tmp Then
9213  tmp = '\0'
9214  size = tmp - buf + 1
9215  Else
9217  If done + size < count Then
9218  If buf != kbuf Then Break
9221  pr_warn("Line length is too long: Should be less than %d\n", WRITE_BUFSIZE - 2)
9223  ret = -EINVAL
9224  Go to out
9227  done += size
9232  If tmp Then tmp = '\0'
9236  If ret Then Go to out
9238  buf += size
9240  When done < count cycle
9242  ret = done
9244  out :
9245  kfree(kbuf)
9247  Return ret
Caller
NameDescribe
synth_events_write
probes_write
dyn_event_write
probes_write