函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\profile.c Create Date:2022-07-27 11:37:31
Last Modify:2020-03-17 15:11:09 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:This function accesses profiling information. The returned data is* binary: the sampling step and the actual contents of the profile* buffer. Use of the program readprofile is recommended in order to* get meaningful info out of these data.

函数原型:static ssize_t read_profile(struct file *file, char __user *buf, size_t count, loff_t *ppos)

返回类型:ssize_t

参数:

类型参数名称
struct file *file
char __user *buf
size_tcount
loff_t *ppos
468  p等于ppos
471  sample_step等于1左移prof_shift
473  profile_flip_buffers()
474  如果p大于等于prof_len加1的和乘sizeof(unsignedint)则返回:0
476  如果count大于prof_len加1的和乘sizeof(unsignedint)减pcount等于prof_len加1的和乘sizeof(unsignedint)减p
478  read等于0
480 p小于sizeof(unsignedint)且count大于0循环
481  如果put_user - Write a simple value into user space( * ((char * )( & sample_step) + p), buf)则返回:负EFAULT
483  buf自加
483  p自加
483  count自减
483  read自加
485  pnt等于prof_bufferpsizeof(atomic_t)
486  如果copy_to_user(buf, (void * )pnt, count)则返回:负EFAULT
488  read加等于count
489  ppos加等于read
490  返回:read