Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\profile.c Create Date:2022-07-28 10:37:44
Last Modify:2020-03-17 15:11:09 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: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.

Proto:static ssize_t read_profile(struct file *file, char __user *buf, size_t count, loff_t *ppos)

Type:ssize_t

Parameter:

TypeParameterName
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  If p >= (prof_len + 1) * sizeof(unsignedint) Then Return 0
476  If count > (prof_len + 1) * sizeof(unsignedint) - p Then count = (prof_len + 1) * sizeof(unsignedint) - p
478  read = 0
480  When p < sizeof(unsignedint) && count > 0 cycle
481  If Write a simple value into user space( * ((char * )( & sample_step) + p), buf) Then Return -EFAULT
483  buf++
483  p++
483  count--
483  read++
485  pnt = prof_buffer + p - sizeof(atomic_t)
486  If copy_to_user(buf, (void * )pnt, count) Then Return -EFAULT
488  read += count
489  ppos += read
490  Return read