sl@0: // Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #include "analyse.h" sl@0: #include "output.h" sl@0: #include "trace.h" sl@0: sl@0: #ifdef __MSVCDOTNET__ sl@0: #include sl@0: #include sl@0: #else //!__MSVCDOTNET__ sl@0: #include sl@0: #include sl@0: #endif //__MSVCDOTNET__ sl@0: sl@0: ostream& operator<<(ostream& aStream, const Result& aSample) sl@0: { sl@0: if (!Analyse::Option(Analyse::EZeros) && aSample.iSamples == 0) sl@0: { sl@0: if (Analyse::Format() != Analyse::EExcel) sl@0: aStream << " "; sl@0: } sl@0: else sl@0: { sl@0: switch (Analyse::Format()) sl@0: { sl@0: case Analyse::ESamples: sl@0: aStream << setw(7) << aSample.iSamples; sl@0: break; sl@0: case Analyse::EPercent: sl@0: { sl@0: double sample = double(aSample.iSamples * 100) / double(aSample.iTotal); sl@0: aStream << setprecision(2) << setw(6) << setfill(' ') << sample << '%'; sl@0: } sl@0: break; sl@0: case Analyse::EExcel: sl@0: { sl@0: double sample = double(aSample.iSamples) / double(aSample.iTotal); sl@0: aStream << setprecision(5) << sample; sl@0: } sl@0: break; sl@0: } sl@0: } sl@0: return aStream; sl@0: } sl@0: sl@0: ostream& operator<<(ostream& aStream, const Thread& aThread) sl@0: { sl@0: return aStream << aThread.iProcess->iName << "::" << aThread.iName; sl@0: }