2001-08-03 13:23 GMT Dave Pearson <davep@davep.org>

* source/rtl/profiler.prg
     + Added HB_Profile::ignoreSymbol().
     * Changed HB_Profile::gather() to use HB_Profile::ignoreSymbol() to
       decide if a symbol should be ignored. This will let developers
       modify what is and isn't ignored by subclassing HB_Profile and
       implementing their own version of HB_Profile::ignoreSymbol().
This commit is contained in:
Dave Pearson
2001-08-03 13:30:01 +00:00
parent f089898c00
commit 12a2c7389d
2 changed files with 21 additions and 8 deletions

View File

@@ -1,3 +1,11 @@
2001-08-03 13:23 GMT Dave Pearson <davep@davep.org>
* source/rtl/profiler.prg
+ Added HB_Profile::ignoreSymbol().
* Changed HB_Profile::gather() to use HB_Profile::ignoreSymbol() to
decide if a symbol should be ignored. This will let developers
modify what is and isn't ignored by subclassing HB_Profile and
implementing their own version of HB_Profile::ignoreSymbol().
2001-08-02 10:00 UTC-0800 Ron Pinkas <ron@profit-master.com>
* contrib/dot/pp.txt
* Corrected typos.

View File

@@ -314,6 +314,7 @@ Create Class HB_Profile
Protected:
Method reset
Method ignoreSymbol
End Class
@@ -338,11 +339,15 @@ Return( self )
/////
Method gather Class HB_Profile
Local lProfile := __setProfiler( .F. )
Local nSymCount := __DynSCount()
Method ignoreSymbol( cSymbol ) Class HB_Profile
Local cProfPrefix := "HB_PROFILE"
Local nPrefixLen := len( cProfPrefix )
Return( ( left( cSymbol, len( cProfPrefix ) ) == cProfPrefix ) .Or. ( cSymbol == "__SETPROFILER" ) )
/////
Method gather Class HB_Profile
Local lProfile := __setProfiler( .F. )
Local nSymCount := __DynSCount()
Local cName
Local aPInfo
Local cClass
@@ -364,8 +369,8 @@ Local n
// Is the symbol a function?
If __DynSIsFun( n )
// Ignoring profiler functions...
If !( left( cName := __DynSGetName( n ), nPrefixLen ) == cProfPrefix )
// If we're not ignoring the symbol...
If !::ignoreSymbol( cName := __DynSGetName( n ) )
// Yes, it is, add it to the profile.
aadd( ::aProfile, HB_ProfileFunction():new( cName, __DynSGetPrf( n ) ) )
EndIf
@@ -381,8 +386,8 @@ Local n
// For each class in the environment...
Do While !empty( cClass := __className( n ) )
// Ignoring profiler classes...
If !( left( cClass, nPrefixLen ) == cProfPrefix )
// If we're not ignoring the class' methods...
If !::ignoreSymbol( cClass )
// Collect class members.
nMembers := len( aMembers := __classSel( n ) )