On Friday, March 23, 2012, Eliot Moss wrote: > On 3/23/2012 9:10 AM, Hamid Reza Khaleghzadeh wrote: > > Hi, > > > > I have some questions about Valgrind tool. I would be thankful if answer > > me. > > > > 1- I want to know does Valgrind support Pthread and openMP programs? > > 2- I need a tool that traces my multi-threaded program and creates > > memory trace of the program. The trace must contain accessed memory > > address, threadID and access type(Read/Write). > > > > Sorry to bother you with my questions. > > It does support multiple threads, but runs only one thread at a time. > I don't personally know the answer to the OpenMP question.
OpenMP programs run, sure. They are "just another" threaded app from V's point of view. > For a memory trace, you can take and extend the lackey tool > slightly to have it output the thread id in addition to the type > of reference, the address, and the number of bytes referenced. > That should be a straightforward change if you can find where > to get the thread id in valgrind. You can either call VG_(get_running_tid) all the time (slow), or ask the core to notify you of thread switches via VG_(track_start_client_code)( evh__start_client_code ); VG_(track_stop_client_code)( evh__stop_client_code ); (see hg_main.c) which is obviously much faster, but the downside is you have to believe what the core tells you, which I sometimes doubt :) J ------------------------------------------------------------------------------ This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure _______________________________________________ Valgrind-users mailing list Valgrind-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-users