diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 5821e42e98..90ca37a865 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,11 @@ +2001-08-03 13:23 GMT Dave Pearson + * 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 * contrib/dot/pp.txt * Corrected typos. diff --git a/harbour/source/rtl/profiler.prg b/harbour/source/rtl/profiler.prg index 714da7fbc2..8e2b1a4083 100644 --- a/harbour/source/rtl/profiler.prg +++ b/harbour/source/rtl/profiler.prg @@ -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 ) )