History log of /external/valgrind/callgrind/main.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
1e802b6a8d0d4b7b630d2a1dd9683c7c889b01a3 13-Feb-2015 florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> Add command line flag --max-threads=<integer> to increase the number of
threads that valgrind can handle. No recompile is needed.
Part of fixing BZ #337869.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14932 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
8d47a61e503b69ffbc783717f5faf09d0bbc4723 05-Feb-2015 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Allow the user to specify precise-exception behaviour for translations
made from file-backed mappings (AOT code, basically) that is different
from the default behaviour as specified by --vex-iropt-register-updates.

New flag is --px-file-backed=, with the same possible args as
--vex-iropt-register-updates has.

Add a new flag --px-default, which is a short alias for
--vex-iropt-register-updates.

Add one line of stats output when --stats=yes, showing counts of how
many translations have been made under each of the 4 different PX
optimisation settings.

No user-visible change if you don't use the new flags.

Relies on VEX API change in r3084.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14906 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
5f1aeb620eb5a3aab662f8b949b031a77a0d14fe 13-Jan-2015 florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> Export VG_(discard_tranalsations_safely) to the tools. It is
only allowed to be called in certain contexts which is
enforced at runtime.
Change callgrind accordingly.
New header file pub_tool_transtab.h added.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14867 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
82b928531abe4cb946d117fcd229d66601e5dddc 08-Jan-2015 florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> Add VG_(gettimeofday) such that callgrind can use it without
a bloody hack.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14857 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
04df7f2235e7f5011c3f12aca8f850ba4e70eb0a 08-Jan-2015 weidendo <weidendo@a5019735-40e9-0310-863c-91ae7b9d1cf9> Callgrind: fix BB discarding

When the info struct for a BB is created, we use the first guest
instruction address as key to insert the info into a hash table.
We should do the same when discarding.

