Fix 376257 - helgrind history full speed up using a cached stack

This patch implements the flag --delta-stacktrace=yes/no.
Yes indicates to calculate the full history stack traces by
changing just the last frame if no call/return instruction was
executed.
This can speed up helgrind by up to 25%.

This flags is currently set to yes only on linux x86 and amd64, as some
platform dependent validation of the used heuristics is needed before
setting the default to yes on a platform. See function check_cached_rcec_ok
in libhb_core.c for more details about how to validate/check the behaviour
on a new platform.
This commit is contained in:
Philippe Waroquiers
2017-11-02 21:33:35 +01:00
parent 6a55b1e82c
commit 619fb35df7
15 changed files with 665 additions and 86 deletions

View File

@@ -64,6 +64,17 @@ extern UInt VG_(get_StackTrace) ( ThreadId tid,
/*OUT*/StackTrace fps,
Word first_ip_delta );
// Same as VG_(get_StackTrace), but applies a delta to the first SP used for
// unwinding the first frame.
extern UInt VG_(get_StackTrace_with_deltas)(
ThreadId tid,
/*OUT*/StackTrace ips, UInt n_ips,
/*OUT*/StackTrace sps,
/*OUT*/StackTrace fps,
Word first_ip_delta,
Word first_sp_delta
);
// Apply a function to every element in the StackTrace. The parameter
// 'n' gives the index of the passed ip. 'opaque' is an arbitrary
// pointer provided to each invocation of 'action' (a poor man's