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
5 files changed