/* apepmd.c */ /* This program dumps a performance data structure */ #include #include #include "ape25.h" #include "atmuser.h" struct pmdtype pmd; int dumppmd( struct pmdtype *pmd) { int i; printf("Interrupt count %8x%08x \n", pmd->intcount[1], pmd->intcount[0]); printf(" RRL0 %8x%08x \n", pmd->intcats[0][1], pmd->intcats[0][0]); printf(" RRL1 %8x%08x \n", pmd->intcats[1][1], pmd->intcats[1][0]); printf(" RRL2 %8x%08x \n", pmd->intcats[2][1], pmd->intcats[2][0]); printf(" RRL3 %8x%08x \n", pmd->intcats[3][1], pmd->intcats[3][0]); printf(" RRL4 %8x%08x \n", pmd->intcats[4][1], pmd->intcats[4][0]); printf(" RRL5 %8x%08x \n", pmd->intcats[5][1], pmd->intcats[5][0]); printf(" RRL6 %8x%08x \n", pmd->intcats[6][1], pmd->intcats[6][0]); printf(" RRL7 %8x%08x \n", pmd->intcats[7][1], pmd->intcats[7][0]); printf(" RFL Empty %8x%08x \n", pmd->intcats[8][1], pmd->intcats[8][0]); printf(" RCB Overrun %8x%08x \n", pmd->intcats[9][1], pmd->intcats[9][0]); printf(" CBR Interrupt %8x%08x \n", pmd->intcats[10][1], pmd->intcats[10][0]); printf(" APE Error %8x%08x \n", pmd->intcats[11][1], pmd->intcats[11][0]); printf(" Service TCL %8x%08x \n", pmd->intcats[13][1], pmd->intcats[13][0]); printf(" PCI Error %8x%08x \n", pmd->intcats[14][1], pmd->intcats[14][0]); printf(" 10ms Timer %8x%08x \n", pmd->intcats[15][1], pmd->intcats[15][0]); printf("\n"); printf("Received CLP 0 %8x%08x \n", pmd->rclp0[1], pmd->rclp0[0]); printf("Received CLP 1 %8x%08x \n", pmd->rclp1[1], pmd->rclp1[0]); printf("\n"); printf("Transmit CLP 0 %8x%08x \n", pmd->tclp0[1], pmd->tclp0[0]); printf("Transmit CLP 1 %8x%08x \n", pmd->tclp1[1], pmd->tclp1[0]); printf("\n"); printf("Received OAM %8x%08x \n", 0, pmd->roam); printf("Transmit OAM %8x%08x \n", 0, pmd->toam); printf("Misroute Cells %8x%08x \n", 0, pmd->misrt); printf("\n"); printf("TCL Waits %8x%08x \n", 0, pmd->tclwaits); printf("TBC Waits %8x%08x \n", 0, pmd->tbcwaits); printf("TMQ Waits %8x%08x \n", 0, pmd->tmqwaits); printf("\n"); printf("TMQ 0 missed serv. %8x%08x \n", 0, pmd->tmqmisses[0]); printf("TMQ 1 missed serv. %8x%08x \n", 0, pmd->tmqmisses[1]); printf("TMQ 2 missed serv. %8x%08x \n", 0, pmd->tmqmisses[2]); printf("TMQ 3 missed serv. %8x%08x \n", 0, pmd->tmqmisses[3]); printf("TMQ 4 missed serv. %8x%08x \n", 0, pmd->tmqmisses[4]); printf("TMQ 5 missed serv. %8x%08x \n", 0, pmd->tmqmisses[5]); printf("TMQ 6 missed serv. %8x%08x \n", 0, pmd->tmqmisses[6]); printf("TMQ 7 missed serv. %8x%08x \n", 0, pmd->tmqmisses[7]); for (i = 0; i < 64; i++) { if (pmd->lcin[i] | pmd->lcout[i]) { printf("LC: %3d In = %8d Out = %8d \n", i, pmd->lcin[i], pmd->lcout[i]); } } } void main( int argc, char **argv) { int fd; int base = 0; int len; FILE *xr; int regid; int i; int offset; int lcid; int rc; fd = open("/dev/ape25", O_RDWR); if (fd < 0) { printf("Device /dev/ape25 could not be opened. \n"); exit(1); } rc = ioctl(fd, AIO_GETPMD, &pmd); printf("Got %d bytes \n", rc); dumppmd(&pmd); }