Commit | Line | Data |
---|---|---|
9a2167bd CB |
1 | /* |
2 | * Copyright (C) 2013 Freescale Semiconductor, Inc. | |
3 | * | |
4 | * Permission is hereby granted, free of charge, to any person obtaining a copy | |
5 | * of this software and associated documentation files (the "Software"), to deal | |
6 | * in the Software without restriction, including without limitation the rights | |
7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
8 | * copies of the Software, and to permit persons to whom the Software is | |
9 | * furnished to do so, subject to the following conditions: | |
10 | * | |
11 | * The above copyright notice and this permission notice shall be included | |
12 | * in all copies or substantial portions of the Software. | |
13 | * | |
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | |
20 | * IN THE SOFTWARE. | |
21 | */ | |
22 | ||
23 | #ifndef FMANDEBUGLOGVISITOR_H | |
24 | #define FMANDEBUGLOGVISITOR_H | |
25 | ||
26 | #include <vector> | |
27 | #include <string> | |
28 | #include "NxMessageVisitor.h" | |
29 | ||
30 | using std::vector; | |
31 | using std::string; | |
32 | ||
33 | class FManDebugLog; | |
34 | ||
35 | class NxDefaultMessage; | |
36 | class NxDebugStatusMessage; | |
37 | class NxDeviceIDMessage; | |
38 | class NxOwnershipTraceMessage; | |
39 | class NxDataAcquisitionMessage; | |
40 | class NxErrorMessage; | |
41 | class NxProgramTraceSync; | |
42 | class NxDataTraceWrite; | |
43 | class NxDataTraceRead; | |
44 | class NxDataTraceWriteSync; | |
45 | class NxDataTraceReadSync; | |
46 | class NxWatchpointMessage; | |
47 | class NxResourceFullMessage; | |
48 | class NxProgramTraceIndirectBranch; | |
49 | class NxProgramTraceIndirectBranchSync; | |
50 | class NxProgramTraceCorrelation; | |
51 | class NxDAMInCircuitTraceMessage; | |
52 | class NxCAMInCircuitTraceMessage; | |
53 | class NxCDMInCircuitTraceMessage; | |
54 | class NxDPQMInCircuitTraceMessage; | |
55 | class NxDPFMInCircuitTraceMessage; | |
56 | class NxCoreInCircuitTraceMessage; | |
57 | class NxInCircuitTraceMessage; | |
58 | class NxTimeStampCorrelation; | |
59 | ||
60 | // Creates a detailed log for each FMan from the multiple | |
61 | // ICT messages containing the context data. | |
62 | class FManDebugLogVisitor: public NxMessageVisitor | |
63 | { | |
64 | public: | |
65 | ||
66 | FManDebugLogVisitor(); | |
67 | virtual ~FManDebugLogVisitor(); | |
68 | ||
69 | virtual void visit(NxDefaultMessage *m){useful_visit_ = false;} | |
70 | virtual void visit(NxDebugStatusMessage *m){useful_visit_ = false;} | |
71 | virtual void visit(NxDeviceIDMessage *m){useful_visit_ = false;} | |
72 | virtual void visit(NxOwnershipTraceMessage *m){useful_visit_ = false;} | |
73 | virtual void visit(NxDataAcquisitionMessage *m){useful_visit_ = false;} | |
74 | virtual void visit(NxErrorMessage *m){useful_visit_ = false;} | |
75 | virtual void visit(NxProgramTraceSync *m){useful_visit_ = false;} | |
76 | virtual void visit(NxDataTraceWrite *m){useful_visit_ = false;} | |
77 | virtual void visit(NxDataTraceRead *m){useful_visit_ = false;} | |
78 | virtual void visit(NxDataTraceWriteSync *m){useful_visit_ = false;} | |
79 | virtual void visit(NxDataTraceReadSync *m){useful_visit_ = false;} | |
80 | virtual void visit(NxWatchpointMessage *m){useful_visit_ = false;} | |
81 | virtual void visit(NxResourceFullMessage *m){useful_visit_ = false;} | |
82 | virtual void visit(NxProgramTraceIndirectBranch *m){useful_visit_ = false;} | |
83 | virtual void visit(NxProgramTraceIndirectBranchSync *m){useful_visit_ = false;} | |
84 | virtual void visit(NxProgramTraceCorrelation *m){useful_visit_ = false;} | |
85 | virtual void visit(NxDAMInCircuitTraceMessage *m){useful_visit_ = false;} | |
86 | virtual void visit(NxCAMInCircuitTraceMessage *m){useful_visit_ = false;} | |
87 | virtual void visit(NxCDMInCircuitTraceMessage *m){useful_visit_ = false;} | |
88 | virtual void visit(NxDPQMInCircuitTraceMessage *m){useful_visit_ = false;} | |
89 | virtual void visit(NxCoreInCircuitTraceMessage *m){useful_visit_ = false;} | |
90 | virtual void visit(NxInCircuitTraceMessage *m){useful_visit_ = false;} | |
91 | virtual void visit(NxTimeStampCorrelation *m){useful_visit_ = false;} | |
92 | ||
93 | // implement the specific visit | |
94 | virtual void visit(NxDPFMInCircuitTraceMessage *m); | |
95 | ||
96 | // output message information as a string | |
97 | virtual string asString() const; | |
98 | ||
99 | private: | |
100 | ||
101 | // define the number of concurrent FMAN logs | |
102 | static const int MAX_FMAN_LOGS = 2; | |
103 | ||
104 | // FMan specific logs | |
105 | FManDebugLog* log_[MAX_FMAN_LOGS]; | |
106 | ||
107 | // true if log is already reported via asString() | |
108 | mutable bool already_reported_[MAX_FMAN_LOGS]; | |
109 | }; | |
110 | ||
111 | #endif // FMANDEBUGLOGVISITOR_H |