[DAPL2] DAPL Counters & 2.0.3 extensions to support counter retrieval.
[mirror/winof/.git] / ulp / dapl2 / dapl / include / dapl_debug.h
index 023ead9..f7f2bb5 100644 (file)
@@ -100,50 +100,25 @@ static __inline void dapl_dbg_log ( DAPL_DBG_TYPE type,  const char *fmt,  ...)
 \r
 #endif /* !DAPL_DBG */\r
 \r
-/*\r
- * Counters\r
- */\r
-#define DCNT_EP_CREATE                 0\r
-#define DCNT_EP_FREE                   1\r
-#define DCNT_EP_CONNECT                        2\r
-#define DCNT_EP_DISCONNECT             3\r
-#define DCNT_POST_SEND                 4\r
-#define DCNT_POST_RECV                 5\r
-#define DCNT_POST_RDMA_WRITE           6\r
-#define DCNT_POST_RDMA_READ            7\r
-#define DCNT_EVD_CREATE                        8\r
-#define DCNT_EVD_FREE                  9\r
-#define DCNT_EVD_WAIT                  10\r
-#define DCNT_EVD_WAIT_BLOCKED          11\r
-#define DCNT_EVD_WAIT_CMP_NTFY         12\r
-#define DCNT_EVD_DTO_CALLBACK          13\r
-#define DCNT_EVD_CONN_CALLBACK         14\r
-#define DCNT_EVD_DEQUEUE               15\r
-#define DCNT_EVD_DEQUEUE_POLL          16\r
-#define DCNT_EVD_DEQUEUE_FOUND         17\r
-#define DCNT_EVD_DEQUEUE_NOT_FOUND     18\r
-#define DCNT_TIMER_SET                 19\r
-#define DCNT_TIMER_CANCEL              20\r
-#define DCNT_EXTENSION                 21\r
-#define DCNT_NUM_COUNTERS              22\r
-#define DCNT_ALL_COUNTERS               DCNT_NUM_COUNTERS\r
-\r
-#if defined(DAPL_COUNTERS)\r
-\r
-extern void dapl_dump_cntr( int cntr );\r
-extern int dapl_dbg_counters[];\r
-\r
-#define DAPL_CNTR(cntr)         dapl_os_atomic_inc (&dapl_dbg_counters[cntr]);\r
-#define DAPL_DUMP_CNTR(cntr)    dapl_dump_cntr( cntr );\r
-#define DAPL_COUNTERS_INIT()\r
+#include <dat/dat_ib_extensions.h>\r
+\r
+#ifdef DAPL_COUNTERS\r
+\r
+#define DAPL_CNTR(h_ptr, cntr) ((DAT_UINT64*)h_ptr->cntrs)[cntr]++\r
+#define DAPL_CNTR_DATA(h_ptr, cntr, data) ((DAT_UINT64*)h_ptr->cntrs)[cntr]+= data\r
+\r
+DAT_RETURN dapl_query_counter(DAT_HANDLE dh, \r
+                             int counter, \r
+                             void *p_cntrs_out,\r
+                             int reset);\r
+char *dapl_query_counter_name(DAT_HANDLE dh, int counter);\r
+void dapl_print_counter(DAT_HANDLE dh, int counter, int reset);\r
 \r
 #else\r
 \r
-#define DAPL_CNTR(cntr)\r
-#define DAPL_DUMP_CNTR(cntr) \r
-#define DAPL_COUNTERS_INIT()\r
+#define DAPL_CNTR(handle, cntr)\r
+#define DAPL_CNTR_DATA(handle, cntr, data)\r
 \r
 #endif /* DAPL_COUNTERS */\r
 \r
-\r
 #endif /* _DAPL_DEBUG_H_ */\r