On Thu, Jul 16, 2009 at 6:55 AM, Ananth Narayan
S<[email protected]> wrote:
> Hi all,
> I wanted to understand how perfmon uses hardware performance counters.
> x86 has PERF_EVT_SEL-IA32_PMC programmable counters and the fixed
> IA32_FIXED_CTRs. I was assuming that perfmon uses only the
> programmable counters for counting events. The reason I have this
> question is that I have an application that reads the IA32_FIXED_CNTR
> MSRs to calculate the current processor frequency. (It is a Nehalem
> machine.) My app accesses the MSRs using /dev/cpu/*/msr.
>
> The moment I start pfmon, my application stalls. I suspect it is
> because pfmon overwrites the FIXED_CNTR MSRs when it starts. Is there
> a way we can force perfmon to use only the PERF_EVT_SEL MSRs?
>
I doubt you can do this because there is more than FIXED_CNTR_MSR involved
in controlling the fixed counters. There is also PERF_GLOBAL_CTRL. Perfmon
initializes than one as well. But you can try the following test:
- do not use UNHALTED_CORE_CYCLES, INSTRUCTION_RETIRED,
UNHALTED_REFERENCE_CYCLES events, instead use their generic
counters counterparts: CPU_CLK_UNHALTED:THREAD_P, INST_RETIRED:ANY_P.
Unfortunately UNHALTED_REFERENCE_CYCLES has no equivalent.
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
perfmon2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel