]> git.ipfire.org Git - thirdparty/valgrind.git/commit
Callgrind: Improve self-hosting with outer callgrind tool
authorJosef Weidendorfer <Josef.Weidendorfer@gmx.de>
Mon, 1 May 2006 00:55:54 +0000 (00:55 +0000)
committerJosef Weidendorfer <Josef.Weidendorfer@gmx.de>
Mon, 1 May 2006 00:55:54 +0000 (00:55 +0000)
commit4906b8a95835940a69e78345ec6fbb6c474a1b67
tree47804b95753c079029b1c901461d1d29d931bd12
parent8ca05cc698b498627a1e0766a164e4e8daca1006
Callgrind: Improve self-hosting with outer callgrind tool

This adds an option to change the default handling of jumps
between functions. Usually, a jump between functions is
interpreted as call, because such jumps are typically
generated by compilers on tail recursion optimization, and
we want to present this as call to the user. Thus, such
a jump pushes a call onto callgrinds shadow stack.
The option "--pop-on-jump" changes this to pop+push the
shadow callstack: then, a jump between functions is seen
as a return to the caller and a new call.

The default behaviour is _bad_ for using callgrind with
self-hosting. Valgrinds inner loop VG_(run_innerloop)
jumps to generated code, and this code jumps back to
the inner loop. Thus, every executed BB adds 2 calls
to an ever increasing shadow call stack, leading to
memory consumption increasing with runtime :-(

So: For self-hosting valgrind with an outer callgrind,
always use option "--pop-on-jump" for the outer callgrind.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5869
callgrind/clo.c
callgrind/fn.c
callgrind/global.h