|
1 // timerlistboxdata.cpp |
|
2 // |
|
3 // Copyright (c) 2010 Accenture. All rights reserved. |
|
4 // This component and the accompanying materials are made available |
|
5 // under the terms of the "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 // Accenture - Initial contribution |
|
11 // |
|
12 #include "KernLbxModel.h" |
|
13 #include "Utils.h" |
|
14 #include <fshell/clogger.h> |
|
15 #include <fshell/memoryaccess.h> |
|
16 #include <fshell/qr3dll.h> |
|
17 #include "QResources3.hrh" |
|
18 |
|
19 CTimerListBoxData::CTimerListBoxData(CKernListBoxModel* aModel) |
|
20 : CKernListBoxData(aModel) |
|
21 { |
|
22 } |
|
23 |
|
24 void CTimerListBoxData::DoFormatL(TObjectKernelInfo* aInfo, RBuf& name, RBuf& more, TInt& /*itemId*/) |
|
25 { |
|
26 TTimerKernelInfo& info = *(TTimerKernelInfo*)aInfo; |
|
27 name.Copy(info.iFullName); |
|
28 PrettyName(iType, name); |
|
29 |
|
30 more.Format(_L("Client status=0x%08x"), info.iClientStatus); |
|
31 } |
|
32 |
|
33 void CTimerListBoxData::DumpToCloggerL(RClogger& clogger, TInt i, TInt /*count*/) |
|
34 { |
|
35 TTimerKernelInfo& info = *(TTimerKernelInfo*)iInfo; |
|
36 _LIT8(KDesc,"Timer;KernObjAddr;FullName;AccessCount;State;Type;TReqStat"); |
|
37 _LIT8(KFmt, "Timer;%x;%S;%d;%d;%d;%x"); |
|
38 |
|
39 if (i == 0) clogger.Log(KDesc); |
|
40 clogger.Log(KFmt, info.iAddressOfKernelObject, &info.iFullName, info.iAccessCount, info.iState, info.iType, info.iClientStatus); |
|
41 } |
|
42 |
|
43 #define CASE_LIT2(val, name) case val: { _LIT(KName, #name); return KName; } |
|
44 |
|
45 const TDesC& Type(TUint8 aType) |
|
46 { |
|
47 switch (aType) |
|
48 { |
|
49 CASE_LIT2(1, ERelative); |
|
50 CASE_LIT2(2, EAbsolute); |
|
51 CASE_LIT2(4, ELocked); |
|
52 CASE_LIT2(8, EHighRes); |
|
53 CASE_LIT2(16, EInactivity); |
|
54 default: |
|
55 _LIT(KHuh, "?"); |
|
56 return KHuh; |
|
57 } |
|
58 } |
|
59 |
|
60 const TDesC& State(TUint8 aState) |
|
61 { |
|
62 switch (aState) |
|
63 { |
|
64 CASE_LIT2(0, EIdle); |
|
65 CASE_LIT2(1, EWaiting); |
|
66 CASE_LIT2(2, EWaitHighRes); |
|
67 default: |
|
68 _LIT(KHuh, "?"); |
|
69 return KHuh; |
|
70 } |
|
71 } |
|
72 |
|
73 void CTimerListBoxData::DoInfoForDialogL(RBuf& aTitle, RBuf& inf, TDes* /*aTemp*/) |
|
74 { |
|
75 TTimerKernelInfo& info = *(TTimerKernelInfo*)iInfo; |
|
76 _LIT(KInfo, "Timer info"); |
|
77 aTitle.Copy(KInfo); |
|
78 |
|
79 inf.Copy(iInfo->iFullName); |
|
80 inf.Append(Klflf); |
|
81 |
|
82 inf.AppendFormat(_L("Kernel object address: 0x%08x\n"), info.iAddressOfKernelObject); |
|
83 inf.AppendFormat(_L("Access count: %u\n"), info.iAccessCount); |
|
84 const TDesC& type = Type(info.iType); |
|
85 inf.AppendFormat(_L("Type: %d (%S)\n"), info.iType, &type); |
|
86 const TDesC& state = State(info.iState); |
|
87 inf.AppendFormat(_L("State: %d (%S)\n"), info.iState, &state); |
|
88 inf.AppendFormat(_L("TRequestStatus: 0x%08x"), info.iClientStatus); |
|
89 } |