From eb887cc2ebd577b1e7474dfa25808e019542e037 Mon Sep 17 00:00:00 2001 From: adilger Date: Mon, 16 Jun 2003 07:04:59 +0000 Subject: [PATCH] Remove excessive use of macros in the new lprocfs stats counters. This was the source of one bug, and wasn't necessary. Also a general cleanup. Removed duplicate "read/write" counter, as this data will already be contained in the "read/write_bytes" counter as the number of events. Found out that lprocfs RPC counters do not work under UML, because "get_cycles()" always returns 0. --- lustre/ptlrpc/ptlrpc_internal.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lustre/ptlrpc/ptlrpc_internal.h b/lustre/ptlrpc/ptlrpc_internal.h index 7100707..575ed07 100644 --- a/lustre/ptlrpc/ptlrpc_internal.h +++ b/lustre/ptlrpc/ptlrpc_internal.h @@ -56,23 +56,23 @@ static inline int opcode_offset(__u32 opc) { (OST_LAST_OPC - OST_FIRST_OPC)); } else if (opc < LDLM_LAST_OPC) { /* LDLM Opcode */ - return (opc - LDLM_FIRST_OPC + - (MDS_LAST_OPC - MDS_FIRST_OPC) + + return (opc - LDLM_FIRST_OPC + + (MDS_LAST_OPC - MDS_FIRST_OPC) + (OST_LAST_OPC - OST_FIRST_OPC)); } else if (opc < PTLBD_LAST_OPC) { /* Portals Block Device */ - return (opc - PTLBD_FIRST_OPC + + return (opc - PTLBD_FIRST_OPC + (LDLM_LAST_OPC - LDLM_FIRST_OPC) + (MDS_LAST_OPC - MDS_FIRST_OPC) + (OST_LAST_OPC - OST_FIRST_OPC)); } else if (opc == OBD_PING) { /* OBD Ping */ - return (opc - OBD_PING + + return (opc - OBD_PING + (PTLBD_LAST_OPC - PTLBD_FIRST_OPC) + (LDLM_LAST_OPC - LDLM_FIRST_OPC) + (MDS_LAST_OPC - MDS_FIRST_OPC) + (OST_LAST_OPC - OST_FIRST_OPC)); - } else { + } else { /* Unknown Opcode */ return -1; } @@ -84,10 +84,10 @@ static inline int opcode_offset(__u32 opc) { + (OST_LAST_OPC - OST_FIRST_OPC)) enum { - PTLRPC_REQWAIT_CNTR = 0, - PTLRPC_SVCEQDEPTH_CNTR = 1, - PTLRPC_SVCIDLETIME_CNTR = 2, - PTLRPC_LAST_CNTR = 3 + PTLRPC_REQWAIT_CNTR = 0, + PTLRPC_SVCIDLETIME_CNTR = 1, + //PTLRPC_SVCEQDEPTH_CNTR, + PTLRPC_LAST_CNTR }; #endif /* PTLRPC_INTERNAL_H */ -- 1.8.3.1