On Wednesday 17 February 2010, David wrote: > > > The order, > > > position and times of the invocation does not matter. The number before > > the > > > "=>" should be consistent for each invocation instance. > > > > What is the meaning of "consistent" here for you? > > > > For example, if in a function F1(), the subroutine SR is called three times > at the beginning, the middle, and the ending, with #A, #C and #E before the > symbol "=>", respectively. These three numbers should be identical.
Why? You have 3 different call sites, and every invocation of the same function can have different runtime, e.g. depending on parameters. Even if parameters are the same, the global program state will be different. E.g. some functions called inside are already resolved by the runtime linker, some not. System calls happening could need to be retried depending on the OS state, and so on... > Furthermore, if another function F2() also call the same SR in the > execution, the number before the "=>" symbol of the invoking line in F2() > should also be that number. No. For the same reasons as given above. If you are curious about where any differences are coming from, you can trigger a dump between calls to SR (e.g. use --dump-before=SR), and compare the multiple profiles in detail, e.g. on the machine code level (use --dump-instr=yes for this). > I call these results "consistent". At this > point, I understand the annotated source code in this way. If this is true, > I also have another quick question. If one subroutine SR is ever called by > two caller, F1() and F2(), how can I distribute Ir count across these two > functions since the Ir counts before the symbol "=>" are always the > inclusive Ir costs? Should I turn to using the calling count (ending with an > 'x') to calculate the distribution percentage? As shown above, this kind of "heuristic" can go very wrong. Can you tell me why you want to do this? In any case, the inclusive costs are exact, because they are measured directly. But for costs in SR, you only have the sum of multiple invocations. Perhaps "--separate-callers=2" does help here? With this, you would see 2 symbols for SR in the profile output: "SR called from F1" (given as SR'F1) and "SR called from F2" (SR'F2). Josef > Currently I made one more run to reproduce this result in my system. If I > can reproduce it, I will contact the code developer to file a bug report. > Thank you so much for your great help. > > David > ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Valgrind-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/valgrind-users
