From 8c1bae59f57cd2cffe13234aee94c2b7aa08e8dd Mon Sep 17 00:00:00 2001 From: henryk Date: Sun, 9 Dec 2007 06:49:28 +0000 Subject: Clean up SSC performance metric reporting git-svn-id: https://svn.openpcd.org:2342/trunk@382 6dc7ffe9-61d6-0310-9af1-9938baff3ed1 --- openpicc/application/cmd.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'openpicc/application/cmd.c') 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"); -- cgit v1.2.3