summaryrefslogtreecommitdiff
path: root/openpicc/application/cmd.c
diff options
context:
space:
mode:
authorhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2007-12-09 06:49:28 +0000
committerhenryk <henryk@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2007-12-09 06:49:28 +0000
commit8c1bae59f57cd2cffe13234aee94c2b7aa08e8dd (patch)
tree13c5244859d81bdecf92fa67c8103fef31335ff8 /openpicc/application/cmd.c
parentceb643380b02d0d8289e3ad75a495123414ace8c (diff)
Clean up SSC performance metric reporting
git-svn-id: https://svn.openpcd.org:2342/trunk@382 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'openpicc/application/cmd.c')
-rw-r--r--openpicc/application/cmd.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/openpicc/application/cmd.c b/openpicc/application/cmd.c
index 463f514..b66c6c8 100644
--- a/openpicc/application/cmd.c
+++ b/openpicc/application/cmd.c
@@ -106,6 +106,12 @@ int atoiEx(const char * nptr, char * * eptr)
return sign * curval;
}
+static const struct {ssc_metric metric; char *description;} SSC_METRICS[] = {
+ {OVERFLOWS, "overflows"},
+ {BUFFER_ERRORS, "internal buffer management errors"},
+ {FREE_BUFFERS, "free rx buffers"},
+ {LATE_FRAMES, "late frames"},
+};
static const struct { int pin; char * description; } PIO_PINS[] = {
{OPENPICC_PIO_PLL_LOCK, "pll lock "},
{OPENPICC_PIO_FRAME, "frame start"},
@@ -129,6 +135,7 @@ void print_pio(void)
DumpStringToUSB(" *****************************************************\n\r");
}
+
static const AT91PS_SPI spi = AT91C_BASE_SPI;
#define SPI_MAX_XFER_LEN 33
@@ -264,15 +271,14 @@ void prvExecCommand(u_int32_t cmd, portCHAR *args) {
DumpStringToUSB(" * load_mod_level: ");
DumpUIntToUSB(load_mod_level_set);
DumpStringToUSB("\n\r");
- DumpStringToUSB(" * SSC RX overflows: ");
- DumpUIntToUSB(ssc_get_overflows());
- DumpStringToUSB("\n\r");
- DumpStringToUSB(" * SSC free buffers: ");
- DumpUIntToUSB(ssc_count_free());
- DumpStringToUSB("\n\r");
- DumpStringToUSB(" * SSC late frames: ");
- DumpUIntToUSB(ssc_get_late_frames());
- DumpStringToUSB("\n\r");
+ DumpStringToUSB(" * SSC performance metrics:\n\r");
+ for(i=0; i<(int)(sizeof(SSC_METRICS)/sizeof(SSC_METRICS[0])); i++) {
+ DumpStringToUSB(" * \t");
+ DumpStringToUSB(SSC_METRICS[i].description);
+ DumpStringToUSB(": ");
+ DumpUIntToUSB(ssc_get_metric(SSC_METRICS[i].metric));
+ DumpStringToUSB("\n\r");
+ }
DumpStringToUSB(" * SSC status: ");
DumpUIntToUSB(AT91C_BASE_SSC->SSC_SR);
DumpStringToUSB("\n\r");
personal git repositories of Harald Welte. Your mileage may vary