This actually is not a real problem, as Callgrind obviously
is used very rarely with redirections. But we should be consistent
with cachegrind.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14856 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
ddd61ff058f02059064e083a8accaefed23d5548 04-Jan-2015 florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> Change most remaining use of Addr64 in coregrind and the tools to Addr.
Tracking VEX r3056.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14846 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
f466eef8e53aafcb617997e1ca18b7c829168db8 02-Jan-2015 florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> Track the IMark changes in VEX r3055.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14844 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
7b7d59405204f88cb944155d6bc5114025ebda98 19-Dec-2014 florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> Buffer audit. Resize a few.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14824 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
227a1ecca7f44cb07e74aa8f1bd24b29df629499 12-Dec-2014 florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> Add limited support for printing floating point numbers to
VG_(debugLog_vprintf).
Remove function VG_(percentify) and fix up its call sites (part of
fixing BZ #337869.
Allow the width in a format specification to be '*', i.e. the width is
given as an additional function argument.

The limitations for printing floating point numbers are:
(1) %f is the only supported format. Width and precision can be
specified.
(2) Funny numbers (NaN and such) are not supported.
(3) Floating point numbers need to be benign in the sense that their
integral part fits into an ULong.
This is good enough for our purposes.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14806 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
5b99e6669a0b2a925bb3fb2604259cc317963b6d 29-Nov-2014 florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> Fix BZ 334802. Patch by Mark Wielaard with a few mods to make it apply.
r14794 is related as well.
Also: remove -Wno-format-zero-length from compile options.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14795 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
7338295ff56bed2c48e1d4df47f07b117036ca3b 13-Nov-2014 florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> Audit two buffer sizes.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14720 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
48b1cf19e9978cef29969545ffd83c54d24d632a 06-Nov-2014 florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> Merge revisions 14366 and 14367 from the BUF_REMOVAL branch to trunk.
In function dump_state_togdb use VG_(gdb_printf) directly. No need to write
to a buffer first.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14700 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
5ee42a49a0701db915892bc349676f8cc5c60fba 06-Nov-2014 florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> Merge revisions 14344 and 14345 from the BUF_REMOVAL branch to trunk.
Basically:
CLG_(sprint_eventmapping) --> CLG_(eventmapping_as_string)
CLG_(sprint_mappingcost) --> CLG_(mappingcost_as_string)
The new functions return the string in a dynamically allocated buffer
that caller ought to free.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14699 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
3c0c94777f547bcb5eadbe8cb4328debf0f51875 24-Sep-2014 florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> Ripple from constifying parameters of instrumentation functions and
callbacks from VexTranslateArgs. See VEX r2958.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14564 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
c29761f54236f27d3bb3663998121bf1c7cbec8c 19-Mar-2014 dejanj <dejanj@a5019735-40e9-0310-863c-91ae7b9d1cf9> VG_(strlen) ( const HChar* str ) does not count the null terminator '\0' at the
end of the string, so we need to add an extra element in string 's' for the null
terminator.
VG_(strcpy) ( HChar* dest, const HChar* src ) function copies the string pointed
to by src, including the null terminator ('\0'), to the buffer pointed to by dest.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13880 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
cffe2a55d903655761ccc6025a23b823bee10170 11-Jan-2014 philippe <philippe@a5019735-40e9-0310-863c-91ae7b9d1cf9> add --vgdb-prefix arg to callgrind_control
If valgrind is started with --vgdb-prefix arg, then callgrind_control
cannot find and control this valgrind.
So, add an (optional) argument to callgrind_control,
and have callgrind tool report the needed vgdb prefix argument
if the user supplied this arg.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13769 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
6a8aa58330b2165121aade282eabe1a618a0b3cf 17-Dec-2013 weidendo <weidendo@a5019735-40e9-0310-863c-91ae7b9d1cf9> Callgrind: support printing stats via vgdb

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13763 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
d7341d8948ba0082488ea478ec7a6ba15949895b 12-Nov-2013 weidendo <weidendo@a5019735-40e9-0310-863c-91ae7b9d1cf9> Fix bug 327238.

assertion failure in Callgrind: bbcc.c:585 (vgCallgrind_setup_bbcc):
Assertion 'passed <= last_bb->cjmp_count' failed

Background:
We want to detect the jump behavior of code, that is, the side exit
from a SB, as there can be many. For that, instrumented code writes
the exit number into a global variable (jmps_passed) before an eventual
exit.

With an exception happening in the first few instructions of an SB,
jmps_passed never was written, and still contained an old value. This
got saved/restored around the exception handler, and resulted in the
failed assertion.
Solution: always initialize jmps_passed to zero in setup_bbcc(), which
is called at the beginning of every SB.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13712 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
0f157ddb404bcde7815a1c5bf2d7e41c114f3d73 18-Oct-2013 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Update copyright dates (20XY-2012 ==> 20XY-2013)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13658 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
ba74a11e27f94e09ae224a61b205e4bce0b094e6 21-Jan-2013 florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> Fix two asserts that Coverity's checker diagnosed as having side effects.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13252 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
cafe50502ae73d6d6d0f214e06a4619e6cb1b278 17-Jan-2013 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Merge, from branches/COMEM, revisions 13139 to 13235.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13236 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
6bd9dc18c043927c1196caba20a327238a179c42 23-Nov-2012 florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> Changes to allow compilation with -Wwrite-strings. That compiler option
is not used for testcases, just for valgrind proper.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13137 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
ad1162a84db887c997c766234f36dcecd5c926a1 23-Nov-2012 petarj <petarj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Flush events in Callgrind before enering a RMW region.

On some MIPS platforms, we had an issue in which SC would fail each time
due to some memory access occuring in the RMW region.
If code for simulator events is called before LL, it can help SC to pass.

This change fixes a few LL/SC issues on MIPS arch.

The patch by Josef Weidendorfer.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13136 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
19f91bbaedb4caef8a60ce94b0f507193cc0bc10 10-Nov-2012 florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> Fix more Char/HChar mixups. Closing in...


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13119 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
dbb3584f591710a15a437918c0fc27e300993566 27-Oct-2012 florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> More Char/HChar fixes and constification.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13088 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
25f6c57962b259a52e3e617eb96fa14d6fdbe364 21-Oct-2012 florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> Fix a few Char/HChar mixups in callgrind.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13069 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
ca503be79ca377d89b1692c37c97a06ed14dad3b 07-Oct-2012 florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> This is the 2nd installment of the cache info reorganisation.
The host's VexArchInfo is passed to the tool instrumentation
functions. Purely mechanic patch.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13031 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
5b240c20b48c86955e574d5880a145927c60a686 15-Aug-2012 philippe <philippe@a5019735-40e9-0310-863c-91ae7b9d1cf9> Implement --vex-iropt-register-updates=sp-at-mem-access

Option sp-at-mem-access can be used by tools which do not
need an up to date BP and IP at each mem access.
It is needed however to have SP up to date at each memory
access, as an up to date SP is needed to grow the stack in
m_signals.c

Tools massif, cachegrind and callgrind are using sp-at-mem-access
as default.
None tool could also use sp-at-mem-access but default is kept
to unwindregs-at-mem-access (similar to memcheck, drd, helgrind, exp-sgcheck).

exp-dhat, exp-bbv, lackey have not been looked at to see if they
could make use of sp-at-mem-access.

Validated on x86, amd64, ppc64 and s390x.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12872 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
03f8d3fc25f5a45c5826259d1b33b7f310117279 05-Aug-2012 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Update copyright dates to include 2012.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12843 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
c4ebde3931d3740270b92bea4c85a59443e7c65d 04-Jun-2012 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> If we are doing cache simulation, refuse to start at all if the minimum
cache line size is smaller than the maximum guest register size.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12606 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
28a23c05ce81a384283eb6d92d39ace2ff7283ca 14-Nov-2011 weidendo <weidendo@a5019735-40e9-0310-863c-91ae7b9d1cf9> Callgrind: use jmpkind from VEX for side exits.

To detect calls and returns, Callgrind's heuristic
starts with using the jumpkind got from VEX for
a control flow change instruction. However, for
side exits, it always assumed a (conditional) jump,
which holds true for x86, but e.g. not for ARM.

This fixes Callgrind to use the jumpkind found
by VEX for all exits, which should help making
Callgrind work for ARM. It also moves the check
whether a boring jump is actually a fall-through
to instrumentation time. This changes (fixes) the
result for indirect jumps to the next instruction,
which should not be classified as fall-through
(anyway, this case is probably very rare).

This patch introduces an own enum for jump kinds
in Callgrind. This is less confusing than misusing
the VEX jump kind type, as Callgrinds wants
to distinguish BB fall-throughs from real jumps
(which both are Ijk_Boring in VEX).
Also, setup_bbcc now stores separately whether the
jump kind is conditional or not.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12269 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
add9ec4059bed268713f9f8dac493c7f25baee94 14-Nov-2011 weidendo <weidendo@a5019735-40e9-0310-863c-91ae7b9d1cf9> callgrind: remove command file polling

This is the last part of moving from command file polling
to the vgdb ptrace method for interactive control of Callgrind.
VG 3.7.x ported callgrind_control to vgdb (in r11867), but
still did command file polling to support existing KCachegrind
releases. KCachegrind from upcoming KDE SC 4.8 will use
callgrind_control instead of manually writing command files.

The main benefit from this is, apart from getting rid of
continous file polling activity in Callgrind, that blocked
processes can now respond to callgrind_control.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12268 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
6ab7f2d66901d3a57837701888d42f82b71592d1 08-Nov-2011 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> When doing instrumentation, pay attention to the Ist.IMark.delta
fields. This makes the --ct-verbose=1 output make a lot more sense
for Thumb code. Should have no effect on any other platform.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12260 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
ec062e8d96a361af9905b5447027819dfbfee01a 23-Oct-2011 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Update all copyright dates, from 20xy-2010 to 20xy-2011.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12206 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
ce6489fe9295604df9028f114482f9eba2c73a16 06-Sep-2011 weidendo <weidendo@a5019735-40e9-0310-863c-91ae7b9d1cf9> Make some vgdb interface to callgrind_control internal

The vgdb "status" monitor command is still available, but
used for pretty printing of status information now (acutally,
just some place holder for real information up to now: just
number of running threads). The internal interface used by
callgrind_control to provide stack traces and event counts
is using "status internal", and is not documented, as the
format is not for human consumption.

This also adds some documentation.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12014 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
722be390856c07c441409e1fb302c4cf6bf983fe 21-Jul-2011 weidendo <weidendo@a5019735-40e9-0310-863c-91ae7b9d1cf9> Update ugly Callgrind hack for supporting instrumentation modes

To support different instrumentation modes, callgrind calls
VG_(discard_translations), which up to now does not belong to the
functions allowed to call from tools, as this is unsafe if
called from generated code.

Callgrind hacks around that by defining the prototype itself.
However, in r4789 (from Sep 27 2005!) a 3rd arg was added for
debugging output. Thus, callgrind could crash if called
with "-d -d".

As the "instrumentation off" feature seems to be used quite often,
it really would be nice to have VG_(discard_translations) callable
from tools...

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11906 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
584c9ef608c2f2259cc6d0f6380e646a4def7293 11-Jul-2011 weidendo <weidendo@a5019735-40e9-0310-863c-91ae7b9d1cf9> callgrind: add vgdb commands needed for porting callgrind_control

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11866 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
30b3eca94e609214d9ac8dabfee9be3f3ab46d85 28-Jun-2011 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> valgrind and tool mon. cmds prefixes changes + doc fixes + new vgdb option
--cmd-time-out

* changed prefixes of Valgrind core monitor commands from vg. to v.
* removed prefixes of Tool monitor commands
* memcheck leak_check 'leakpossible' arg renamed to 'possibleleak'
* memcheck make_memory 'ifaddressabledefined' arg renamed to
'Definedifaddressable'
(with uppercase D to avoid confusion with 'defined' arg).
* vgdb options
- Some doc updates : more logical option order documentation,
specify 'standalone' for options aimed at standalone usage.
- added option --cmd-time-out for standalone vgdb
(comment of Josef Weindendorfer, needed to interface with a callgrind GUI)
* updated tests according to the above.
* updated documentation according to the above.
* some additional minor doc fixes/clarifications

(Philippe Waroquiers, philippe.waroquiers@skynet.be). Bug 214909
comment 111.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11844 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
3b290486cd4cd601b20e04340e593c9ed9717e5f 06-May-2011 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Implement a GDB server in Valgrind. See #214909.
(Philippe Waroquiers, philippe.waroquiers@skynet.be)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11727 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
e7a50823636c1628b946fe570a5bf7fb17a31888 20-Apr-2011 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Change a bunch of < > style includes to " " style.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11704 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
0ecd49e1da934c40c18eb7d4fa044682e4b01084 04-Oct-2010 weidendo <weidendo@a5019735-40e9-0310-863c-91ae7b9d1cf9> Make sure that string buffers for cost arrays are large enough.

17 64bit values fit into 512 bytes (but not 256...).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11393 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
cb3ccf3c79b432f43a1843496d9715fdb5102554 07-Jul-2010 weidendo <weidendo@a5019735-40e9-0310-863c-91ae7b9d1cf9> Fix for branch prediction: handle calls via function pointer

Calls via function pointers are indirect branches, and thus
should call into the indirect branch predictor simulation.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11212 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
320705fdb4ee91a69030d2024eec6e9a613c86c4 02-Jul-2010 weidendo <weidendo@a5019735-40e9-0310-863c-91ae7b9d1cf9> Callgrind: add branch prediction from Cachegrind

Callgrind now uses Cachegrind's command line option to switch
on simulation: "--branch-sim=yes/no" for branch prediction,
and "--cache-sim=yes/no" for cache simulation (for more
consistency and to avoid confusion). However, the previously
used "--simulate-cache=yes/no" still is supported but deprecated.

Included: according documentation and tests.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11207 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
aeb8622e80e51a04e769b00d07b5eef74baca2c3 10-Jun-2010 weidendo <weidendo@a5019735-40e9-0310-863c-91ae7b9d1cf9> Callgrind new feature: count global bus lock events "Ge"

To count global bus lock events, use "--collect-bus=yes".
For x86, this will count the number of executed instructions
with a lock prefix; for architectures with LL/SC, this will
count the number of executed SC instructions.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11167 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
5bba5258a193d980fb116a8b04f96dc16d96aacf 10-Jun-2010 weidendo <weidendo@a5019735-40e9-0310-863c-91ae7b9d1cf9> Callgrind: event sets now consist of event groups

Offsets of groups within event sets are now
stored in a offset table as part of the event set, and
can be accessed directly. Before, offsets were hardcoded
all over the place. This should make addition of further
event groups much simpler.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11165 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
9eecbbb9a9cbbd30b903c09a9e04d8efc20bda33 03-May-2010 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Update copyright dates to 2010.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11121 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
db5907d7b94ce492f29a96c95e186fdcda23a149 26-Nov-2009 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Track vex r1930 (Change the IR representation of load linked and store
conditional.) Completes the fix of #215771.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10957 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
e89148708745a7b5ca969628d271ab64a508871f 11-Aug-2009 weidendo <weidendo@a5019735-40e9-0310-863c-91ae7b9d1cf9> Callgrind: Fix printing of "Summary:" line in finish()

The global cost counters, which are used for printing the
summary line, where zeroed before in init_exec_state(), called
by unwind_thread().

Stack unwinding (i.e. unwind_thread) is also done at instrumentation
state changes, and there, we want the cost counters to be zeroed
(was fix for bug 150606). Do this explicitly now.

PS: The correct fix for bug 150606 is not to zero the cost counters
(we do not really want this at instrumentation state changes), but
to store the current counter values in a "last_instr_state_on_cost"
counter, and use this as the global cost counter on enter for functions
which are left but were not detected to be entered.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10782 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
ceb06de38a40210bfdec1c66284c6e1db778c2ca 11-Aug-2009 weidendo <weidendo@a5019735-40e9-0310-863c-91ae7b9d1cf9> Callgrind: On zeroing costs, also set call counters to zero.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10781 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
2d9e874b7a628ada216f09cc4f065798c65fffa4 07-Aug-2009 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Tidy up of messaging:

* For all tools and the core, don't show statistics when -v is in
effect. Instead, try to restrict -v to mostly user-useful
stuff.

* A new flag --stats=no|yes [no] produces statistics output instead.

* Fix longstanding problem in that Memcheck's leak checker ran after
the core's error manager module shut down, thereby not showing use
counts of leak suppressions. This fixes #186790.

* As a consequence, the leak checker text output of Memcheck has
changed a bit -- leak check is done before the final error
summary is done (much more logical), and the output has been
tidied up a bit.

* Helgrind, Drd and Ptrcheck now also print "For counts of
detected and suppressed errors, rerun with: -v", which makes
them consistent with Memcheck in this regard. These are
filtered out by the regtest filter scripts.

For all tools except Memcheck, the regtests are unchanged. On
Memcheck regtests still fail due to rearrangements of the leak
checker output. This will be fixed by a followup commit.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10746 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
0f33adf91a51bfedbd1d2ec40014c9c470fa5b0e 15-Jul-2009 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Merge callgrind/ changes from branches/MESSAGING_TIDYUP r10464.
See trunk r10465 commit message for details.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10471 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
1c0ce7a9edf8772773f6216dbad4bb04317d23b6 01-Jul-2009 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Merge in branches/DCAS.

This branch adds proper support for atomic instructions, proper in the
sense that the atomicity is preserved through the compilation
pipeline, and thus in the instrumented code.

These changes track the IR changes added by vex r1901. They primarily
update the instrumentation functions in all tools to handle the
changes, with the exception of exp-ptrcheck, which needs some further
work in order to be able to run threaded code.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10392 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
0a1951d64df79f98f885426671fc9d3982647a6b 15-Jun-2009 weidendo <weidendo@a5019735-40e9-0310-863c-91ae7b9d1cf9> Callgrind: fix instrumentation for arbitrary events per guest instruction

(should fix bug 169505)

This uses the same event queue scheme as cachegrind and lackey, and
same kind of helpers (1/2/3 Ir events, Ir+Dr, Dr, Ir+Dw, Dw).
Note that in contrast to Cachegrind, Callgrind interpretes a modify event
as Dw (otherwise the cache model generating write back events would not work).

Callgrind uses per-(guest)instruction event sets for cost counters.
An per-instruction eventset is incrementally extended as events for the
same guest instruction are flushed. Event sets always start with Ir counters,
but depending on Dr/Dw order afterwards, there exist IrDr(Dw) and IrDw(Dr).
Per-instruction event sets now are consistently named according to event ordering.
Event set "sim" is a subset of "full", was never used and was removed.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10321 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
9f207460d70d38c46c9e81996a3dcdf90961c6db 10-Mar-2009 njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> Updated copyright years.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9344 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
09ee78ec9675201840d895623d49efba1ffe05d8 24-Feb-2009 weidendo <weidendo@a5019735-40e9-0310-863c-91ae7b9d1cf9> Callgrind: fix a few 'unused parameter' warnings

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9251 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
a0b6b2cf9abc7b0d87be1215a245eaccc0452af9 07-Jul-2008 bart <bart@a5019735-40e9-0310-863c-91ae7b9d1cf9> Merged FORMATCHECK branch (r8368) to trunk.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8369 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
4d474d086188fd1f29fa97dbd84d8ea2e589a9b8 11-Feb-2008 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Update copyright dates ("200X-2007" --> "200X-2008").


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7398 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
72d75132068882b52b67dddc9af85ffaae5ac14f 10-Nov-2007 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Track vex r1793: make all tools able to handle the new IR memory bus
event statement (Ist_MBE).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7119 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
8a7b41b41b46c0aa7bd4b6678b82285437e7f08c 23-Sep-2007 njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> Fix various format string errors, courtesy of Florian Krohm.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6902 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
9a0cba4e767f487c2abaa35f95a3452d6bd0ff66 16-Apr-2007 njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> Fix some copyright notices:
- extend some to 2007
- use njn@valgrind.org instead of njn25@cam.ac.uk
- use "tool" instead of "skin"


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6703 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
ae0bb6fc1d133ec1d96450cb1d5b14e384a6a4f0 16-Feb-2007 weidendo <weidendo@a5019735-40e9-0310-863c-91ae7b9d1cf9> callgrind: fix --collect-systime=yes with "no instrumentation" mode

(see bug 139363)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6593 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
9ebd6e0c607fa30301b1325874eb8de871c21cc5 08-Jan-2007 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Update copyright dates.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6488 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
3e32c877eb0dfe174c128317c19cc211365b4781 24-Dec-2006 njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> Split the thread_runstate event into two, start_client_code and
stop_client_code, which is a bit clearer and easier to work with.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6418 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
0b9d74abd0a663b530d290b2b788ddeda46e5400 24-Dec-2006 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Non-functional commit: track IR renaming in vex r1689.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6416 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
134657cceda1f3799beb4e5ab8862f83b8806532 24-Dec-2006 weidendo <weidendo@a5019735-40e9-0310-863c-91ae7b9d1cf9> Callgrind: Throttle calls CLG_(run_thread) after r6413

After the change in r6413, CLG_(run_thread) is called a
lot more often, increasing the polling overhead to check
for a callgrind command file (created by callgrind_control
for controlling a callgrind run in an interactive way).
This reduces the calls to only be done every 5000 BBs,
which gives a similar polling frequency as before.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6414 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
975618137c5e56cc8f633d5747727f26e2fbc90b 23-Dec-2006 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Change the core-tool interface 'thread_run' event to be more useful:

- Rename the event to 'thread_runstate'.

- Add arguments: pass also a boolean indicating whether the thread
is running or stopping, and a 64-bit int showing how many blocks
overall have run, so tools can make a rough estimate of workload.

The boolean allows tools to see threads starting and stopping.
Prior to this, de-schedule events were invisible to tools.

- Call the callback (hand the event to tools) just before client
code is run, and again immediately after it stops running. This
should give correct sequencing w.r.t posting of thread creation/
destruction events.

In order to make callgrind work without complex changes, I added a
simple impedance-matching function 'clg_thread_runstate_callback'
which hands thread-run events onwards to CLG_(thread_run).

Use this new 'thread_runstate' with care: it will be called before
and after every translation, which means it will be called ~500k
times in a startup of firefox. So the callback needs to be fast.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6413 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
149aed8dbfb2432fcc4785219f4620de5b8a8e10 25-Nov-2006 njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> Use the newly-added dopyIRBBExceptStmts() in tools.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6372 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
e45a799eefd8be1959cc0b7c04c247a292ce5d33 17-Oct-2006 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Update expected translation sizes, + whitespace changes (??)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6299 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
4ce5e79ff39cbdef678e4bd9d2d16fbaba9f7fde 20-Sep-2006 weidendo <weidendo@a5019735-40e9-0310-863c-91ae7b9d1cf9> Callgrind: fix interactive control after fork()

This fixes bug 134316: when an program in callgrind does
a fork, callgrind_control does show both now, and they
can be controlled separately.

However, missing in this patch is zeroing of cost centers
directly after the clone syscall in the child.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6082 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
f3e0b49a2998ec2b3b236c7325fde875fd7c5214 11-Sep-2006 weidendo <weidendo@a5019735-40e9-0310-863c-91ae7b9d1cf9> Callgrind: Fix failed assertion at toggling instrumentation mode

When instrumentation mode is switched off, we want to fully
reset callgrinds internal execution state, which includes
the shadow call stack and function stack for context generation.
The latter was not completely reset before.

The bug showed up when switching the instrumentation mode on for
the second time, leading to
Callgrind: callstack.c:211 (vgCallgrind_push_call_stack):
Assertion 'current_entry->cxt != 0' failed.

This commit also improves debug output a little bit.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6045 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
e4b0bf07b0ee0a18eacc5aba91686ab5fc1d327b 06-Jun-2006 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Update copyright dates.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5954 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
db70ed74d34678f27ff1c0b64f912c3c4dd43dc9 27-May-2006 weidendo <weidendo@a5019735-40e9-0310-863c-91ae7b9d1cf9> Bug reports should have the same destination as for other VG tools


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5943 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
c8e76158524e262a2707703e172bca06d78d3bd2 27-May-2006 weidendo <weidendo@a5019735-40e9-0310-863c-91ae7b9d1cf9> Fix a failed assertion on retranslation of rep or cmov instructions.

Bug description: Very similar to cachegrind, callgrind stores
metainformation per guest instruction; this meta information is
given when calling into the simulator. In contrast to cachegrind,
callgrind keeps this info when the source is discarded, and checks
on retranslation whether the same meta info is generated.
This check sometimes fails: E.g. for rep x86 instructions, 2 simulator
calls
are usually generated for one x86 instruction (the instruction fetch and
a
data access), thus overwriting the data_size meta information for one
x86
instruction first with 0, and afterwards e.g. with 1. The check on
retranslation
fails because of this. The fix is to only write/check data_size values
>0.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5942 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
12c73f1d177d9edcdb3edfdc3ec29010f3bcd617 03-Apr-2006 weidendo <weidendo@a5019735-40e9-0310-863c-91ae7b9d1cf9> Callgrind: add 4 regression tests

The simwork tests check different cache simulator
options/modes. These tests should be extended to
check for the produced call graph.

The threads check tests the callgrind mode where
counts are aggregated separate per thread.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5816 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
8a95fd381e9c1688171d21800c3f0404e99e7038 02-Apr-2006 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Fix another place where function addresses passed to Vex needed to be
dereferenced properly. (Logically part of r5814).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5815 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
bb76070b641a1a9db302096ce68a8551b94dfd0a 02-Apr-2006 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Fix ppc64-linux breakage - get the function entry address, not the
descriptor address.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5814 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
ca472c598bdb37ad0de4b67a7ad53b392ae80572 31-Mar-2006 weidendo <weidendo@a5019735-40e9-0310-863c-91ae7b9d1cf9> Simple regression test for callgrind:
run a custom client request.

By doing this, I found out that callgrind.h still defined
client requests for VG 2 :-( Obviously, nobody was using
them. This is fixed, and other small things to make the
test run, too.

Notice for myself: regression tests are needed.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5807 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c
a17f2a36b7fde9ee842f92412eacbf94b66af59d 20-Mar-2006 weidendo <weidendo@a5019735-40e9-0310-863c-91ae7b9d1cf9> Callgrind merge: code


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5780 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/main.c