Subject: Profiling weirdness?
To: None <current-users@sun-lamp.cs.berkeley.edu>
From: J.T. Conklin <jtc@cygnus.com>
List: current-users
Date: 08/19/1994 13:59:34
Has anyone experienced wierdness in gprof output?  

In the call graph section, it looks like a functions grandchildren are
being used as if they were children.

For example, the CVS function find_dirs calls opendir, readdir and
closedir as it iterates through a directory.  But the profile call
graph also shows entries for "open", "getdirents", and "close" which
aren't called by find_dirs at all.

Unfortunately I forgot to upload sample profile output from my machine
at home before I left for work.  But here's a CVS profile I did on
SunOS that I've doctored so it is clear exactly what I mean.

                0.00    0.70      86/86          Find_Dirs [24]
[25]     8.1    0.00    0.70      86         find_dirs [25]
                0.01    0.44     964/1291        isdir [33]
                0.00    0.11      86/251         opendir [40]
                X.XX    X.XX      XX/XXX         getdirents [XX]
                X.XX    X.XX       X/XXX         open [XX]
                0.01    0.03      42/1460        freenode <cycle 1> [111]
                0.00    0.04    1758/4886        readdir [60]
                0.00    0.02     964/2280        sprintf [80]
                0.01    0.00    1467/2980        fnmatch [99]
                0.00    0.01      86/251         closedir [101]
	        X.XX    X.XX      XX/XXX         close [XXX]
		...


I'm running an intel box, but the problem may be generic.

	--jtc


------------------------------------------------------------------------------