aboutsummaryrefslogtreecommitdiff
path: root/decoder/include
diff options
context:
space:
mode:
Diffstat (limited to 'decoder/include')
-rw-r--r--decoder/include/opencsd/ocsd_if_version.h4
-rw-r--r--decoder/include/pkt_printers/gen_elem_printer.h40
-rw-r--r--decoder/include/pkt_printers/item_printer.h19
-rw-r--r--decoder/include/pkt_printers/pkt_printer_t.h6
4 files changed, 30 insertions, 39 deletions
diff --git a/decoder/include/opencsd/ocsd_if_version.h b/decoder/include/opencsd/ocsd_if_version.h
index 41033f0..cefbe6b 100644
--- a/decoder/include/opencsd/ocsd_if_version.h
+++ b/decoder/include/opencsd/ocsd_if_version.h
@@ -44,7 +44,7 @@
@{*/
#define OCSD_VER_MAJOR 0x1 /**< Library Major Version */
#define OCSD_VER_MINOR 0x4 /**< Library Minor Version */
-#define OCSD_VER_PATCH 0x0 /**< Library Patch Version */
+#define OCSD_VER_PATCH 0x1 /**< Library Patch Version */
/** Library version number - MMMMnnpp format.
MMMM = major version,
@@ -53,7 +53,7 @@
*/
#define OCSD_VER_NUM ((OCSD_VER_MAJOR << 16) | (OCSD_VER_MINOR << 8) | OCSD_VER_PATCH)
-#define OCSD_VER_STRING "1.4.0" /**< Library Version string */
+#define OCSD_VER_STRING "1.4.1" /**< Library Version string */
#define OCSD_LIB_NAME "OpenCSD Library" /**< Library name string */
#define OCSD_LIB_SHORT_NAME "OCSD" /**< Library Short name string */
/** @}*/
diff --git a/decoder/include/pkt_printers/gen_elem_printer.h b/decoder/include/pkt_printers/gen_elem_printer.h
index ba3138a..c3fe3aa 100644
--- a/decoder/include/pkt_printers/gen_elem_printer.h
+++ b/decoder/include/pkt_printers/gen_elem_printer.h
@@ -49,47 +49,15 @@ public:
// funtionality to test wait / flush mechanism
void ackWait() { m_needWaitAck = false; };
const bool needAckWait() const { return m_needWaitAck; };
+ void set_collect_stats() { m_collect_stats = true; };
+ void printStats();
protected:
bool m_needWaitAck;
+ bool m_collect_stats; // collect stats on packets processed
+ int m_packet_counts[(int)OCSD_GEN_TRC_ELEM_CUSTOM + 1];
};
-
-inline TrcGenericElementPrinter::TrcGenericElementPrinter() :
- m_needWaitAck(false)
-{
-}
-
-inline ocsd_datapath_resp_t TrcGenericElementPrinter::TraceElemIn(const ocsd_trc_index_t index_sop,
- const uint8_t trc_chan_id,
- const OcsdTraceElement &elem)
-{
- ocsd_datapath_resp_t resp = OCSD_RESP_CONT;
- std::string elemStr;
- std::ostringstream oss;
- oss << "Idx:" << index_sop << "; ID:"<< std::hex << (uint32_t)trc_chan_id << "; ";
- elem.toString(elemStr);
- oss << elemStr << std::endl;
- itemPrintLine(oss.str());
-
- // funtionality to test wait / flush mechanism
- if(m_needWaitAck)
- {
- oss.str("");
- oss << "WARNING: Generic Element Printer; New element without previous _WAIT acknowledged\n";
- itemPrintLine(oss.str());
- m_needWaitAck = false;
- }
-
- if(getTestWaits())
- {
- resp = OCSD_RESP_WAIT; // return _WAIT for the 1st N packets.
- decTestWaits();
- m_needWaitAck = true;
- }
- return resp;
-}
-
#endif // ARM_GEN_ELEM_PRINTER_H_INCLUDED
/* End of File gen_elem_printer.h */
diff --git a/decoder/include/pkt_printers/item_printer.h b/decoder/include/pkt_printers/item_printer.h
index cc3ec37..0f1feeb 100644
--- a/decoder/include/pkt_printers/item_printer.h
+++ b/decoder/include/pkt_printers/item_printer.h
@@ -52,14 +52,21 @@ public:
const int getTestWaits() const;
void decTestWaits();
+ // mute printers when profiling
+ void setMute(bool mute);
+ const bool is_muted() const;
+
+
protected:
ocsdMsgLogger *m_pMsgLogger;
int m_test_waits;
+ bool m_mute;
};
inline ItemPrinter::ItemPrinter() :
m_pMsgLogger(0),
- m_test_waits(0)
+ m_test_waits(0),
+ m_mute(false)
{
}
@@ -89,6 +96,16 @@ inline void ItemPrinter::decTestWaits()
m_test_waits--;
}
+inline void ItemPrinter::setMute(bool mute)
+{
+ m_mute = mute;
+}
+
+inline const bool ItemPrinter::is_muted() const
+{
+ return m_mute;
+}
+
#endif // ARM_ITEM_PRINTER_H_INCLUDED
/* End of File item_printer.h */
diff --git a/decoder/include/pkt_printers/pkt_printer_t.h b/decoder/include/pkt_printers/pkt_printer_t.h
index c00daa1..f2d3e09 100644
--- a/decoder/include/pkt_printers/pkt_printer_t.h
+++ b/decoder/include/pkt_printers/pkt_printer_t.h
@@ -97,6 +97,9 @@ template<class P> ocsd_datapath_resp_t PacketPrinter<P>::PacketDataIn( const ocs
{
std::string pktstr;
ocsd_datapath_resp_t resp = OCSD_RESP_CONT;
+
+ if (is_muted())
+ return resp;
// wait / flush test verification
if(!m_bRawPrint && (m_last_resp == OCSD_RESP_WAIT))
@@ -152,6 +155,9 @@ template<class P> void PacketPrinter<P>::RawPacketDataMon( const ocsd_datapath_o
const uint32_t size,
const uint8_t *p_data)
{
+ if (is_muted())
+ return;
+
switch(op)
{
case OCSD_OP_DATA: