函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\kmemleak.c Create Date:2022-07-27 17:57:22
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:File write operation to configure kmemleak at run-time

函数原型:static ssize_t kmemleak_write(struct file *file, const char __user *user_buf, size_t size, loff_t *ppos)

返回类型:ssize_t

参数:

类型参数名称
struct file *file
const char __user *user_buf
size_tsize
loff_t *ppos
1774  buf_size等于两数取小(size, (buf的长度 - 1))
1775  如果复制用户字符串小于0则返回:负EFAULT
1777  buf[buf_size]等于0
1779  ret等于mutex_lock_interruptible( & protects the memory scanning, parameters and debug/kmemleak file access )
1780  如果ret小于0则返回:ret
1783  如果字符串指定长度比较恒等于0则
1784  如果set if tracing memory operations is enabled We use grey instead of black to ensure we can do future scans on the same* objects. If we did not do future scans these black objects could* potentially contain references to newly allocated objects in the future and* we'd end up with false positives.
1786  否则__kmemleak_do_cleanup()
1788  转到:out
1791  如果非set if tracing memory operations is enabled
1792  ret等于负EPERM
1793  转到:out
1796  如果字符串指定长度比较恒等于0则kmemleak_disable()
1798  否则如果字符串指定长度比较恒等于0则ables or disables the task stacks scanning 等于1
1800  否则如果字符串指定长度比较恒等于0则ables or disables the task stacks scanning 等于0
1802  否则如果字符串指定长度比较恒等于0则Start the automatic memory scanning thread. This function must be called* with the scan_mutex held.
1804  否则如果字符串指定长度比较恒等于0则Stop the automatic memory scanning thread.
1806  否则如果字符串指定长度比较恒等于0则
1809  ret等于kstrtoul - convert a string to an unsigned long*@s: The start of the string. The string must be null-terminated, and may also* include a single newline before its terminating null. The first character* may also be a plus sign, but not a minus sign.
1810  如果ret小于0则转到:out
1812  Stop the automatic memory scanning thread.
1813  如果secs
1817  否则如果字符串指定长度比较恒等于0则Scan data sections and all the referenced memory blocks allocated via the* kernel's standard allocators. This function must be called with the* scan_mutex held.
1819  否则如果字符串指定长度比较恒等于0则ret等于dump_str_object_info(buf + 5)
1821  否则ret等于负EINVAL
1824  out :
1825  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.
1826  如果ret小于0则返回:ret
1830  ppos加等于size
1831  返回:size