Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I need to learn how performance counter works for my research project. I have understood how hardware supports the monitoring of events.Intel manual gives description on how the performance monitoring units on the chip helps to get the counters. I also have learned how the MSR module gets the information of the msr registers for various events.

I need to learn the following things.

1) How performance monitoring tools are used for multiple processes simultaneously. I think all the registers will be saved during context switch and are loaded when the process start again.Browsing Internet I got something like "pfm_context_load" and "pfm_context_unload" but it didn't had much info......-> " I need more detailed information on how it works,so please provide some links,documentation which can help me achieve my understanding"

2) Also how performance counters work in virtual environment? And what are the problems measuring the counters in such environment? I have browsed through few papers and have some info, But need more detail information.

So if anyone can guide me with some documentation on these topics or at least guide me on where should I search for all these info with be a great help! ...

If this is not the right forum then please direct me towards right place..

Thanks

Anup

share|improve this question
add comment

1 Answer

Install the perf tools using:

sudo apt-get install linux-tools

You can then run perf on an executable using using the appropriate event using the -e flag, for example to measure CPU cycles on the ps command use:

perf stat -e cycles ps

To see which events are available use:

perf list

..some are software events and some are hardware events like the ones you were referring to.

There is some excellent documentation at: https://perf.wiki.kernel.org/index.php/Tutorial

Hope that helps!

share|improve this answer
    
@King: I guess perf is not the answer to the question what Anup has asked as I am also looking for the answer of the same. The question is more on the basics of how it is implemented. Also you cannot use perf in scenarios where every single branch will effect you as the results of perf are not precise. –  Jatin Kumar Mar 30 '13 at 14:37
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.