[DAPL2] DAPL Counters & 2.0.3 extensions to support counter retrieval.
[mirror/winof/.git] / ulp / dapl2 / dapl / common / dapl_evd_util.c
index 28b10a8..9b8a019 100644 (file)
@@ -274,6 +274,17 @@ dapls_evd_alloc (
     /* zero the structure */\r
     dapl_os_memzero (evd_ptr, sizeof (DAPL_EVD));\r
 \r
+#ifdef DAPL_COUNTERS\r
+    /* Allocate counters */\r
+    evd_ptr->cntrs = dapl_os_alloc(sizeof(DAT_UINT64) * DCNT_EVD_ALL_COUNTERS);\r
+    if (evd_ptr->cntrs == NULL) {\r
+       dapl_os_free(evd_ptr, sizeof(DAPL_EVD));\r
+       return (NULL);\r
+    }\r
+    dapl_os_memzero(evd_ptr->cntrs, \r
+                   sizeof(DAT_UINT64) * DCNT_EVD_ALL_COUNTERS);\r
+#endif /* DAPL_COUNTERS */\r
+\r
     /*\r
      * initialize the header\r
      */\r
@@ -543,6 +554,10 @@ dapls_evd_dealloc (
     }\r
 #endif\r
 \r
+#ifdef DAPL_COUNTERS\r
+    dapl_os_free(evd_ptr->cntrs, sizeof(DAT_UINT64) * DCNT_EVD_ALL_COUNTERS);\r
+#endif /* DAPL_COUNTERS */\r
+\r
     dapl_os_free (evd_ptr, sizeof (DAPL_EVD));\r
 \r
 bail:\r