mirror of
https://github.com/greatscottgadgets/hackrf.git
synced 2026-03-06 23:39:56 +01:00
Keep track of longest shortfall.
This adds six cycles to the TX and RX shortfall paths.
This commit is contained in:
@@ -389,6 +389,7 @@ static void print_state(hackrf_m0_state *state) {
|
||||
printf("M0 count: %u bytes\n", state->m0_count);
|
||||
printf("M4 count: %u bytes\n", state->m4_count);
|
||||
printf("Number of shortfalls: %u\n", state->num_shortfalls);
|
||||
printf("Longest shortfall: %u bytes\n", state->longest_shortfall);
|
||||
}
|
||||
|
||||
static void usage() {
|
||||
|
||||
@@ -1159,11 +1159,12 @@ int main(int argc, char** argv) {
|
||||
if (result != HACKRF_SUCCESS)
|
||||
fprintf(stderr, "\nhackrf_get_m0_state() failed: %s (%d)\n", hackrf_error_name(result), result);
|
||||
else
|
||||
fprintf(stderr, ", %d bytes %s in buffer, %u %s\n",
|
||||
fprintf(stderr, ", %d bytes %s in buffer, %u %s, longest %u bytes\n",
|
||||
tx ? state.m4_count - state.m0_count : state.m0_count - state.m4_count,
|
||||
tx ? "filled" : "free",
|
||||
state.num_shortfalls,
|
||||
tx ? "underruns" : "overruns");
|
||||
tx ? "underruns" : "overruns",
|
||||
state.longest_shortfall);
|
||||
} else {
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
@@ -1219,11 +1220,12 @@ int main(int argc, char** argv) {
|
||||
"Transfer statistics:\n"
|
||||
"%lu bytes transferred by M0\n"
|
||||
"%lu bytes transferred by M4\n"
|
||||
"%u %s\n",
|
||||
"%u %s, longest %u bytes\n",
|
||||
stats.m0_total,
|
||||
stats.m4_total,
|
||||
state.num_shortfalls,
|
||||
(transmit || signalsource) ? "underruns" : "overruns");
|
||||
(transmit || signalsource) ? "underruns" : "overruns",
|
||||
state.longest_shortfall);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user