|
From: Josef W. <Jos...@gm...> - 2005-07-27 21:55:12
|
On Wednesday 27 July 2005 21:30, Nicholas Nethercote wrote:
> On Wed, 27 Jul 2005, Josef Weidendorfer wrote:
> >>> Some sort of thread modelling should hopefully come back...
> >>>
> >>> We could just put VG_TRACK( thread_run, tid ) into the scheduler
> >>> for now, where it currently calls VG_(tm_thread_switchto).
> >>
> >> That sounds like a good solution.
> >
> > See the other mail. Shouldn't thread_run be called on any thread switch?
>
> I don't understand the issues here. Josef, perhaps it would be best if
> you just write a patch for m_scheduler.c containing the code that you
> want?
VG_(set_running)(ThreadId tid) is called from 2 places in scheduler.c:
(1) from VG_(vg_yield)(void)
(2) from VG_(scheduler) ( ThreadId tid )
Tom suggested to insert VG_TRACK( thread_run, tid ) into VG_(scheduler),
directly after the call to VG_(set_running). Unfortunately, this way a tool
misses thread switches triggered by VG_(vg_yield). So my suggestion is the
following:
--- scheduler.c.orig 2005-07-27 23:36:08.000000000 +0200
+++ scheduler.c 2005-07-27 15:47:26.000000000 +0200
@@ -203,6 +203,8 @@ void VG_(set_running)(ThreadId tid)
if (VG_(clo_trace_sched))
print_sched_event(tid, "now running");
+
+ VG_TRACK( thread_run, tid );
}
If we reestablish m_threadmodel.c, VG_(tm_thread_switchto) should be called
from VG_(set_running) to get both switch cases, and not only from
VG_(scheduler).
Regarding your question for VG 2.4: Yes, I have the problem there that my tool
is not reliable notified about all thread switched via thread_run.
Josef
>
> N
>
>
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
> Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
> _______________________________________________
> Valgrind-developers mailing list
> Val...@li...
> https://lists.sourceforge.net/lists/listinfo/valgrind-developers
|