kernels/linux-2.4.0/fs/proc/proc_misc.c
/*
 * 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.
 */
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.
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 *buf,
			    size_t count, loff_t *ppos)
{
	unsigned long p = *ppos;
	ssize_t read;
	char * pnt;
	unsigned int sample_step = 1 << prof_shift;
	if (p >= (prof_len+1)*sizeof(unsigned int))
		return 0;
	if (count > (prof_len+1)*sizeof(unsigned int) - p)
		count = (prof_len+1)*sizeof(unsigned int) - p;
	read = 0;
	while (p < sizeof(unsigned int) && count > 0) {
		put_user(*((char *)(&sample_step)+p),buf);
		buf++; p++; count--; read++;
	}
	pnt = (char *)prof_buffer + p - sizeof(unsigned int);
	copy_to_user(buf,(void *)pnt,count);
	read += count;
	*ppos += read;
	return read;
}
static ssize_t read_profile ( struct file * file , char * buf , size_t count , loff_t * ppos ) { unsigned long p = * ppos ; ssize_t read ; char * pnt ; unsigned int sample_step = 1 << prof_shift ; if ( p >= ( prof_len + 1 ) * sizeof ( unsigned int ) ) return 0 ; if ( count > ( prof_len + 1 ) * sizeof ( unsigned int ) - p ) count = ( prof_len + 1 ) * sizeof ( unsigned int ) - p ; read = 0 ; while ( p < sizeof ( unsigned int ) && count > 0 ) { put_user ( * ( ( char * ) ( & sample_step ) + p ) , buf ) ; buf ++ ; p ++ ; count -- ; read ++ ; } pnt = ( char * ) prof_buffer + p - sizeof ( unsigned int ) ; copy_to_user ( buf , ( void * ) pnt , count ) ; read += count ; * ppos += read ; return read ; }
This function accesses profiling information.
This function accesses profiling information .