|
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 #ifndef UTRACEFRAME_H |
|
17 #define UTRACEFRAME_H |
|
18 |
|
19 #include <vector> |
|
20 |
|
21 #include "e32btrace.h" |
|
22 #include "logevents\traceevent.h" |
|
23 |
|
24 class CUTraceFrame : public MTraceEvent |
|
25 { |
|
26 public: |
|
27 explicit CUTraceFrame(const unsigned char* aFrameData, unsigned int aEntryNumber); |
|
28 virtual ~CUTraceFrame(); |
|
29 |
|
30 void DumpFrame(std::ostream& aStream) const; |
|
31 void DumpFrame(std::string& aOutput) const; |
|
32 |
|
33 // Length of this btrace frame |
|
34 virtual unsigned int FrameLength() const; |
|
35 |
|
36 // Flags from the frame header |
|
37 virtual unsigned int Flags() const; |
|
38 |
|
39 // Primary filter (Category) of the frame |
|
40 virtual unsigned int PrimaryFilter() const; |
|
41 |
|
42 // Secondary filter of the frame |
|
43 virtual unsigned int SecondaryFilter() const; |
|
44 |
|
45 // Subcategory of the frame (meaning dependant on the Category) |
|
46 virtual unsigned int SubCategory() const; |
|
47 |
|
48 // Flag accessors |
|
49 virtual bool Header2Present() const; |
|
50 virtual bool Timestamp1Present() const; |
|
51 virtual bool Timestamp2Present() const; |
|
52 virtual bool ContextIdPresent() const; |
|
53 virtual bool PcPresent() const; |
|
54 virtual bool ExtraPresent() const; |
|
55 virtual bool RecordTruncated() const; |
|
56 virtual bool MissingRecord() const; |
|
57 |
|
58 // These return values from the header if they are present |
|
59 virtual unsigned int Header2() const; |
|
60 virtual unsigned int Timestamp1() const; |
|
61 virtual unsigned int Timestamp2() const; |
|
62 virtual unsigned int ContextType() const; |
|
63 virtual unsigned int ContextId() const; |
|
64 virtual unsigned int ProgramCounter() const; |
|
65 virtual unsigned int Extra() const; |
|
66 virtual unsigned int Truncated() const; |
|
67 virtual unsigned int Missing() const; |
|
68 |
|
69 virtual unsigned int Arg1() const; |
|
70 virtual unsigned char* Data() const; |
|
71 virtual unsigned int DataLength() const; |
|
72 |
|
73 virtual unsigned int EventEntryNumber() const; |
|
74 |
|
75 unsigned int DataFullLength() const; |
|
76 |
|
77 // MultiPart log methods |
|
78 // MultiPartSequenceNumber() will assert if it the frame is not a multipart |
|
79 BTrace::TMultiPart MultiPartType() const; |
|
80 unsigned int MultiPartSequenceNumber() const; |
|
81 inline bool IsMultiPart() const |
|
82 { |
|
83 return MultiPartType() != BTrace::ENotMultiPart; |
|
84 } |
|
85 |
|
86 |
|
87 private: |
|
88 unsigned int CalculateEntryOffset(unsigned char aEntry) const; |
|
89 void SetFrameBuffer(const unsigned char *aData); |
|
90 void DumpFlags(std::ostream& aStream) const; |
|
91 |
|
92 private: |
|
93 unsigned char* iFrameBuffer; //a buffer to store a single frame |
|
94 unsigned int iEventEntryNumber; |
|
95 }; |
|
96 |
|
97 |
|
98 class CMultiPartFrameCollection : public std::vector<CUTraceFrame*> |
|
99 { |
|
100 public: |
|
101 explicit CMultiPartFrameCollection(CUTraceFrame* aFrame); |
|
102 ~CMultiPartFrameCollection(); |
|
103 |
|
104 unsigned int MultiPartId() const; |
|
105 void AddFrame(CUTraceFrame* aFrame); |
|
106 }; |
|
107 |
|
108 #endif |
|
109 // UTRACEFRAME_H |
|
110 |