Profiler, profiling DLLs, trace.log

Lutger lutger.blijdestijn at gmail.com
Tue Jan 29 11:51:27 PST 2008


Bjoern wrote:

...
> Thanks Lutger.
> pTrace actually just supports the summary table, right ?
> 
> Call graphs.
> I wonder how a graphical representation should look like.
> Perheps:
> 
> called from
> 
> \ /
>   F
> / \
>      /0.012ms/
> calls
> 
> 
> Ideas ?
> Bjoern


Hi, ptrace supports call graphs and also converts ticks to microseconds. I
have added an example of how it looks to the wiki* It's basically a table
where functions calls are seperated by a blank line and the timed function
is in bold, layout is similar to the trace.log file. I hope it'll speak for
itself, it includes a header.

I did once added support for generating images with graphviz for callgraphs,
but I found it to be quite some work to make it look good and get useful
images. iirc it can be done with ptrace by only redefining the ddoc macros,
but the function identifiers are way too long atm, including the whole
type.

I think making a complete call graph out of a trace.log file will look too
cluttered. Ideally you'll have some way to view the call graph of a single
function and click through it's callers and callees. Perhaps with an option
to set the depth of the call tree from that function. However, to make this
work nicely I think it's necessary to reduce the fully qualified names to a
single function name. 

>From an IDE perspective, speaking personally, it would be more useful if the
relevant information integrates with the rest of the IDE. For example,
after making a profile the timing information is remembered and easily
accessed through the code symbol browser or from right-clicking on the
source. Along with timing there would be a small list of the callers and
callees. Things like that (ideally speaking).

I'm curious what you're going to do with it, profiling is very important and
it's a very good idea to make this more accessable within the IDE, imho. It
will encourage people to actually gather empirical evidence about their
code. 

Regards,

Lutger

* http://www.dsource.org/projects/scrapple/wiki/PtraceUtility





More information about the Digitalmars-d mailing list