diff -r 2d65c2f76d7b -r 947f0dc9f7a8 kerneltest/e32test/misc/cpumeter.cpp --- a/kerneltest/e32test/misc/cpumeter.cpp Tue Feb 02 01:24:03 2010 +0200 +++ b/kerneltest/e32test/misc/cpumeter.cpp Fri Apr 16 16:24:37 2010 +0300 @@ -48,6 +48,8 @@ TInt Construct(); void Measure(); void Display(TInt aInterval); + void DisplayCoreControlInfo(); + void ChangeNumberOfCores(TInt aNum); public: TInt iNumCpus; TInt iNextMeas; @@ -152,6 +154,38 @@ test.Printf(buf); } +void CCpuMeter::DisplayCoreControlInfo() + { + SCpuStates s; + TInt r = UserSvr::HalFunction(EHalGroupKernel, EKernelHalCpuStates, &s, 0); + if (r != KErrNone) + { + test.Printf(_L("Error %d\n"), r); + return; + } + test.SetLogged(ETrue); + test.Printf(_L(" TA=%08x IA=%08x CU=%08x GD=%08x DC=%08x\n"), s.iTA, s.iIA, s.iCU, s.iGD, s.iDC); + test.Printf(_L(" SC=%08x RC=%08x PO=%02x CCS=%08x PODC=%08x\n"), s.iSC, s.iRC, s.iPO, s.iCCS, s.iPODC); + TInt i; + for (i=0; i%d\n"), aNum); + TInt r = UserSvr::HalFunction(EHalGroupKernel, EKernelHalSetNumberOfCpus, (TAny*)aNum, 0); + if (r != KErrNone) + { + test.Printf(_L("Error %d\n"), r); + } + test.SetLogged(EFalse); + } + void UseKernelCpuTime() { test.Start(_L("Create CCpuMeter")); @@ -175,6 +209,14 @@ delete m; return; } + if (m->iNumCpus > 1) + { + // SMP only options + if (k == EKeySpace) + m->DisplayCoreControlInfo(); + else if (k>='1' && k<=('0'+m->iNumCpus)) + m->ChangeNumberOfCores(k - '0'); + } console->Read(s); } }