70 Commits

Author SHA1 Message Date
Josef Weidendorfer
6d6cf7acee Fix typo found by Bart
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8325
2008-07-01 09:35:21 +00:00
Julian Seward
14af4957fc Merge in the DATASYMS branch.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7540
2008-03-03 01:35:41 +00:00
Julian Seward
5679a22410 Update copyright dates ("200X-2007" --> "200X-2008").
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7398
2008-02-11 11:34:59 +00:00
Josef Weidendorfer
094c96388c Update old (and wrong) parts of callgrind documentation.
This obviously was already wrong in 3.2.x :-(

* Old --fn-recursion=... / --fn-caller=... options are called
  --separate-recs=... / --separate-callers=... since quite some
  time for consistency with e.g. --separate-threads=yes.
  Error noted from bug 153335.
* Function specifications support wildcards since quite some time;
  specification of a prefix only does not work, but the full
  function has to match. This was needed to allow to specify 'foo'
  without also specifying 'foo1'.
* The script 'callgrind' does not exist since merging into
  valgrind.
* Rename callgrind from being a 'heavyweight' to a 'call graph'
  profiler, similar to the description in the quick start overview.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7272
2007-12-04 10:09:24 +00:00
Josef Weidendorfer
1752567fb4 callgrind: support for --callgrind-out-file
This removes the --base option, which is replaced by
--callgrind-out-file.
Plus manual update.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7235
2007-11-27 01:27:12 +00:00
Julian Seward
5e2a8da202 Spelling fixes and misc tidying for the manual. (Brian Gough)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7173
2007-11-17 09:43:25 +00:00
Julian Seward
9bf9f81786 Avoid hundreds of warnings from -Winline on gcc-4.3:
In dump.c, gcc complains that 'param max-stack-frame-growth' would be
exceeded, so remove 'inline' spec.

All other warnings are of the form 'call is unlikely and code size
would grow'.  These aren't interesting.  Remove -Winline.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7164
2007-11-16 12:31:27 +00:00
Julian Seward
5e290312a0 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
2007-11-09 23:06:35 +00:00
Nicholas Nethercote
7cb817e078 Fix various format string errors, courtesy of Florian Krohm.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6902
2007-09-23 00:51:24 +00:00
Josef Weidendorfer
ef6f20cad4 callgrind_control: Fix behavior with callgrind runs of another user
callgrind_control uses files /tmp/callgrind.info.* to be able to
locate running callgrind processes. These files can be read only by
the user which started callgrind. The callgrind_control script
did not check for "permission denied" on opening these files, which
resulted in some unexpected errors. Now, it is checked whether
the "open" was successful, and if not, we skip the according callgrind
process.

Fixes bug 149963.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6861
2007-09-18 19:12:57 +00:00
Josef Weidendorfer
9959083616 callgrind: Use directory in debug info when available
Prepend the file name of a source file with the directory
if that is available. This not only gets rid of problems with the
same file name used in different paths of a project, but lets
the annotation work out of the box without having to specify any
source directory.
Works both with callgrind_annotate and KCachegrind without any
changes there.

Inspired by Nick's change to cachegrind doing the same thing
in r6839 (and gets rid of a FIXME in the source)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6850
2007-09-17 12:52:10 +00:00
Josef Weidendorfer
21ca947f50 callgrind: fix example description and clarification of callgrind format
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6790
2007-08-28 21:52:45 +00:00
Julian Seward
32a6fb4fec Get rid of VG_(getcwd) and replace it with a pair of functions,
VG_(record_startup_wd) which records the working directory at startup,
and VG_(get_startup_wd) which later tells you what value was recorded.
This works because all uses of VG_(getcwd) serve only to record the
directory at process start anyway.  The motivation is that AIX does
not support sys_getcwd directly, so it's easier for the launcher to
ship in the required value using an environment variable.  On Linux
sys_getcwd is used as before.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6764
2007-07-09 23:13:07 +00:00
Josef Weidendorfer
2cf8b61901 callgrind: fix build with srcdir != builddir
Thanks to Diego 'Flameeyes' Pettenò for noting and providing the patch



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6751
2007-06-02 21:36:26 +00:00
Josef Weidendorfer
af3e00ab6f callgrind_annotate: Fix a warning
Port a fix for ""Possible precedence problem" from
cachegrind/cg_annotate, see r1713.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6749
2007-05-24 20:47:10 +00:00
Josef Weidendorfer
a09042a627 Callgrind manual: Fix typo
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6748
2007-05-24 20:42:41 +00:00
Josef Weidendorfer
833c095f5c Callgrind manual: rewriting start of section about avoding cycles
This hopefully makes the whole issue with cycles easier to understand.
And no, this does not get rid of the description of cycles, carefully
crafted by Julian ;-)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6747
2007-05-24 19:24:23 +00:00
Josef Weidendorfer
6575e93f46 Callgrind format: Note about event names in the example
The added paragraph was triggered by a question on the mailing list.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6746
2007-05-24 18:04:42 +00:00
Julian Seward
b91b51b42b Merge (from 3.2 branch) r6743 (Edit the manual to bring it up to date
and make some of the wording a bit more professional sounding.)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6745
2007-05-23 21:58:33 +00:00
Josef Weidendorfer
db1e230c31 Callgrind: improve documentation
* Looks a little bit more like the Cachegrind manual
  (at least in front)
* Removed the out-of-place general section about profiling
  and gprof. Perhaps something like this can be put at
  another place
* Notes about Callgrinds problems with call tracing on PPC
* Include usage of callgrind_annotate, and note its lack of
  cycle detection


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6734
2007-05-08 11:58:23 +00:00
Nicholas Nethercote
802b418634 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
2007-04-15 22:15:57 +00:00
Julian Seward
de95f78978 Add assertion + comment to a loop using VG_(getcwd).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6663
2007-03-26 15:23:20 +00:00
Josef Weidendorfer
e06ac31db4 Callgrind: Fix potential buffer overruns with user provided strings
This introduces some macros to shorten the code for output of
strings to a file descriptor. I could use this a lot,
but this commit limits itself to the potential buffer overruns
(to ease backporting - provided we want to do this)

Heavy use of the macros probably blows up the code. Perhaps
it would be better to provide e.g. a VG_(write_str3) function
in the tool API.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6618
2007-02-26 00:16:09 +00:00
Julian Seward
b7302d9258 Get rid of the type XArrayStrings in m_clientstate and use new generic
equivalents in module m_xarray instead.  A suprisingly pervasive
change.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6616
2007-02-25 15:08:24 +00:00
Josef Weidendorfer
b7dea1c39d Callgrind: Fix threads display of "callgrind_control -s"
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6601
2007-02-16 21:55:25 +00:00
Josef Weidendorfer
ef2d36cdfd callgrind: fix --collect-systime=yes with "no instrumentation" mode
(see bug 139363)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6593
2007-02-16 13:12:43 +00:00
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