Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:event_enable_read

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

Type:ssize_t

Parameter:

TypeParameterName
struct file *filp
char __user *ubuf
size_tcnt
loff_t *ppos
1058  buf[4] = "0"
1060  mutex_lock( & event_mutex)
1061  file = event_file_data(filp)
1062  If Value is more likely to compile time(file) Then flags = * 32 bit flags: * bit 0: enabled * bit 1: enabled cmd record * bit 2: enable/disable with the soft disable bit * bit 3: soft disabled * bit 4: trigger enabled * Note: The bits must be set atomically to prevent races * from other writers. Reads of flags do
1064  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.
1066  If Not file Then Return -ENODEV
1069  If flags & EVENT_FILE_FL_ENABLED && Not (flags & EVENT_FILE_FL_SOFT_DISABLED) Then strcpy(buf, "1")
1073  If flags & EVENT_FILE_FL_SOFT_DISABLED || flags & EVENT_FILE_FL_SOFT_MODE Then strcat(buf, "*")
1077  strcat(buf, "\n")
1079  Return simple_read_from_buffer(ubuf, cnt, ppos, buf, strlen - Find the length of a string*@s: The string to be sized)