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:30
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:system_enable_read

Proto:static ssize_t system_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
1122  const char set_to_char[4] = {'?', '0', '1', 'X'}
1123  dir = needed for tty driver, and maybe others
1124  system = subsystem
1127  tr = tr
1129  set = 0
1132  mutex_lock( & event_mutex)
1134  call = event_call
1135  If Not trace_event_name(call) || Not class || Not reg Then Continue
1138  If system && strcmp(system, name) != 0 Then Continue
1146  set |= 1 << Not Not (* 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 & EVENT_FILE_FL_ENABLED)
1151  If set == 3 Then Break
1154  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.
1156  buf[0] = set_to_char[set]
1157  buf[1] = '\n'
1159  ret = simple_read_from_buffer(ubuf, cnt, ppos, buf, 2)
1161  Return ret