History log of /external/valgrind/callgrind/sim.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
45ee036d5512d088f138c143e8be8c1002e452e4 06-Feb-2015 florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> Fix undefined behaviours when shifting.
Found by libubsan.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14913 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/sim.c
29582f8170e2de848466a4abf65608598b1912a3 14-Dec-2014 florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> Remove callgrind's percentify and commify functions as well as the
assorted buffers that go with them.
Part of fixing BZ #337869.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14810 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/sim.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/sim.c
cc9480fc9655148bbb120684c2d100eee7748105 11-Nov-2014 florian <florian@a5019735-40e9-0310-863c-91ae7b9d1cf9> Merge r14340,14346-14348,14352,14354-14355 from the BUF_REMOVAL branch to
trunk.
Convert callgrind to use VG_(fprintf).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14713 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/sim.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/sim.c
0c8cd40e02dacbce35354171cca7cdbf042db576 03-Sep-2013 mjw <mjw@a5019735-40e9-0310-863c-91ae7b9d1cf9> Reuse (shared) cachegrind source files in callgrind directly.

The callgrind Makefile.am had a common sources list that included
../cachegrind/cg_arch.c. This doesn't play well with automake and
subdir-objects. Especially make distclean was broken because some
.deps files were removed multiple times.

Just include the shared source file directly into the callgrind
source file that needs it (cg_arch.c in sim.c).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13528 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/sim.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/sim.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/sim.c
157c7fb506000b2c90a7449d83e69b4003143d07 29-Oct-2012 weidendo <weidendo@a5019735-40e9-0310-863c-91ae7b9d1cf9> Callgrind: use memory block number as tag for simple model

Same as in Cachegrind. Gives a slight speedup.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13094 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/sim.c
8ff46583ac7377941f2d1b03368f1122cacc94d7 29-Oct-2012 weidendo <weidendo@a5019735-40e9-0310-863c-91ae7b9d1cf9> Use always_inline attribute also in Callgrinds simulator

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13093 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/sim.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/sim.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/sim.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/sim.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/sim.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/sim.c
23642271f41ad858fa0935b8b870290b45bd5eeb 06-Sep-2011 weidendo <weidendo@a5019735-40e9-0310-863c-91ae7b9d1cf9> Allow overriding not-supported auto-detected cache configs

Patch by Philippe Waroquiers, slightly changed.

This actually was a regression from 3.6.1, but the patch
also improves on printed messages, and refactors common
code between cachegrind and callgrind.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12013 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/sim.c
c542ba4a7e3514f665e1848644017d180d3c9331 19-Aug-2011 tom <tom@a5019735-40e9-0310-863c-91ae7b9d1cf9> Make callgrind report the detected cache configuration as well.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11995 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/sim.c
7c0f63976e88a8e5adde66cbd00ba00e7ca8facc 09-Jun-2011 tom <tom@a5019735-40e9-0310-863c-91ae7b9d1cf9> Use the precomputed sets_min_1 value consistently when masking
off bits from an address to find which cache set it is in.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11809 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/sim.c
061f079cd815952d484746cbb442aa2f1776205c 11-May-2011 weidendo <weidendo@a5019735-40e9-0310-863c-91ae7b9d1cf9> Fix bugs catched by BEAM

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11742 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/sim.c
2d853a1f8a153ee1ed99c5e1166d69dd4c6574d8 07-Oct-2010 njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> Change Cachegrind/Callgrind to talk about the LL (last-level) cache instead
of the L2 cache. This is to accommodate machines with three levels of
cache. We still only simulate two levels, the first and the last.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11404 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/sim.c
b1cc5d666cc8f8065419e4a8c819ed0b8256a764 06-Jul-2010 njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> Make error messages at start-up more consistent. Every line of such
messages now begin with "valgrind: ", and they're more often printed before
the preamble. This required introducing a new message kind, Vg_FailMsg, and
functions VG_(fmsg) and VG_(fmsg_bad_option), and removing
VG_(err_bad_option).

Where we used to have horrible output like this:

[ocean:~/grind/ws2] vg5 --tool=massif --threshold=101 date
==31877== Massif, a heap profiler
==31877== Copyright (C) 2003-2010, and GNU GPL'd, by Nicholas Nethercote
==31877== Using Valgrind-3.6.0.SVN and LibVEX; rerun with -h for copyright info
==31877== Command: date
==31877==
==31877== --threshold must be between 0.0 and 100.0
valgrind: Bad option '--threshold'; aborting.
valgrind: Use --help for more information.

We now have nice output like this:

[ocean:~/grind/ws2] vg2 --tool=massif --threshold=101 date
valgrind: Bad option: --threshold=101
valgrind: --threshold must be between 0.0 and 100.0
valgrind: Use --help for more information or consult the user manual.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11209 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/sim.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/sim.c
11b2a1dc9386893575dc9da75f4f87ace710c916 10-Jun-2010 weidendo <weidendo@a5019735-40e9-0310-863c-91ae7b9d1cf9> Fix typo introduced with r11165, include "Ge" in regtests

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11170 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/sim.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/sim.c
75a5c2d2de31d2f9dacc67283764a91cb06e062b 10-Jun-2010 weidendo <weidendo@a5019735-40e9-0310-863c-91ae7b9d1cf9> Callgrind: make globals for log_* helpers visible outside sim.c

At beginning of each BB, Callgrind inserts a call to setup_bbcc,
which (among a lot other things), sets global vars needed for
the log_* helpers called afterwards in this BB.

These globals, bb_base and cost_base, previously we static declared
and only visible in sim.c. Make them visible also in the rest of
callgrind to allow for log_* handlers outside sim.c.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11166 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/sim.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/sim.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/sim.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/sim.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/sim.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/sim.c
83df0b67a14425c484d8dda42b53f3ff0b598894 25-Feb-2009 njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> atoll() is a terrible function -- you can't do any error checking with it.
Some of our option processing code uses it. This means that eg.
'--log-fd=9xxx' logs to fd 9, and '--log-fd=blahblahblah' logs to 0 (because
atoll() returns 0 if the string doesn't contain a number!)

It turns out that most of our option processing uses VG_(strtoll*) instead
of VG_(atoll). The reason that not all of it does is that the
option-processing macros are underpowered -- they currently work well if you
just want to assign the value to a variable, eg:

VG_BOOL_CLO(arg, "--heap", clo_heap)
else VG_BOOL_CLO(arg, "--stacks", clo_stacks)

else VG_NUM_CLO(arg, "--heap-admin", clo_heap_admin)
else VG_NUM_CLO(arg, "--depth", clo_depth)

(This works because they are actually an if-statement, but it looks odd.)

VG_NUM_CLO uses VG_(stroll10). But if you want to do any checking or
processing, you can't use those macros, leading to code like this:

else if (VG_CLO_STREQN(9, arg, "--log-fd=")) {
log_to = VgLogTo_Fd;
VG_(clo_log_name) = NULL;
tmp_log_fd = (Int)VG_(atoll)(&arg[9]);
}

So this commit:
- Improves the *_CLO_* macros so that they can be used in all circumstances.
They're now just expressions (albeit ones with side-effects, setting the
named variable appropriately). Thus they can be used as if-conditions,
and any post-checking or processing can occur in the then-statement. And
malformed numeric arguments (eg. --log-fd=foo) aren't accepted. This also
means you don't have to specify the lengths of any option strings anywhere
(eg. the 9 in the --log-fd example above). The use of a wrong number
caused at least one bug, in Massif.
- Updates all places where the macros were used.
- Updates Helgrind to use the *_CLO_* macros (it didn't use them).
- Updates Callgrind to use the *_CLO_* macros (it didn't use them), except
for the more esoteric option names (those with numbers in the option
name). This allowed getUInt() and getUWord() to be removed.
- Improves the cache option parsing in Cachegrind and Callgrind -- now uses
VG_(strtoll10)(), detects overflow, and is shorter.
- Uses INT instead of NUM in the macro names, to distinguish better vs. the
DBL macro.
- Removes VG_(atoll*) and the few remaining uses -- they're wretched
functions and VG_(strtoll*) should be used instead.
- Adds the VG_STREQN macro.
- Changes VG_BINT_CLO and VG_BHEX_CLO to abort if the given value is outside
the range -- the current silent truncation is likely to cause confusion as
much as anything.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9255 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/sim.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/sim.c
b80d8e13280df35045cd439de357e0079bb1b88f 27-Jan-2009 weidendo <weidendo@a5019735-40e9-0310-863c-91ae7b9d1cf9> Callgrind: Remove ifdef'ed-out, non-working code.

Rechecking the diff of r9080 on the mailing list, I thought
I forgot to replace "|" with "+" in one spot. But that was part
of not-used code, so it actually does not matter.
So better get rid of this code part at all (no need to backport ;-).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9081 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/sim.c
144b76c70143b4e68e584ad6b382d16360a8a460 26-Jan-2009 weidendo <weidendo@a5019735-40e9-0310-863c-91ae7b9d1cf9> Cachegrind/Callgrind: allow for cache sizes other than only powers of two

The number of sets, ie. number of cache lines divided by associativity,
and the cache line size still have to be powers of two.
This change is needed for default cache parameters used on some Intel
Core 2 and Atom processors.

Includes cachegrind manual update and explicit tests with 24KB D1/3MB L2
Reverts addition of 6MB warning to {cachegrind,callgrind}/tests/filter_stderr

Backporting to VALGRIND_3_4_BRANCH needs r8912

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9080 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/sim.c
9c606bd8634cd6b67bb41fa645b5c639668cfa2d 18-Sep-2008 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Merge all remaining changes from branches/PTRCHECK. These are some
relatively minor extensions to m_debuginfo, a major overhaul of
m_debuginfo/readdwarf3.c to get its space usage under control, and
changes throughout the system to enable heap-use profiling.

The majority of the merged changes were committed into
branches/PTRCHECK as the following revs: 8591 8595 8598 8599 8601 and
8161.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8621 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/sim.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/sim.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/sim.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/sim.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/sim.c
28e2a144490a9228ee7b92f1f80113d5fe23a6f2 22-Nov-2006 weidendo <weidendo@a5019735-40e9-0310-863c-91ae7b9d1cf9> Fix same cache simulation bug in callgrind as fixed
in r6365 for cachegrind.

This needs 3 fixes (the 4th is ifdef'd out) for the
3 versions of the simulator in callgrind.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6367 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/sim.c
6893d65852940741dbebbc6ba1480e89cf34e30f 15-Oct-2006 sewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9> Move functions which deal with bad command line options from m_main
into m_options.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6233 a5019735-40e9-0310-863c-91ae7b9d1cf9
/external/valgrind/callgrind/sim.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/sim.c