|
From: John R. <jr...@Bi...> - 2008-11-29 16:28:16
|
> Is there any profiling tool which could count the execution time of > basic blocks ( like gprof and oprofile) in the inclusive style? No. Assume that "in the inclusive style" means "program counter is in this basic block or in the dynamic nest of subroutines called (directly or indirectly) by this basic block." There are two problems. Basic blocks tend to be short in control-dominated code [as opposed to data-dominated, such as traditional Fortran floating-point computation or software crypto], and there is no published technique that accounts correctly for recursion. Short basic blocks impose high overhead for direct measurement of time, and decrease the precision of a given duration of sampling. Despite 26 years since the problem of accounting for recursion was identified in the original paper (1982), gprof has not improved its method, which is subject to giving results that are incorrect or seriously misleading without specific warning. In nearly any actual executing application, just a few basic blocks are all that matter. Candidates can be identified by profiling at the level of subroutines, refined by re-writing basic blocks as subroutines, then measured by re-profiling the modified code. My 'tsprof' proprietary application from BitWagon Software LLC solved the problem of accounting for recursion. The product has been withdrawn due to insufficient market demand. -- |