Will,

On Wed, Jan 31, 2007 at 02:02:08PM -0500, William Cohen wrote:
> Vivek Thakkar wrote:
> >
> >I have two openmp/posix threads and I want to get the PEBS traces for each
> >  thread (configured event is L1 load  miss). Is it possible with perfmon
> >? And if yes then what is the way to configure perfmon for this ?  I have
> >NPTL on my system. ( Only one process id for each thread as opposed to the
> >older
> >LinuxThreads where 1 pid = 1 thread id model was used)
> >Can we get different DS areas for each thread and thus different overflow
> >notifications ?
> >
> >Thanks And Regards,
> >Vivek Thakkar
> >MS, CSC deptt. NC State University
> >
> >Regards,
> >Vivek
> 
> This is the same problem that Jesse encountered when thinking about 
> restructuring his tool for his master's thesis. The tool currently has a 
> separate process watching the instrumented process, but he was considering 
> moving it to a thread to watch the other thread to eliminate the need for 
> shared memory between the processes. The problem was how to create the 
> context and read the data in that situation.
> 
> It seems that this situation of one thread monitoring other threads is 
> going to come up repeatedly. Another example application would be a JVM 
> that has a thread monitoring the other threads to determine which methods 
> need further optimization.
> 
> It seems like the logical thing would be to have the perfmon2 information 
> kept on a per thread basis like the processor registers.
> 
And this is exactly what it does today. Perfmon can see any kernel visible 
thread. 

The key is to understand that when you attach with pfm_load_context()
the load_pid argument of pfarg_load_t must actually be gettid() rather than
getpid(). Of course, for single-thread programs both are equivalent.

-- 
-Stephane
_______________________________________________
perfmon mailing list
[email protected]
http://www.hpl.hp.com/hosted/linux/mail-archives/perfmon/

Reply via email to