|
|
|
@ -156,6 +156,7 @@ void Replay::usage(void)
@@ -156,6 +156,7 @@ void Replay::usage(void)
|
|
|
|
|
::printf("\t--logmatch match logging rate to source\n"); |
|
|
|
|
::printf("\t--no-params don't use parameters from the log\n"); |
|
|
|
|
::printf("\t--no-fpe do not generate floating point exceptions\n"); |
|
|
|
|
::printf("\t--packet-counts print packet counts at end of processing\n"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -171,6 +172,7 @@ enum {
@@ -171,6 +172,7 @@ enum {
|
|
|
|
|
OPT_NOPARAMS, |
|
|
|
|
OPT_PARAM_FILE, |
|
|
|
|
OPT_NO_FPE, |
|
|
|
|
OPT_PACKET_COUNTS, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
void Replay::flush_dataflash(void) { |
|
|
|
@ -227,6 +229,7 @@ void Replay::_parse_command_line(uint8_t argc, char * const argv[])
@@ -227,6 +229,7 @@ void Replay::_parse_command_line(uint8_t argc, char * const argv[])
|
|
|
|
|
{"logmatch", false, 0, OPT_LOGMATCH}, |
|
|
|
|
{"no-params", false, 0, OPT_NOPARAMS}, |
|
|
|
|
{"no-fpe", false, 0, OPT_NO_FPE}, |
|
|
|
|
{"packet-counts", false, 0, OPT_PACKET_COUNTS}, |
|
|
|
|
{0, false, 0, 0} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
@ -310,6 +313,10 @@ void Replay::_parse_command_line(uint8_t argc, char * const argv[])
@@ -310,6 +313,10 @@ void Replay::_parse_command_line(uint8_t argc, char * const argv[])
|
|
|
|
|
generate_fpe = false; |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case OPT_PACKET_COUNTS: |
|
|
|
|
packet_counts = true; |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case 'h': |
|
|
|
|
default: |
|
|
|
|
usage(); |
|
|
|
@ -780,9 +787,30 @@ void Replay::flush_and_exit()
@@ -780,9 +787,30 @@ void Replay::flush_and_exit()
|
|
|
|
|
report_checks(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (packet_counts) { |
|
|
|
|
show_packet_counts(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
exit(0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Replay::show_packet_counts() |
|
|
|
|
{ |
|
|
|
|
uint64_t counts[LOGREADER_MAX_FORMATS]; |
|
|
|
|
logreader.get_packet_counts(counts); |
|
|
|
|
char format_type[5]; |
|
|
|
|
uint64_t total = 0; |
|
|
|
|
for(uint16_t i=0;i<LOGREADER_MAX_FORMATS;i++) { |
|
|
|
|
if (counts[i] != 0) { |
|
|
|
|
logreader.format_type(i, format_type); |
|
|
|
|
printf("%10ld %s\n", counts[i], format_type); |
|
|
|
|
total += counts[i]; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
printf("%ld total\n", total); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Replay::loop() |
|
|
|
|
{ |
|
|
|
|
char type[5]; |
|
|
|
@ -813,7 +841,6 @@ void Replay::loop()
@@ -813,7 +841,6 @@ void Replay::loop()
|
|
|
|
|
if (!streq(type,"ATT")) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|