Hi,

I'm not quite sure exactly what you want. I'd suggest that the best 
place to start is to look at the source for cputrack:
http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/cpc/common/cputrack.c

Which tracks a single process. And cpustat which reports events on all cpus:
http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/cpc/common/cpustat.c

You might also want to read this post about writing a profiler using the 
performance counters:
http://blogs.sun.com/partnertech/entry/process_or_forensics

Hope this helps,

Darryl.


Jin Yao wrote:
> Hello, 
> 
>     The libcpc provides one functions set to gather performance counter from 
> cpu performance registers. eg: cpc_bind_cpu, cpc_bind_curlwp, cpc_bind_pctx. 
> 
>     But it seems I can't use above functions to gather counter value for one 
> thread on one cpu.  
> 
>     cpc_bind_cpu provides the result of total threads on one specified cpu. 
>     cpc_bind_pctx provides the result of total cpus where the specified 
> thread runs on. 
> 
>     Who can give me some ideas about how to get performance value for one 
> thread on one cpu?
> 
> Thanks
> Jin Yao

-- 
Darryl Gove
Compiler Performance Engineering
Blog: http://blogs.sun.com/d/
Book: http://www.sun.com/books/catalog/solaris_app_programming.xml
_______________________________________________
perf-discuss mailing list
perf-discuss@opensolaris.org

Reply via email to