[IPoIB NDIS 6.0 CM] Tracing facilities (mlnx 5208)
authortzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 1 Dec 2009 16:32:43 +0000 (16:32 +0000)
committertzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 1 Dec 2009 16:32:43 +0000 (16:32 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@2607 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

ulp/ipoib_NDIS6_CM/kernel/ipoib_adapter.cpp
ulp/ipoib_NDIS6_CM/kernel/ipoib_driver.cpp
ulp/ipoib_NDIS6_CM/kernel/ipoib_endpoint.h
ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp

index c87ef53..7c9eebd 100644 (file)
@@ -423,6 +423,9 @@ __ipoib_pnp_reg(
         * completes.\r
         */\r
        cl_obj_ref( &p_adapter->obj );\r
+       IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_OBJ,\r
+                               ("[%p] Adapter refcount raised to %d\n", p_adapter, p_adapter->obj.ref_cnt));\r
+\r
 \r
        IPOIB_EXIT( IPOIB_DBG_INIT );\r
        return status;\r
@@ -447,7 +450,11 @@ __adapter_destroying(
         */\r
        if( p_adapter->h_pnp )\r
        {\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_OBJ,\r
+                               ("Adapter[%p] has refcnt= %d\n", p_adapter, p_adapter->obj.ref_cnt));\r
                p_adapter->p_ifc->dereg_pnp( p_adapter->h_pnp, (ib_pfn_destroy_cb_t) cl_obj_deref );\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_OBJ,\r
+                               ("Adapter[%p] refcnt decremented to %d\n", p_adapter, p_adapter->obj.ref_cnt));\r
                p_adapter->h_pnp = NULL;\r
        }\r
 \r
@@ -1055,6 +1062,8 @@ __ipoib_adapter_reset(
 \r
        /* Dereference the adapter since the previous registration is now gone. */\r
        cl_obj_deref( &p_adapter->obj );\r
+       IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_OBJ,\r
+                       ("Adapter[%p] refcnt decremented to %d\n", p_adapter, p_adapter->obj.ref_cnt));\r
 \r
        KeReleaseMutex( &p_adapter->mutex, FALSE );\r
 \r
index 2bb4ae2..35d2b80 100644 (file)
@@ -3928,6 +3928,8 @@ ipoib_reg_addrs(
 \r
                /* Take a reference for each service request. */\r
                cl_obj_ref(&p_adapter->obj);\r
+                       IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_OBJ,\r
+                               ("[%p] Adapter refcount raised to %d\n", p_adapter, p_adapter->obj.ref_cnt));\r
                ib_status = p_adapter->p_ifc->reg_svc(\r
                        p_adapter->h_al, &ib_service, &p_addr_item->p_reg->h_reg_svc );\r
                if( ib_status != IB_SUCCESS )\r
@@ -3960,6 +3962,8 @@ ipoib_reg_addrs(
                                p_adapter->hung = TRUE;\r
                        }\r
                        cl_obj_deref(&p_adapter->obj);\r
+                       IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_OBJ,\r
+                               ("Adapter[%p] refcnt decremented to %d\n", p_adapter, p_adapter->obj.ref_cnt));\r
                        cl_free( p_addr_item->p_reg );\r
                        p_addr_item->p_reg = NULL;\r
                }\r
@@ -4069,6 +4073,8 @@ __ipoib_ats_reg_cb(
 \r
        cl_obj_unlock( &p_reg->p_adapter->obj );\r
        cl_obj_deref(&p_reg->p_adapter->obj);\r
+       IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_OBJ,\r
+                       ("Adapter[%p] refcnt decremented to %d\n", p_reg->p_adapter, p_reg->p_adapter->obj.ref_cnt));\r
 \r
        IPOIB_EXIT( IPOIB_DBG_OID );\r
 }\r
index d6aea73..844a81f 100644 (file)
@@ -195,6 +195,10 @@ ipoib_endpt_ref(
        CL_ASSERT( p_endpt );\r
 \r
        cl_obj_ref( &p_endpt->obj );\r
+#if DBG\r
+       IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_OBJ,\r
+                               ("[%p] Endpt refcount raised to %d\n", p_endpt, p_endpt->obj.ref_cnt));\r
+#endif\r
        /*\r
         * Anytime we reference the endpoint, we're either receiving data\r
         * or trying to send data to that endpoint.  Clear the expired flag\r
@@ -208,6 +212,10 @@ ipoib_endpt_deref(
        IN                              ipoib_endpt_t* const            p_endpt )\r
 {\r
        cl_obj_deref( &p_endpt->obj );\r
+#if DBG\r
+       IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_OBJ,\r
+                               ("[%p] Endpt refcount decremented to %d\n", p_endpt, p_endpt->obj.ref_cnt));\r
+#endif\r
 }\r
 \r
 \r
index 670eafe..e2c1d3a 100644 (file)
@@ -579,6 +579,9 @@ inline void ipoib_port_ref( ipoib_port_t * p_port, int type )
        cl_obj_ref( &p_port->obj );\r
 #if DBG\r
        cl_atomic_inc( &p_port->ref[type % ref_mask] );\r
+       IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_OBJ,\r
+                               ("Port[%d] refcount raised to %d\n", p_port->port_num, p_port->obj.ref_cnt));\r
+\r
        if ((p_port->obj.ref_cnt % 20)==0)\r
        IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_OBJ,\r
                ("ref type %d ref_cnt %d\n", type, p_port->obj.ref_cnt) );\r
@@ -590,16 +593,17 @@ inline void ipoib_port_ref( ipoib_port_t * p_port, int type )
 \r
 inline void ipoib_port_deref(ipoib_port_t * p_port, int type)\r
 {\r
+       cl_obj_deref( &p_port->obj );\r
 #if DBG\r
        cl_atomic_dec( &p_port->ref[type % ref_mask] );\r
+       IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_OBJ,\r
+                               ("Port[%d] refcount decremented to %d\n", p_port->port_num, p_port->obj.ref_cnt));\r
        if ((p_port->obj.ref_cnt % 20) == 0)\r
        IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_OBJ,\r
                ("deref type %d ref_cnt %d\n", type, p_port->obj.ref_cnt) );\r
 #else\r
        UNREFERENCED_PARAMETER(type);\r
 #endif\r
-       cl_obj_deref( &p_port->obj );\r
-\r
 }\r
 \r
 /* function returns pointer to payload that is going after IP header.\r