]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Core-tool iface changes needed to support exp-drd (Bart Van Assche).
authorJulian Seward <jseward@acm.org>
Sun, 25 Nov 2007 14:06:06 +0000 (14:06 +0000)
committerJulian Seward <jseward@acm.org>
Sun, 25 Nov 2007 14:06:06 +0000 (14:06 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7212

coregrind/m_syswrap/syswrap-linux.c
coregrind/m_tooliface.c
coregrind/pub_core_tooliface.h
include/pub_tool_tooliface.h

index f118434e57a5f71549f05cafead5597cc0d9c91c..e276fa5ae0c36e37a0bc6ae43c138802c99e5623 100644 (file)
@@ -78,6 +78,8 @@ static VgSchedReturnCode thread_wrapper(Word /*ThreadId*/ tidW)
       VG_(printf)("thread tid %d started: stack = %p\n",
                  tid, &tid);
 
+   VG_TRACK(pre_thread_first_insn, tid);
+
    tst->os_state.lwpid = VG_(gettid)();
    tst->os_state.threadgroup = VG_(getpid)();
 
index b7440caa9158e6e8a525bd6e414f326d89415a50..2aa74e9b07f2f0591ce858b065c1cf1e200fa78d 100644 (file)
@@ -335,6 +335,7 @@ DEF(track_start_client_code,     ThreadId, ULong)
 DEF(track_stop_client_code,      ThreadId, ULong)
 
 DEF(track_pre_thread_ll_create,  ThreadId, ThreadId)
+DEF(track_pre_thread_first_insn, ThreadId)
 DEF(track_pre_thread_ll_exit,    ThreadId)
 
 DEF(track_pre_deliver_signal,    ThreadId, Int sigNo, Bool)
index f6690fe4d279162aedecafaaa08d22e039be9c71..7f77fed57e82223a618050ec17eeb0bbd5d34d82 100644 (file)
@@ -209,6 +209,7 @@ typedef struct {
    void (*track_stop_client_code) (ThreadId, ULong);
 
    void (*track_pre_thread_ll_create)(ThreadId, ThreadId);
+   void (*track_pre_thread_first_insn)(ThreadId);
    void (*track_pre_thread_ll_exit)  (ThreadId);
 
    void (*track_pre_deliver_signal) (ThreadId, Int sigNo, Bool);
index 1f08521b37d1a0c23d35ecaf2aada4900b9cd5b7..cfc57d75432df24f611a502fa48738c4beda1a46 100644 (file)
@@ -588,9 +588,21 @@ void VG_(track_stop_client_code)(
    low-level thread create/quit event.  In general a few hundred
    instructions; hence a few hundred(ish) memory references could get
    misclassified each time.
+
+   pre_thread_first_insn: is called when the thread is all set up and
+   ready to go (stack in place, etc) but has not executed its first
+   instruction yet.  Gives threading tools a chance to ask questions
+   about the thread (eg, what is its initial client stack pointer)
+   that are not easily answered at pre_thread_ll_create time.
+
+   For a given thread, the call sequence is:
+      ll_create (in the parent's context)
+      first_insn (in the child's context)
+      ll_exit (in the child's context)
 */
-void VG_(track_pre_thread_ll_create)(void(*f)(ThreadId tid, ThreadId child));
-void VG_(track_pre_thread_ll_exit)  (void(*f)(ThreadId tid));
+void VG_(track_pre_thread_ll_create) (void(*f)(ThreadId tid, ThreadId child));
+void VG_(track_pre_thread_first_insn)(void(*f)(ThreadId tid));
+void VG_(track_pre_thread_ll_exit)   (void(*f)(ThreadId tid));
 
 
 /* Signal events (not exhaustive)