OSSetPerformanceMonitor

Syntax

#include <cafe/os.h>

#define PM_MASK_MMCR0 (1 << 0)
#define PM_MASK_MMCR1 (1 << 1)
#define PM_MASK_PMC1  (1 << 2)
#define PM_MASK_PMC2  (1 << 3)
#define PM_MASK_PMC3  (1 << 4)
#define PM_MASK_PMC4  (1 << 5)
#define PM_MASK_CONTROL (PM_MASK_MMCR0 | PM_MASK_MMCR1)
#define PM_MASK_COUNTER (PM_MASK_PMC1 | PM_MASK_PMC2 | PM_MASK_PMC3 | PM_MASK_PMC4)
#define PM_MASK_ALL ( PM_MASK_MMCR0 | PM_MASK_MMCR1 | PM_MASK_PMC1 | PM_MASK_PMC2 | PM_MASK_PMC3 | PM_MASK_PMC4)    
  
void OSSetPerformanceMonitor(u32 pm_mask, u32 mmcr0, u32 mmcr1, u32 pmc1,
                             u32 pmc2, u32 pmc3, u32 pmc4);

Parameters

pm_mask Mask used to control what performance monitor registers are set.
mmcr0 Value for Monitor Mode Control Register 0.
mmcr1 Value for Monitor Mode Control Register 1.
pmc1 Value for Performance Monitor Counter Register 1.
pmc2 Value for Performance Monitor Counter Register 2.
pmc3 Value for Performance Monitor Counter Register 3.
pmc4 Value for Performance Monitor Counter Register 4.

Return Values

None.

Description

OSSetPerformanceMonitor allows one to set the supervisor-level performance monitor registers from an user-level application. The pm_mask arg is used to only set the register values which are valid in the call.

The performance monitor registers can be read from user-space by using the defined user-level performance monitor registers (ummcr0, ummcr1, upmc1, upmc2, upmc3, upmc4).

For more information about the performance monitor definitions and operation, refer to the Espresso user manual.

Do Not Call From

None.

See Also

PMGetCycleCount
PMGetInstructionCount
PMResetCycleAndInstructionCount
PMStartCycleAndInstructionCount
PMStopCycleAndInstructionCount

Revision History

2013/05/08 Automated cleanup pass.
2012/07/24 ENINT is no longer automatically masked off.
2011/03/15 Initial version.


CONFIDENTIAL