os/kernelhwsrv/kernel/eka/drivers/debug/rmdebug/d_debug_agent.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kernel/eka/drivers/debug/rmdebug/d_debug_agent.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,72 @@
     1.4 +// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// Purpose: Kernel-side tracking of debug agent information associated
    1.18 +// with each process being debugged.
    1.19 +// 
    1.20 +//
    1.21 +
    1.22 +#ifndef D_DEBUG_AGENT_H
    1.23 +#define D_DEBUG_AGENT_H
    1.24 +
    1.25 +#include <rm_debug_api.h>
    1.26 +#include "d_driver_event_info.h"
    1.27 +
    1.28 +class DDebugAgent : public DBase
    1.29 +{
    1.30 +public:
    1.31 +	static DDebugAgent* New(TUint64);
    1.32 +	~DDebugAgent();
    1.33 +
    1.34 +	TInt SetEventAction(Debug::TEventType aEvent, Debug::TKernelEventAction aEventAction);
    1.35 +	void GetEvent(TClientDataRequest<Debug::TEventInfo>* aAsyncGetValueRequest, Debug::TEventInfo* aEventInfo, DThread* aClientThread);
    1.36 +	TInt EventAction(Debug::TEventType aEvent);
    1.37 +
    1.38 +	TInt CancelGetEvent(void);
    1.39 +	void NotifyEvent(const TDriverEventInfo& aEventInfo);
    1.40 +	TUint64 Id();
    1.41 +
    1.42 +protected:
    1.43 +	DDebugAgent(TUint64 aId);
    1.44 +	TInt Construct();
    1.45 +
    1.46 +private:
    1.47 +	void QueueEvent(TDriverEventInfo& aEventInfo);
    1.48 +	TBool BufferEmpty() const;
    1.49 +	TBool BufferFull() const;
    1.50 +	TBool BufferCanStoreEvent() const;
    1.51 +	TBool BufferAtCriticalLevel() const;
    1.52 +	void IncrementPosition(TInt& aPosition);
    1.53 +	TInt NumberOfEmptySlots() const;
    1.54 +
    1.55 +private:
    1.56 +	TUint64	iId;
    1.57 +	Debug::TKernelEventAction iEventActions[Debug::EEventsLast];
    1.58 +
    1.59 +	//iEventInfo is a pointer to an object owned by the security server, so
    1.60 +	//no clean up needs be performed on it
    1.61 +	Debug::TEventInfo* iEventInfo;
    1.62 +	RArray<TDriverEventInfo> iEventQueue;	// ring buffer.
    1.63 +	TClientDataRequest<Debug::TEventInfo>* iRequestGetEventStatus;
    1.64 +	DThread* iClientThread;
    1.65 +
    1.66 +	// Ring buffer data
    1.67 +	TInt iHead;	// points to the next empty slot in iEventQueue (exc. when iFull == ETrue)
    1.68 +	TInt iTail; // points to the oldest full slot in iEventQueue (exc. when iEmpty == ETrue)
    1.69 +	
    1.70 +	//if we have told the agent that we are ignoring trace events
    1.71 +	TBool iIgnoringTrace;
    1.72 +};
    1.73 +
    1.74 +#endif // D_DEBUG_AGENT_H
    1.75 +