20
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: Event based ITT sampler skeleton copypasted from MemoryEventHandler.h
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
#include "IttSamplerImpl.h"
|
|
18 |
|
|
19 |
#ifndef __PI_ITT_EVENT_HANDLER__
|
|
20 |
#define __PI_ITT_EVENT_HANDLER__
|
|
21 |
|
|
22 |
#include <piprofiler/ProfilerGenericClassesKrn.h>
|
|
23 |
|
|
24 |
// CONSTANTS
|
|
25 |
const TInt KITTBufferSize = 256;
|
|
26 |
|
|
27 |
class DProfilerSampleBuffer;
|
|
28 |
|
|
29 |
/*
|
|
30 |
* ITT event handler for listaning kernel events
|
|
31 |
*/
|
|
32 |
class DIttEventHandler : public DKernelEventHandler
|
|
33 |
{
|
|
34 |
public:
|
|
35 |
// constructor
|
|
36 |
DIttEventHandler(DProfilerSampleBuffer* aSampleBuffer, TProfilerGppSamplerData* aGppSamplerDataIn);
|
|
37 |
TInt Create();
|
|
38 |
~DIttEventHandler();
|
|
39 |
TInt Start();
|
|
40 |
TInt Stop();
|
|
41 |
TBool Tracking() {return iTracking;}
|
|
42 |
|
|
43 |
TBool SampleNeeded();
|
62
|
44 |
void SampleHandled();
|
20
|
45 |
|
|
46 |
private:
|
|
47 |
static TUint EventHandler(TKernelEvent aEvent, TAny* a1, TAny* a2, TAny* aThis);
|
|
48 |
TUint HandleEvent(TKernelEvent aType, TAny* a1, TAny* a2);
|
|
49 |
// handle code segments
|
|
50 |
TBool HandleAddCodeSeg(DCodeSeg* aSeg);
|
|
51 |
TBool HandleRemoveCodeSeg(DCodeSeg* aSeg);
|
|
52 |
|
|
53 |
private:
|
|
54 |
/** Lock serialising calls to event handler */
|
|
55 |
DMutex* iLock;
|
|
56 |
TBool iTracking;
|
|
57 |
DProfilerSampleBuffer* iSampleBuffer;
|
|
58 |
|
62
|
59 |
//TUint32 iCount;
|
|
60 |
//TUint32 iPreviousCount;
|
20
|
61 |
TUint8 iSample[KITTBufferSize];
|
|
62 |
TPtr8 iSampleDescriptor;
|
|
63 |
TProfilerGppSamplerData* gppSamplerData;
|
62
|
64 |
TBool iSampleAvailable;
|
20
|
65 |
};
|
|
66 |
|
|
67 |
#endif //__PI_ITT_EVENT_HANDLER__
|