函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:event_enable_read

函数原型:static ssize_t event_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
1058  buf[4]等于"0"
1060  mutex_lock( & event_mutex)
1061  file等于event_file_data(filp)
1062  如果此条件成立可能性大(为编译器优化)(file)则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  如果非file则返回:负ENODEV
1069  如果flags按位与EVENT_FILE_FL_ENABLED且非flags按位与EVENT_FILE_FL_SOFT_DISABLED的值则strcpy(buf, "1")
1073  如果flags按位与EVENT_FILE_FL_SOFT_DISABLEDflags按位与EVENT_FILE_FL_SOFT_MODEstrcat(buf, "*")
1077  strcat(buf, "\n")
1079  返回:simple_read_from_buffer(ubuf, cnt, ppos, buf, strlen - Find the length of a string*@s: The string to be sized)