Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:event_inject_write

Proto:static ssize_t event_inject_write(struct file *filp, const char __user *ubuf, size_t cnt, loff_t *ppos)

Type:ssize_t

Parameter:

TypeParameterName
struct file *filp
const char __user *ubuf
size_tcnt
loff_t *ppos
284  err = -ENODEV
285  void * entry = NULL
288  If cnt >= PAGE_SIZE Then Return -EINVAL
291  buf = memdup_user_nul(ubuf, cnt)
292  If IS_ERR(buf) Then Return PTR_ERR(buf)
294  strim - Removes leading and trailing whitespace from @s.*@s: The string to be stripped.* Note that the first trailing whitespace is replaced with a %NUL-terminator* in the given string @s. Returns a pointer to the first non-whitespace* character in @s.
296  mutex_lock( & event_mutex)
297  file = event_file_data(filp)
298  If file Then
299  call = event_call
300  size = Caller is responsible to free the *pentry.
301  If size < 0 Then err = size
303  Else err = trace_inject_entry(file, entry, size)
306  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
308  kfree(entry)
309  kfree(buf)
311  If err < 0 Then Return err
314  ppos += err
315  Return cnt