BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ping Eric Grange : SamplingProfiler
Goto page 1, 2  Next
 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Language BASM
View previous topic :: View next topic  
Author Message
Ain Valtin
Guest





PostPosted: Mon Oct 10, 2005 3:33 pm    Post subject: ping Eric Grange : SamplingProfiler Reply with quote



Hi Eric!

Some time ago you posted your SamplingProfiler here. I downloaded it
bact then, but started to investigate it just now... looks great! But
I have two problems / suggestions:

Fist, I use JCL exception dialog with embbeded map file. As you may
know JCL comes with "Insert JCL debug data" expert - it adds an
checkbox menuitem into Project menu. When checked, this expert
automatically adds compressed map file into executable when project is
build. Now the problem is, that because this expert alerts executable
right after build, map file and executable file do have slightly
different datetime which causes profiler to report "Map file found,
but too old". Could you change it so that small difference, say 1 sec,
is allowed?

Second, there seems to be no way to save profiling results for later
investigation?
Ideally, I would like to be able to create shortcut like

SamplingProfiler.exe c:..MyApp.exe c:..ProfData.log

So that users always run app through profiler which saves it's data
into log file which I can later analyse.


TIA
ain
Back to top
Eric Grange
Guest





PostPosted: Tue Oct 11, 2005 10:31 am    Post subject: Re: ping Eric Grange : SamplingProfiler Reply with quote



Posted an updated version in the attachments, tolerates a 5 sec
delay between map/jdbg and exe (enough?), and also adds support
for D2005 paths.

Quote:
Second, there seems to be no way to save profiling results for later
investigation?

This was planned, but since I finally never really needed it,
it never was implemented... maybe if/when I run into the need
and the time...

Eric

Back to top
Ain Valtin
Guest





PostPosted: Tue Oct 11, 2005 1:37 pm    Post subject: Re: ping Eric Grange : SamplingProfiler Reply with quote



On Tue, 11 Oct 2005 12:31:33 +0200, Eric Grange
<egrangeNO (AT) SPAMglscene (DOT) org> wrote:

Quote:
Posted an updated version in the attachments, tolerates a 5 sec
delay between map/jdbg and exe (enough?), and also adds support
for D2005 paths.

Thanks!


Quote:
Second, there seems to be no way to save profiling results for later
investigation?

This was planned, but since I finally never really needed it,
it never was implemented... maybe if/when I run into the need
and the time...

How do you store profiling data in memory - do you keep it in the VT
node or do you have separate data structure for it? Perhaps I (or
someone else) can write functions to save / load this data so you only
have minimal work to add this feature?


ain

Back to top
Adem
Guest





PostPosted: Tue Oct 11, 2005 1:43 pm    Post subject: Re: ping Eric Grange : SamplingProfiler Reply with quote

Eric Grange wrote:

Quote:
Posted an updated version in the attachments, tolerates a 5 sec
delay between map/jdbg and exe (enough?), and also adds support
for D2005 paths.

It seems search/browse path information can not handle
compiler directives. i.e. while SP can handle this stuff

$(Delphi)Bin

Apparently, this is hardwired as SP does not seem to be able
to handle this:

$(VCL)SynEdit

where

VCL is defined as 'Y:Components' in the System Variables.

Could you add that please.

Cheers,
Adem

Back to top
Leonel
Guest





PostPosted: Tue Oct 11, 2005 2:52 pm    Post subject: Re: ping Eric Grange : SamplingProfiler Reply with quote

Eric Grange wrote:

Quote:
You wouldn't be able to compile the units (dependencies to
proprietary code)

Any chance on removing that dependencies? This is a project I'd love to
tweak.

--
Leonel

Back to top
Eric Grange
Guest





PostPosted: Tue Oct 11, 2005 2:55 pm    Post subject: Re: ping Eric Grange : SamplingProfiler Reply with quote

Quote:
How do you store profiling data in memory - do you keep it in the VT
node or do you have separate data structure for it?

Profiling data is kept in a partially compiled state (a hierarchical
structure 2 or 3 levels deep and a bunch of indexes and accompanying
data), the stuff in the VT is computed on the fly from that data.

Quote:
Perhaps I (or someone else) can write functions to save / load this data
so you only have minimal work to add this feature?

You wouldn't be able to compile the units (dependencies to proprietary
code) but I could extract the relevant type definitions.

Not sure how much code would be required to get the UI to swallow it,
mostly disabling/enabling the appropriate controls I guess... as long as
you don't want to compare saved profiling runs side by side in distinct
tabs, which I think might be what I was intending to do... and being a
bit more work, one of the reasons saving profile runs didn't happen.

Eric

Back to top
Eric Grange
Guest





PostPosted: Tue Oct 11, 2005 2:58 pm    Post subject: Re: ping Eric Grange : SamplingProfiler Reply with quote

Yep, $(DELPHI) support is hardcoded and based on the RootDir registry
value. Didn't even knew $(VCL) could be used... where would I take its
values? From the system environment variables? Or is there some registry
key where its stored?

Eric
Back to top
Adem
Guest





PostPosted: Tue Oct 11, 2005 5:34 pm    Post subject: Re: ping Eric Grange : SamplingProfiler Reply with quote

Eric Grange wrote:

Quote:
Yep, $(DELPHI) support is hardcoded and based on the RootDir
registry value.
Didn't even knew $(VCL) could be used...
where would I take its values? From the system environment
variables?
Or is there some registry key where its stored?

