|
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #include <iostream> |
|
17 #include <iomanip> |
|
18 |
|
19 #include "logevents\kernelmemoryevent.h" |
|
20 #include "e32btrace.h" |
|
21 |
|
22 CKernelMemoryEvent::CKernelMemoryEvent(const CUTraceFrame& aFrame, MEventOutputHandler& aOutputHandler) |
|
23 : CTraceEventBase(aFrame, aOutputHandler) |
|
24 { |
|
25 SetPrefix("EKernelMemory"); |
|
26 } |
|
27 |
|
28 CKernelMemoryEvent::CKernelMemoryEvent(const CMultiPartFrameCollection& aFrameCollection, MEventOutputHandler& aOutputHandler) |
|
29 : CTraceEventBase(aFrameCollection, aOutputHandler) |
|
30 { |
|
31 SetPrefix("EKernelMemory"); |
|
32 } |
|
33 |
|
34 void CKernelMemoryEvent::Describe(std::ostream& aOutput) const |
|
35 { |
|
36 int subcat = SubCategory(); |
|
37 |
|
38 switch (subcat) |
|
39 { |
|
40 case BTrace::EKernelMemoryInitialFree: |
|
41 aOutput << std::noshowbase << std::nouppercase << std::hex |
|
42 << "Kernel Memory Initial Free: [Size=0x" << std::setw(8) << std::setfill('0') << Arg1() |
|
43 << "] "; |
|
44 break; |
|
45 |
|
46 case BTrace::EKernelMemoryCurrentFree: |
|
47 aOutput << std::noshowbase << std::nouppercase << std::hex |
|
48 << "Kernel Memory Current Free: [Size=0x" << std::setw(8) << std::setfill('0') << Arg1() |
|
49 << "] "; |
|
50 break; |
|
51 |
|
52 case BTrace::EKernelMemoryMiscAlloc: |
|
53 aOutput << std::noshowbase << std::nouppercase << std::hex |
|
54 << "Kernel Memory Misc Alloc: [Size=0x" << std::setw(8) << std::setfill('0') << Arg1() |
|
55 << "] "; |
|
56 break; |
|
57 |
|
58 case BTrace::EKernelMemoryMiscFree: |
|
59 aOutput << std::noshowbase << std::nouppercase << std::hex |
|
60 << "Kernel Memory Misc Free: [Size=0x" << std::setw(8) << std::setfill('0') << Arg1() |
|
61 << "] "; |
|
62 break; |
|
63 |
|
64 case BTrace::EKernelMemoryDemandPagingCache: |
|
65 aOutput << std::noshowbase << std::nouppercase << std::hex |
|
66 << "Kernel Memory Demand Paging Cache: [MinSize=0x" << std::setw(8) << std::setfill('0') << Arg1() |
|
67 << "] "; |
|
68 break; |
|
69 |
|
70 case BTrace::EKernelMemoryDrvPhysAlloc: |
|
71 // NB: The prime function logs a EKernelMemoryDrvPhysAlloc record where the physical |
|
72 // address is -1 and should be ignored. |
|
73 if ((int)BytesToInt(Data()) != -1) |
|
74 { |
|
75 aOutput << std::noshowbase << std::nouppercase << std::hex |
|
76 << "Kernel Memory Driver Physical Alloc: [Size=0x" << std::setw(8) << std::setfill('0') << Arg1() |
|
77 << "] [PhysicalBase=0x" << std::setw(8) << std::setfill('0') << BytesToInt(Data()) |
|
78 << "] "; |
|
79 } |
|
80 break; |
|
81 |
|
82 case BTrace::EKernelMemoryDrvPhysFree: |
|
83 aOutput << std::noshowbase << std::nouppercase << std::hex |
|
84 << "Kernel Memory Driver Physical Free: [Size=0x" << std::setw(8) << std::setfill('0') << Arg1() |
|
85 << "] [PhysicalBase=0x" << std::setw(8) << std::setfill('0') << BytesToInt(Data()) |
|
86 << "] "; |
|
87 break; |
|
88 |
|
89 default: |
|
90 aOutput << "Unknown Event "; |
|
91 break; |
|
92 } |
|
93 } |
|
94 |