|
From: Tomislav J. <tom...@my...> - 2012-12-19 20:02:07
|
Hi all,
Is there a mechanism built into Valgrind to detect when a context
switch happens?
Thanks,
Tommy
--
Tomislav Janjusic [tja...@un...]
Computer Systems Research Laboratory
University of North Texas
Denton, Texas
|
|
From: Julian S. <js...@ac...> - 2012-12-28 10:49:33
|
On Wednesday, December 19, 2012, Tomislav Janjusic wrote: > Hi all, > Is there a mechanism built into Valgrind to detect when a context > switch happens? Yes. You need to write (and register, at startup, with coregrind), a pair of functions like evh__start_client_code and evh__stop_client_code in hg_main.c. Then, the core will notify you of starting and stopping of each thread, so you can figure out when the running thread changes. At least, assuming the core's notification mechanism does this correctly :) J |