You create an environment variable pointing to a folder.

This could either be a system variable (valid for all users) or user
variable (a particular user, must be logged in).

And, then when you encounter something like

$(XXXX)SomePath

The easiest is to use the Registry to decode this.

Search for 'XXXX' in the following locations (and in this order) in the
Registry.

HKEY_CURRENT_USEREnvironment

HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSession
ManagerEnvironment

The value (which will be a string) corresponding to 'XXXX' is substitiuted
for $(XXXX) to get the proper thing.

HTH,

Cheers,
Adem

Back to top
Ain Valtin
Guest





PostPosted: Tue Oct 11, 2005 6:58 pm    Post subject: Re: ping Eric Grange : SamplingProfiler Reply with quote

On Tue, 11 Oct 2005 16:55:42 +0200, Eric Grange
<egrangeNO (AT) SPAMglscene (DOT) org> wrote:

Quote:
Perhaps I (or someone else) can write functions to save / load this data
so you only have minimal work to add this feature?

You wouldn't be able to compile the units (dependencies to proprietary
code) but I could extract the relevant type definitions.

Yes, what I meant was that if you publish relevant type definitions
someone would step up to implement functions to save and load this
data into TStream. Then it would be easy to you to add this feature
into project...


Quote:
as long as
you don't want to compare saved profiling runs side by side

Yes, I was going to ask this feature too <g>
I thought that once saving / loading the data is working, comparing
them shouldn't be that hard... but if you say that this is too much
work then let it be.


ain

Back to top
Eric Grange
Guest





PostPosted: Wed Oct 12, 2005 7:59 am    Post subject: Re: ping Eric Grange : SamplingProfiler Reply with quote

Quote:
Any chance on removing that dependencies? This is a project I'd love to
tweak.

The only part with no dependency would the debugger loop (straight from
MSDN) and the call site identification code, rest from UI to statistics
reuses proprietary stuff...

Eric

Back to top
Eric Grange
Guest





PostPosted: Wed Oct 12, 2005 8:01 am    Post subject: Re: ping Eric Grange : SamplingProfiler Reply with quote

Quote:
This could either be a system variable (valid for all users) or user
variable (a particular user, must be logged in).

Would using GetEnvironmentStrings provide all these?
- haven't used env vars since the DOS days ^_^

Eric

Back to top
Eric Grange
Guest





PostPosted: Wed Oct 12, 2005 8:06 am    Post subject: Re: ping Eric Grange : SamplingProfiler Reply with quote

Quote:
Yes, what I meant was that if you publish relevant type definitions
someone would step up to implement functions to save and load this
data into TStream. Then it would be easy to you to add this feature
into project...

Had a look at it and the streaming for stats has already been added
here, so what remains would be sifting through the rest of the fields in
the various profiling objects/forms to see what really needs be saved &
restored.

Quote:
Yes, I was going to ask this feature too I thought that once saving / loading the data is working, comparing
them shouldn't be that hard... but if you say that this is too much
work then let it be.

Would require a few hours to move the various code and fields to a
frame/form that could be multi-instanciated, and then add whatever glue
and extra UI controls necessary. So it's all a matter of finding those
hours and the motivation :)

Eric

Back to top
Adem
Guest





PostPosted: Wed Oct 12, 2005 8:40 am    Post subject: Re: ping Eric Grange : SamplingProfiler Reply with quote

Eric Grange wrote:

Quote:
This could either be a system variable (valid for all users)
or user variable (a particular user, must be logged in).

Would using GetEnvironmentStrings provide all these?

Why not use TRegistry. 2 simple loops should be all you need.


Quote:
- haven't used env vars since the DOS days ^_^

Same here :->

Back to top
Eric Grange
Guest





PostPosted: Wed Oct 12, 2005 9:02 am    Post subject: Re: ping Eric Grange : SamplingProfiler Reply with quote

Quote:
Why not use TRegistry. 2 simple loops should be all you need.

You've got me lost here... Where is the value of $(VCL) to be found?
In the registry? (if so, which key?) or in the environment variables?

Eric

Back to top
Adem
Guest





PostPosted: Wed Oct 12, 2005 12:48 pm    Post subject: Re: ping Eric Grange : SamplingProfiler Reply with quote

Eric Grange wrote:

Quote:
Why not use TRegistry. 2 simple loops should be all you need.

You've got me lost here... Where is the value of $(VCL) to be found?

In the registry? (if so, which key?) or in the environment variables?

:-)

In Search/Browse paths, when,you encounter something like $(XXXX)
what you do is this:

---- Strip off '$(' and ')'.
That leaves you with 'XXXX'.

---- To find out what 'XXXX' stands for you'll need to search under (in
this order)

HKEY_CURRENT_USERSoftwareBorlandDelphi7.0Environment Variables

'7.0' here represents D7, for other versions use appropriate values.

HKEY_CURRENT_USEREnvironment

This is for the current logged in user.

HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSession
ManagerEnvironment

This is where the global env vars are kept.

---- At the first occurance of 'XXXX' you stop since Current User may have
defined a different override.

The corresponding value is what you need to substitute for '$(XXXX)' [for
all of it] in the Search/Browse path line that contained it.

I hope it is by now clear that it does not have to be $(VCL), I could have
used anything, such as '$(MY_DELPHI_CODE_PATH)'.

It really is easier to do it than to put it in writing --for me, at least
:-)

I hope I haven't confused you even more.

Adem

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Language BASM All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.