函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:system_enable_read

函数原型:static ssize_t system_enable_read(struct file *filp, char __user *ubuf, size_t cnt, loff_t *ppos)

返回类型:ssize_t

参数:

类型参数名称
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  如果非trace_event_name(call)或非class或非reg则继续下一循环
1138  如果system字符串比较不等于0则继续下一循环
1146  set或等于1左移非非* 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  如果set恒等于3则退出
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  返回:ret