Commit Graph

44 Commits

Author SHA1 Message Date
Julian Seward
172505c978 Update copyright dates.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6488
2007-01-08 06:01:59 +00:00
Nicholas Nethercote
cadc28816d 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
2006-12-24 07:51:17 +00:00
Julian Seward
1083ded7e2 Non-functional commit: track IR renaming in vex r1689.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6416
2006-12-24 02:24:11 +00:00
Josef Weidendorfer
3f6a706d72 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
2006-12-23 23:11:20 +00:00
Julian Seward
806c8b17b3 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
2006-12-23 01:21:12 +00:00
Nicholas Nethercote
2c3a6359bb Use the newly-added dopyIRBBExceptStmts() in tools.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6372
2006-11-25 22:38:11 +00:00
Josef Weidendorfer
39550a1d81 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
2006-11-22 21:00:53 +00:00
Julian Seward
51701576f2 This got a bit messed up during recent merging; tidy up.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6313
2006-10-17 21:06:58 +00:00
Julian Seward
10761b3aca Update expected translation sizes, + whitespace changes (??)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6299
2006-10-17 02:24:18 +00:00
Julian Seward
12ef34f623 Track SysRes change.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6294
2006-10-17 02:15:17 +00:00
Julian Seward
713b2d46c0 Merge r6086:
Makefile.am changes for AIX5.  Almost all boilerplate stuff fitting in
with the existing factorisation scheme.  The only change of interest
is that configure.in now generates automake symbols of name
VGP_platform and VGO_os, whereas previously it just made VG_platform
which was a bit inconsistent with the VGP/VGO/VGA scheme used in C
code.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6242
2006-10-17 00:56:43 +00:00
Julian Seward
f4560d1332 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
2006-10-15 01:25:13 +00:00
Julian Seward
ae8215b3ac Create a new module, m_vki, and move all knowledge about the kernel
interface, except for the syscall numbers, into that.  Mostly this
means moving include/vki-*.h to include/vki/vki-*.h.

include/pub_tool_basics.h previously dragged in the entire kernel
interface.  I've done away with that, so that modules which need to
see the kernel interface now have to include pub_{core,tool}_vki.h
explicitly.  This is why there are many modified .c files -- they have
all acquired an extra #include line.

This certainly breaks all platforms except x86.  Will fix shortly.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6225
2006-10-14 19:26:10 +00:00
Josef Weidendorfer
0d463585d9 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
2006-09-20 21:29:39 +00:00
Josef Weidendorfer
2d6c37778b callgrind_annotate: fix warnings with "--collect-jumps=yes"
This callgrind option produces lines starting e.g. with
"jfi" in the profile data files, which specifies a
source file change between a jump source and jump target.
This itself is meaningless for callgrind_annotate, as
it can not show jump information in its annotation.
However, such "jfi" lines can contain important mapping
info for a (file ID, file name) tuple - which leads to
further warnings and problems if ignored.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6064
2006-09-13 22:57:38 +00:00
Josef Weidendorfer
9418c0a710 Callgrind: Extend test for client requests
This checks all of callgrinds client requests,
and accordings actions (zero/dump) in different states
(collection on/off, instrumentation on/off).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6058
2006-09-12 21:24:24 +00:00
Josef Weidendorfer
c2d143c8ea Callgrind: fix segfault when dumping after toggling instrumentation mode
This bug shows up when callgrind dumps data of a BB with 0 instructions
(the segfault only appears on x86_64; for x86 we were "lucky").

