int main(int argc, char *argv[]) { int rc; afs_status_t st = 0; rxdebugHandle_p handle; char *srvrName; long srvrPort; afs_uint32 supported; ParseArgs(argc, argv, &srvrName, &srvrPort); rc = afsclient_Init(&st); if (!rc) { fprintf(stderr, "afsclient_Init, status %d\n", st); exit(1); } rc = afsclient_RXDebugOpenPort(srvrName, srvrPort, &handle, &st); if (!rc) { fprintf(stderr, "afsclient_RXDebugOpenPort, status %d\n", st); exit(1); } rc = util_RXDebugSupportedStats(handle, &supported, &st); if (!rc) { fprintf(stderr, "util_RXDebugSupportedStats, status %d\n", st); exit(1); } rc = afsclient_RXDebugClose(handle, &st); if (!rc) { fprintf(stderr, "afsclient_RXDebugClose, status %d\n", st); exit(1); } printf("\n"); printf("security stats: %s supported\n", (supported & RX_SERVER_DEBUG_SEC_STATS) ? "" : " not"); printf("all connections:%s supported\n", (supported & RX_SERVER_DEBUG_ALL_CONN) ? "" : " not"); printf("rx stats: %s supported\n", (supported & RX_SERVER_DEBUG_RX_STATS) ? "" : " not"); printf("waiter count: %s supported\n", (supported & RX_SERVER_DEBUG_WAITER_CNT) ? "" : " not"); printf("idle threads: %s supported\n", (supported & RX_SERVER_DEBUG_IDLE_THREADS) ? "" : " not"); printf("all peers: %s supported\n", (supported & RX_SERVER_DEBUG_ALL_PEER) ? "" : " not"); printf("\n"); exit(0); }
int main(int argc, char *argv[]) { int rc; afs_status_t st = 0; rxdebugHandle_p handle; char *srvrName; long srvrPort; rxdebugVersion_t version; ParseArgs(argc, argv, &srvrName, &srvrPort); rc = afsclient_Init(&st); if (!rc) { fprintf(stderr, "afsclient_Init, status %d\n", st); exit(1); } rc = afsclient_RXDebugOpenPort(srvrName, srvrPort, &handle, &st); if (!rc) { fprintf(stderr, "afsclient_RXDebugOpenPort, status %d\n", st); exit(1); } rc = util_RXDebugVersion(handle, version, &st); if (!rc) { fprintf(stderr, "util_RXDebugVersion, status %d\n", st); exit(1); } rc = afsclient_RXDebugClose(handle, &st); if (!rc) { fprintf(stderr, "afsclient_RXDebugClose, status %d\n", st); exit(1); } printf("\n"); printf("AFS Version: '%s'\n", version); printf("\n"); exit(0); }
int main(int argc, char *argv[]) { int rc; afs_status_t st = 0; rxdebugHandle_p handle; char *srvrName; long srvrPort; void *iterator; struct rx_debugPeer peer; afs_uint32 supportedValues; ParseArgs(argc, argv, &srvrName, &srvrPort); rc = afsclient_Init(&st); if (!rc) { fprintf(stderr, "afsclient_Init, status %d\n", st); exit(1); } rc = afsclient_RXDebugOpenPort(srvrName, srvrPort, &handle, &st); if (!rc) { fprintf(stderr, "afsclient_RXDebugOpenPort, status %d\n", st); exit(1); } rc = util_RXDebugPeersBegin(handle, &iterator, &st); if (!rc) { fprintf(stderr, "util_RXDebugPeersBegin, status %d\n", st); exit(1); } while (util_RXDebugPeersNext(iterator, &peer, &supportedValues, &st)) { printf("\n"); printf("host: %u.%u.%u.%u\n", (peer.host >> 24) & 0xff, (peer.host >> 16) & 0xff, (peer.host >> 8) & 0xff, peer.host & 0xff); printf("port: %u\n", peer.port); printf("ifMTU: %u\n", peer.ifMTU); printf("idleWhen: %u\n", peer.idleWhen); printf("refCount: %u\n", peer.refCount); printf("burstSize: %u\n", peer.burstSize); printf("burst: %u\n", peer.burst); printf("burstWait: %u.%06u\n", peer.burstWait.sec, peer.burstWait.usec); printf("rtt: %u\n", peer.rtt); printf("rtt_dev: %u\n", peer.rtt_dev); printf("timeout: %u.%06u\n", peer.timeout.sec, peer.timeout.usec); printf("nSent: %u\n", peer.nSent); printf("reSends: %u\n", peer.reSends); printf("inPacketSkew: %u\n", peer.inPacketSkew); printf("outPacketSkew: %u\n", peer.outPacketSkew); printf("rateFlag: %u\n", peer.rateFlag); printf("natMTU: %u\n", peer.natMTU); printf("maxMTU: %u\n", peer.maxMTU); printf("maxDgramPackets: %u\n", peer.maxDgramPackets); printf("ifDgramPackets: %u\n", peer.ifDgramPackets); printf("MTU: %u\n", peer.MTU); printf("cwind: %u\n", peer.cwind); printf("nDgramPackets: %u\n", peer.nDgramPackets); printf("congestSeq: %u\n", peer.congestSeq); printf("bytesSent: (%u.%u)\n", hgethi(peer.bytesSent), hgetlo(peer.bytesSent)); printf("bytesReceived: (%u.%u)\n", hgethi(peer.bytesReceived), hgetlo(peer.bytesReceived)); } if (st != ADMITERATORDONE) { fprintf(stderr, "util_RXDebugPeersNext, status %d\n", st); exit(1); } printf("\n"); rc = util_RXDebugPeersDone(iterator, &st); if (!rc) { fprintf(stderr, "util_RXDebugPeersDone, status %d\n", st); exit(1); } rc = afsclient_RXDebugClose(handle, &st); if (!rc) { fprintf(stderr, "afsclient_RXDebugClose, status %d\n", st); exit(1); } exit(0); }
int main(int argc, char *argv[]) { int rc; afs_status_t st = 0; rxdebugHandle_p handle; char *srvrName; long srvrPort; struct rx_statistics stats; afs_uint32 supportedStats; char tstr[32]; int i; ParseArgs(argc, argv, &srvrName, &srvrPort); rc = afsclient_Init(&st); if (!rc) { fprintf(stderr, "afsclient_Init, status %d\n", st); exit(1); } rc = afsclient_RXDebugOpenPort(srvrName, srvrPort, &handle, &st); if (!rc) { fprintf(stderr, "afsclient_RXDebugOpenPort, status %d\n", st); exit(1); } rc = util_RXDebugRxStats(handle, &stats, &supportedStats, &st); if (!rc) { fprintf(stderr, "util_RXDebugBasicStats, status %d\n", st); exit(1); } rc = afsclient_RXDebugClose(handle, &st); if (!rc) { fprintf(stderr, "afsclient_RXDebugClose, status %d\n", st); exit(1); } printf("\n"); printf("RX stats: host %s (port %ld)\n", srvrName, srvrPort); printf("\n"); printf(" packetRequests: %d\n", stats.packetRequests); printf(" receivePktAllocFailures: %d\n", stats.receivePktAllocFailures); if (supportedStats & RX_SERVER_DEBUG_NEW_PACKETS) { printf(" receiveCbufPktAllocFailures: %d\n", stats.receiveCbufPktAllocFailures); } printf(" sendPktAllocFailures: %d\n", stats.sendPktAllocFailures); if (supportedStats & RX_SERVER_DEBUG_NEW_PACKETS) { printf(" sendCbufPktAllocFailures: %d\n", stats.sendCbufPktAllocFailures); } printf(" specialPktAllocFailures: %d\n", stats.specialPktAllocFailures); printf(" socketGreedy: %d\n", stats.socketGreedy); printf(" bogusPacketOnRead: %d\n", stats.bogusPacketOnRead); printf(" bogusHost: %d\n", stats.bogusHost); printf(" noPacketOnRead: %d\n", stats.noPacketOnRead); printf(" noPacketBuffersOnRead: %d\n", stats.noPacketBuffersOnRead); printf(" selects: %d\n", stats.selects); printf(" sendSelects: %d\n", stats.sendSelects); printf(" packetsRead:\n"); for (i = 0; i < RX_N_PACKET_TYPES; i++) { strcpy(tstr, packetTypes[i]); printf("\t%-24s %d\n", strcat(tstr, ":"), stats.packetsRead[i]); } printf(" dataPacketsRead: %d\n", stats.dataPacketsRead); printf(" ackPacketsRead: %d\n", stats.ackPacketsRead); printf(" dupPacketsRead: %d\n", stats.dupPacketsRead); printf(" spuriousPacketsRead: %d\n", stats.spuriousPacketsRead); printf(" ignorePacketDally: %d\n", stats.ignorePacketDally); printf(" packetsSent:\n"); for (i = 0; i < RX_N_PACKET_TYPES; i++) { strcpy(tstr, packetTypes[i]); printf("\t%-24s %d\n", strcat(tstr, ":"), stats.packetsSent[i]); } printf(" ackPacketsSent: %d\n", stats.ackPacketsSent); printf(" dataPacketsSent: %d\n", stats.dataPacketsSent); printf(" dataPacketsReSent: %d\n", stats.dataPacketsReSent); printf(" dataPacketsPushed: %d\n", stats.dataPacketsPushed); printf(" ignoreAckedPacket: %d\n", stats.ignoreAckedPacket); printf(" netSendFailures: %d\n", stats.netSendFailures); printf(" fatalErrors: %d\n", stats.fatalErrors); printf(" nRttSamples: %d\n", stats.nRttSamples); printf(" totalRtt: %.6f\n", clock_Float(&stats.totalRtt)); printf(" minRtt: %.6f\n", clock_Float(&stats.minRtt)); printf(" maxRtt: %.6f\n", clock_Float(&stats.maxRtt)); printf(" nServerConns: %d\n", stats.nServerConns); printf(" nClientConns: %d\n", stats.nClientConns); printf(" nPeerStructs: %d\n", stats.nPeerStructs); printf(" nCallStructs: %d\n", stats.nCallStructs); printf(" nFreeCallStructs: %d\n", stats.nFreeCallStructs); printf("\n"); exit(0); }