Test program updates - option to supress raw data
diff --git a/ref_trace_decoder/source/etmv4/trc_pkt_proc_etmv4i_impl.cpp b/ref_trace_decoder/source/etmv4/trc_pkt_proc_etmv4i_impl.cpp
index 6a8097d..3b7a238 100644
--- a/ref_trace_decoder/source/etmv4/trc_pkt_proc_etmv4i_impl.cpp
+++ b/ref_trace_decoder/source/etmv4/trc_pkt_proc_etmv4i_impl.cpp
@@ -81,7 +81,9 @@
m_blockBytesProcessed = 0;
m_blockIndex = index;
uint8_t currByte;
- while((m_blockBytesProcessed < dataBlockSize) && RCTDL_DATA_RESP_IS_CONT(resp))
+ while( ((m_blockBytesProcessed < dataBlockSize) ||
+ (m_blockBytesProcessed == dataBlockSize) && (m_process_state == SEND_PKT)) &&
+ RCTDL_DATA_RESP_IS_CONT(resp))
{
currByte = pDataBlock[m_blockBytesProcessed];
try
diff --git a/ref_trace_decoder/source/rctdl_msg_logger.cpp b/ref_trace_decoder/source/rctdl_msg_logger.cpp
index 51b5524..ed5f690 100644
--- a/ref_trace_decoder/source/rctdl_msg_logger.cpp
+++ b/ref_trace_decoder/source/rctdl_msg_logger.cpp
@@ -65,13 +65,13 @@
{
if(m_outFlags & OUT_STDOUT)
{
- std::cout << msg << std::endl;
+ std::cout << msg;
std::cout.flush();
}
if(m_outFlags & OUT_STDERR)
{
- std::cerr << msg << std::endl;
+ std::cerr << msg;
std::cerr.flush();
}
@@ -81,7 +81,7 @@
{
m_out_file.open(m_logFileName.c_str(),std::fstream::out | std::fstream::app);
}
- m_out_file << msg << std::endl;
+ m_out_file << msg;
m_out_file.flush();
}
}
diff --git a/ref_trace_decoder/tests/snapshot_parser_lib/source/snapshot_parser.cpp b/ref_trace_decoder/tests/snapshot_parser_lib/source/snapshot_parser.cpp
index 40e018d..e95e8dc 100644
--- a/ref_trace_decoder/tests/snapshot_parser_lib/source/snapshot_parser.cpp
+++ b/ref_trace_decoder/tests/snapshot_parser_lib/source/snapshot_parser.cpp
@@ -341,7 +341,7 @@
//! Instantiate the appropriate handler for the section name
auto_ptr<Section> NewSection( const string& sectionName, Parsed& result)
{
- LogInfoStr( "Start of " + sectionName + " section");
+ LogInfoStr( "Start of " + sectionName + " section\n");
if (sectionName == GlobalSectionName)
{
@@ -365,7 +365,7 @@
}
else
{
- LogInfoStr("Unknown section ignored: " + sectionName);
+ LogInfoStr("Unknown section ignored: " + sectionName + "\n");
return auto_ptr<Section>(new IgnoredSection);
}
}
@@ -396,7 +396,7 @@
//! Instantiate the appropriate handler for the section name
auto_ptr<Section> NewDeviceList(const string& sectionName, ParsedDevices& result)
{
- LogInfoStr("Start of " + sectionName + " section");
+ LogInfoStr("Start of " + sectionName + " section\n");
if (sectionName == DeviceListSectionName)
{
@@ -623,7 +623,7 @@
auto_ptr<Section> NewTraceSection(const string& sectionName, ParsedTrace& result)
{
- LogInfoStr((std::string)"Start of " + sectionName + (std::string)" section");
+ LogInfoStr((std::string)"Start of " + sectionName + (std::string)" section\n");
if (sectionName == TraceBuffersSectionName)
{
diff --git a/ref_trace_decoder/tests/source/raw_frame_printer.cpp b/ref_trace_decoder/tests/source/raw_frame_printer.cpp
index 60f7a26..04b38bf 100644
--- a/ref_trace_decoder/tests/source/raw_frame_printer.cpp
+++ b/ref_trace_decoder/tests/source/raw_frame_printer.cpp
@@ -69,6 +69,7 @@
createDataString(printDataSize,pDataBlock,16,strData);
oss << strData;
}
+ oss << std::endl;
itemPrintLine(oss.str());
}
return RCTDL_OK;
diff --git a/ref_trace_decoder/tests/source/trc_pkt_lister.cpp b/ref_trace_decoder/tests/source/trc_pkt_lister.cpp
index 5365a3c..5111c15 100644
--- a/ref_trace_decoder/tests/source/trc_pkt_lister.cpp
+++ b/ref_trace_decoder/tests/source/trc_pkt_lister.cpp
@@ -63,6 +63,9 @@
static rctdlMsgLogger logger;
static int logOpts = rctdlMsgLogger::OUT_STDOUT | rctdlMsgLogger::OUT_FILE;
static std::string logfileName = "trc_pkt_lister.log";
+static bool outRawPacked = false;
+static bool outRawUnpacked = false;
+
int main(int argc, char* argv[])
{
@@ -123,6 +126,18 @@
return 0;
}
+void print_help()
+{
+ std::ostringstream oss;
+ oss << "Trace Packet Lister - commands\n\n";
+ oss << "-ss_dir <dir> Set the directory path to a trace snapshot\n";
+ oss << "-id <n> Set an ID to list (may be used mutiple times) - default if no id set is for all IDs to be printed\n";
+ oss << "-src_name <name> List packets from a given snapshot source name (defaults to first source found)\n";
+ oss << "-o_raw_packed Output raw packed trace frames\n";
+ oss << "-o_raw_unpacked Output raw unpacked trace data per ID\n";
+ logger.LogMsg(oss.str());
+}
+
bool process_cmd_line_opts(int argc, char* argv[])
{
@@ -183,6 +198,19 @@
bOptsOK = false;
}
}
+ else if(strcmp(argv[optIdx], "-o_raw_packed") == 0)
+ {
+ outRawPacked = true;
+ }
+ else if(strcmp(argv[optIdx], "-o_raw_unpacked") == 0)
+ {
+ outRawUnpacked = true;
+ }
+ else if(strcmp(argv[optIdx], "-help") == 0)
+ {
+ print_help();
+ bOptsOK = false;
+ }
else
{
std::ostringstream errstr;
@@ -250,13 +278,19 @@
TraceFormatterFrameDecoder *pDeformatter = dcd_tree->getFrameDeformatter();
if(pDeformatter != 0)
{
- // wwe want the raw frames.
- pDeformatter->getTrcRawFrameAttachPt()->attach(&framePrinter);
- pDeformatter->Configure(RCTDL_DFRMTR_FRAME_MEM_ALIGN | RCTDL_DFRMTR_UNPACKED_RAW_OUT | RCTDL_DFRMTR_PACKED_RAW_OUT);
+ uint32_t configFlags = RCTDL_DFRMTR_FRAME_MEM_ALIGN;
+
+ // we want the raw frames.
+ if(outRawPacked || outRawUnpacked)
+ {
+ pDeformatter->getTrcRawFrameAttachPt()->attach(&framePrinter);
+ if(outRawPacked) configFlags |= RCTDL_DFRMTR_PACKED_RAW_OUT;
+ if(outRawUnpacked) configFlags |= RCTDL_DFRMTR_UNPACKED_RAW_OUT;
+ }
+ pDeformatter->Configure(configFlags);
}
-
- // check if we have attached at least one printer
+ // check if we have attached at least one printer
if(printers.size() > 0)
{
// need to push the data through the decode tree.