"BB with 0 instructions" happens when you switch on instrumentation
(and callgrinds call graph tracing starts with an emtpy shadow call
stack) in the middle of a run: Whenever the shadow callstack
is empty, but callgrind sees a return instruction (ie. a shadow
callstack underrun), it creates an artifical BB which is faked to
have called the function we are returning from.
This way, the call arc is noted and will appear in the dump.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6053
2006-09-12 19:10:08 +00:00
Josef Weidendorfer
72fd1887c4 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
2006-09-10 22:34:20 +00:00
Josef Weidendorfer
012d22a22e Callgrind: Fix annotate script for data produced with --dump-instr=yes
I just noticed that this is still a little wrong, as counts for e.g.
"strcmp" from libc and "strcmp" from ld.so will make up only one entry,
with the object name randomly choosen... but otherwise, it matches
with the data shown by KCachegrind.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6044
2006-08-31 22:54:36 +00:00
Josef Weidendorfer
777cac2987 callgrind: Fix warning about malformed creator line in annotate script
This also changes the default filename (if not given) to callgrind.out.*



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6043
2006-08-31 19:29:13 +00:00
Josef Weidendorfer
9f24ba3822 Correction: Callgrind got rid of the wrapper script with
the merge into Valgrind


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5972
2006-06-09 11:44:03 +00:00
Julian Seward
67a13d6390 Install header in the right place. (From Josef W).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5956
2006-06-06 21:39:09 +00:00
Julian Seward
2687531e76 More copyright updates.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5955
2006-06-05 23:27:18 +00:00
Julian Seward
ad67fd79fe Update copyright dates.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5954
2006-06-05 23:21:15 +00:00
Josef Weidendorfer
8cf72f1297 Bug reports should have the same destination as for other VG tools
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5943
2006-05-27 15:39:45 +00:00
Josef Weidendorfer
fb75a5cece 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
2006-05-27 15:30:58 +00:00
Julian Seward
00b4d31826 Various minor edits.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5929
2006-05-25 18:37:25 +00:00
Julian Seward
ce43a24158 Change ifdefs to select per-platform, not per-arch.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5918
2006-05-22 00:09:51 +00:00
Julian Seward
9611713b0e Fix crash on ppc64-linux.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5917
2006-05-22 00:05:11 +00:00
Julian Seward
efcd6e4f21 gcc 3.3.3 on ppc64-linux believes (perhaps correctly) that 'fd' can be
used when uninitialised.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5903
2006-05-15 19:27:56 +00:00
Josef Weidendorfer
e4417538ad Callgrind: Fix for callgrind_control
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5870
2006-05-01 01:38:32 +00:00
Josef Weidendorfer
4906b8a958 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
2006-05-01 00:55:54 +00:00
Josef Weidendorfer
b1eb513b99 Another fix for interactive control, together with
the --base option, which allows to specify another
directory for dumps and control/result files.
With "--base=/tmp/foo", we want control/result files
in "/tmp", and not in a directory "/tmp/foo/".


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5862
2006-04-21 01:02:13 +00:00
Josef Weidendorfer
bc616b8492 Fixes for interactive control:
- callgrind_control was not working, because it checks the
  "command syntax version" to be at most 1 before doing anything.
  But callgrind used Valgrinds version for this (3.2.0). Now we
  define a separate version COMMAND_VERSION for the syntax format
  of control and result files.
  Strictly, such a version is not needed for interaction of
  callgrind and the script callgrind_control itself, as they are
  delivered in the same package. But there are also external
  controlling tools (most notable KCachegrind)

- Some systems make it difficult for callgrind_control to
  automatically detect running callgrind processes. To make
  interactivity work, one has to provide the cwd with -w.
  For commands expecting a result from callgrind, this result
  was delivered in the wrong result file.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5861
2006-04-21 00:58:58 +00:00
Julian Seward
a7a4513e1e Include missing files in tarball (== unbreak from-tarball builds)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5837
2006-04-08 13:17:25 +00:00
Josef Weidendorfer
efa0f1d7bd 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
2006-04-02 22:23:27 +00:00
Julian Seward
6135031a89 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
2006-04-02 16:21:44 +00:00
Julian Seward
74657e1694 Fix ppc64-linux breakage - get the function entry address, not the
descriptor address.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5814
2006-04-02 15:53:59 +00:00
Josef Weidendorfer
0a0cfdcaa3 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
2006-03-31 19:34:51 +00:00
Josef Weidendorfer
61068ab73d Option --dump-every-bb now takes a 64bit value on user
request. Update/clarify documentation.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5806
2006-03-31 13:16:15 +00:00
Josef Weidendorfer
96887583d3 Fix typos
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5805
2006-03-31 12:53:22 +00:00
Nicholas Nethercote
7852ab7f22 Make the BSD-style license notices slightly more accurate.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5803
2006-03-31 12:05:04 +00:00
Josef Weidendorfer
1cdac21bd9 Callgrind merge: documentation
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5781
2006-03-20 10:29:30 +00:00
Josef Weidendorfer
a3b8d67b91 Callgrind merge: code
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5780
2006-03-20 10:27:30 +00:00