kernels/linux-2.4.0/drivers/s390/block/dasd_profile.c
/* histogram of time from irq to end */
histogram of time from irq to end
histogram of time from irq to end
void
dasd_profile_add ( cqr_t *cqr )
{
	int ind;
	long strtime,irqtime,endtime,tottime;
	long tottimeps,sectors;
	long help;
	if ( ! cqr -> req ) 
	  return;
	sectors = cqr -> req -> nr_sectors;
	strtime = ((cqr->startclk - cqr->buildclk) >> 12);
	irqtime = ((cqr->stopclk - cqr->startclk) >> 12);
	endtime = ((cqr->endclk - cqr->stopclk) >> 12);
	tottime = ((cqr->endclk - cqr->buildclk) >> 12);
	tottimeps = tottime / sectors;
	if (! dasd_io_reqs ++){
	  for ( ind = 0; ind < 16; ind ++) {
		dasd_io_secs[ind] = 0;
		dasd_io_times[ind]=0;
		dasd_io_timps[ind]=0;
		dasd_io_time1[ind]=0;
		dasd_io_time2[ind]=0;
		dasd_io_time2ps[ind]=0;
		dasd_io_time3[ind]=0;
	  }
	};
	for ( ind = 0, help = sectors >> 3; 
	      ind < 15 && help; 
	      help = help >> 1,ind ++);
	dasd_io_secs[ind] ++;
	for ( ind = 0, help = tottime >> 3; 
	      ind < 15 && help; 
	      help = help >> 1,ind ++);
	dasd_io_times[ind] ++;
	for ( ind = 0, help = tottimeps >> 3; 
	      ind < 15 && help; 
	      help = help >> 1,ind ++);
	dasd_io_timps[ind] ++;
	for ( ind = 0, help = strtime >> 3; 
	      ind < 15 && help; 
	      help = help >> 1,ind ++);
	dasd_io_time1[ind] ++;
	for ( ind = 0, help = irqtime >> 3; 
	      ind < 15 && help; 
	      help = help >> 1,ind ++);
	dasd_io_time2[ind] ++;
	for ( ind = 0, help = (irqtime/sectors) >> 3; 
	      ind < 15 && help; 
	      help = help >> 1,ind ++);
	dasd_io_time2ps[ind] ++;
	for ( ind = 0, help = endtime >> 3; 
	      ind < 15 && help; 
	      help = help >> 1,ind ++);
	dasd_io_time3[ind] ++;
}
void dasd_profile_add ( cqr_t * cqr ) { int ind ; long strtime , irqtime , endtime , tottime ; long tottimeps , sectors ; long help ; if ( ! cqr -> req ) return ; sectors = cqr -> req -> nr_sectors ; strtime = ( ( cqr -> startclk - cqr -> buildclk ) >> 12 ) ; irqtime = ( ( cqr -> stopclk - cqr -> startclk ) >> 12 ) ; endtime = ( ( cqr -> endclk - cqr -> stopclk ) >> 12 ) ; tottime = ( ( cqr -> endclk - cqr -> buildclk ) >> 12 ) ; tottimeps = tottime / sectors ; if ( ! dasd_io_reqs ++ ) { for ( ind = 0 ; ind < 16 ; ind ++ ) { dasd_io_secs [ ind ] = 0 ; dasd_io_times [ ind ] = 0 ; dasd_io_timps [ ind ] = 0 ; dasd_io_time1 [ ind ] = 0 ; dasd_io_time2 [ ind ] = 0 ; dasd_io_time2ps [ ind ] = 0 ; dasd_io_time3 [ ind ] = 0 ; } } ; for ( ind = 0 , help = sectors >> 3 ; ind < 15 && help ; help = help >> 1 , ind ++ ) ; dasd_io_secs [ ind ] ++ ; for ( ind = 0 , help = tottime >> 3 ; ind < 15 && help ; help = help >> 1 , ind ++ ) ; dasd_io_times [ ind ] ++ ; for ( ind = 0 , help = tottimeps >> 3 ; ind < 15 && help ; help = help >> 1 , ind ++ ) ; dasd_io_timps [ ind ] ++ ; for ( ind = 0 , help = strtime >> 3 ; ind < 15 && help ; help = help >> 1 , ind ++ ) ; dasd_io_time1 [ ind ] ++ ; for ( ind = 0 , help = irqtime >> 3 ; ind < 15 && help ; help = help >> 1 , ind ++ ) ; dasd_io_time2 [ ind ] ++ ; for ( ind = 0 , help = ( irqtime / sectors ) >> 3 ; ind < 15 && help ; help = help >> 1 , ind ++ ) ; dasd_io_time2ps [ ind ] ++ ; for ( ind = 0 , help = endtime >> 3 ; ind < 15 && help ; help = help >> 1 , ind ++ ) ; dasd_io_time3 [ ind ] ++ ; }
histogram of time from irq to end
histogram of time from irq to end