----- Original Message -----
> On 14.10.2011 17:42, Igor Galić wrote:
> > To summarize: I'm trying to get a call-graph for Apache Traffic
> > Server
> > for documentation purposes. In this sense I don't care about how
> > long
> > a function call takes. If it's part of our source base, it's
> > relevant
> > to me. Thus, I would like to filter out all calls which stem from
> > external libraries, such as libc, libtlc, libcrypto, etc...
> Ok.
> > Is there any way I can achieve this with vallgrind/callgrind?
> The callgrind output has every call which happened while running.
> So at least, this would be a good basis.
>
> > Is there any way I can achieve this with kcachegrind?
> When kcachegrind wants to show the call graph, it limits the scope
> to show. It should be straight forward to modify the source to add
> a way to stop the call graph when it crosses library borders.
>
> See
>   
> http://websvn.kde.org/trunk/KDE/kdesdk/kcachegrind/libviews/callgraphview.cpp?view=markup
>
> The function to look at is GraphExporter::buildGraph (line 953 ff.).
> It could be enough to just add at the beginning:
>
>       if (f->object() != ((TraceFunction*)_item)->object()) return;
>
>
> >   Or any
> > other tool?
> No idea.
> > Is there a standard way I can, manually or (preferably)
> > automatically
> > transform callgrind's output, before further transforming it to
> > dot format?

Joseph,

thank you very much for your reply.

> You mean get rid of all calls crossing library borders?
>
> In the callgrind format, a line starting with "ob=" specifies the
> library from
> which calls are done (the rest of the line), and "cob=" the target
> library of
> following calls, with "cob=" defaulting to the previous "ob=" if not
> explicitly given.
> Thus, you could write a PERL/Phython script which maintains current
> ob/cob values, and for lines starting with "calls=", just throw them
> away if
> cob and ob are not the same.
> And you need to use "--compress-strings=no" for callgrind for this to
> work.

With a lot of patience and help form #perl on FreeNode, I have
managed to put together a script which does indeed reduce the
calls as I wanted to.

While the output is still 2.4 MiB, this is a great improvement
over the 3.6 MiB from before.

The next step in reduction will be to separate startup from request
handling.

Please find attached the script I use to reduce callgrind output.

> So long,
> Josef

o/~

i

--
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: [email protected]
URL: http://brainsware.org/
GPG: 571B 8B8A FC97 266D BDA3  EF6F 43AD 80A4 5779 3257

Attachment: clean_callgrind.pl
Description: Perl program

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to