sl@0: // Copyright (c) 2008-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: // e32\include\kernel\scmonitor.h sl@0: // Kernel System crash monitor header file sl@0: // sl@0: // WARNING: This file contains some APIs which are internal and are subject sl@0: // to change without notice. Such APIs should therefore not be used sl@0: // outside the Kernel and Hardware Services package. sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @internalComponent sl@0: */ sl@0: sl@0: #ifndef __SCMONITOR_H__ sl@0: #define __SCMONITOR_H__ sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: using namespace Debug; sl@0: sl@0: class CrashFlash; sl@0: sl@0: const TInt KFlashAlignment = sizeof(TInt32); sl@0: sl@0: const TInt KFlashEraseAttempts = 10; sl@0: /** sl@0: * System crash monitor responsible for writing crash data to flash in sl@0: * the event of a crash sl@0: */ sl@0: class SCMonitor: public Monitor sl@0: { sl@0: public: sl@0: SCMonitor(); sl@0: ~SCMonitor(); sl@0: sl@0: virtual void Print(const TDesC8& aDes); sl@0: virtual TInt Init2(TAny* aCategory, TInt aReason); sl@0: sl@0: void VariantInit(); sl@0: TInt InitFlash(); sl@0: sl@0: void StableConstruction(); sl@0: sl@0: public: sl@0: CrashFlash* iFlash; sl@0: sl@0: protected: sl@0: void DumpVariantSpecific(); sl@0: sl@0: enum TSysCrashLogState sl@0: { sl@0: EUndefined = 0 sl@0: }; sl@0: sl@0: sl@0: private: sl@0: TInt ProcessCrash(const SCMCrashBlockEntry& aBlockEntry, const TUint aCrashId, TBool aCommit); sl@0: TInt LogProcessMetaData(SCMDataSave::TDumpScope aDumpScope, TUint& aSizeDumped) const; sl@0: TInt LogThreadMetaData(SCMDataSave::TDumpScope aDumpScope, TUint& aSizeDumped) const; sl@0: TInt LogObjectContainers(TObjectType aObjectType, SCMDataSave::TDumpScope aDumpScope, const SCMDataSave::TDataToDump& aDataToDump, TUint& aSizeDumped) const; sl@0: TInt GetNextCrashStartPoint(SCMCrashBlockEntry& aBlockEntry); sl@0: void DoCrash(TAny* aCategory, TInt aReason); sl@0: sl@0: private: sl@0: TInt HelpDumpStacks(DObject* aObject, TObjectType aObjectType, TUint& aSizeDumped, SCMDataSave::TStackType aStkType) const; sl@0: TInt HelpDumpMetaData(DObject* aObject, TObjectType aObjectType, TUint& aSizeDumped) const; sl@0: TInt EraseFlashBlock(const SCMCrashBlockEntry& aBlock); sl@0: TInt EraseEntireFlashPartition(); sl@0: sl@0: private: sl@0: SCMDataSave* iDataSave; sl@0: Debug::SCMConfiguration* iScmConfig; sl@0: SCMMultiCrashInfo* iMultiCrashInfo; sl@0: }; sl@0: sl@0: sl@0: sl@0: #endif //__SCMONITOR_H__ sl@0: //EOF scmonitor.h