[IBAL] Add WPP tracing to KAL and UAL.
authorftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 8 Jun 2006 17:10:14 +0000 (17:10 +0000)
committerftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 8 Jun 2006 17:10:14 +0000 (17:10 +0000)
Signed-off-by: Yossi Leybovich (sleybo@mellanox.co.il)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@381 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

67 files changed:
core/al/al.c
core/al/al_av.c
core/al/al_ca.c
core/al/al_ci_ca_shared.c
core/al/al_cm_qp.c
core/al/al_cm_shared.c
core/al/al_common.c
core/al/al_common.h
core/al/al_cq.c
core/al/al_debug.h
core/al/al_dm.c
core/al/al_init.c
core/al/al_mad.c
core/al/al_mad_pool.h
core/al/al_mcast.c
core/al/al_mgr_shared.c
core/al/al_mr_shared.c
core/al/al_mw.c
core/al/al_pd.c
core/al/al_qp.c
core/al/al_query.c
core/al/al_reg_svc.c
core/al/al_res_mgr.c
core/al/al_sub.c
core/al/kernel/SOURCES
core/al/kernel/al_ci_ca.c
core/al/kernel/al_cm.c
core/al/kernel/al_cm_cep.c
core/al/kernel/al_cm_conn.c
core/al/kernel/al_cm_sidr.c
core/al/kernel/al_dev.c
core/al/kernel/al_ioc_pnp.c
core/al/kernel/al_mad_pool.c
core/al/kernel/al_mgr.c
core/al/kernel/al_mr.c
core/al/kernel/al_pnp.c
core/al/kernel/al_proxy.c
core/al/kernel/al_proxy_cep.c
core/al/kernel/al_proxy_cm.c
core/al/kernel/al_proxy_subnet.c
core/al/kernel/al_proxy_verbs.c
core/al/kernel/al_sa_req.c
core/al/kernel/al_smi.c
core/al/user/SOURCES
core/al/user/al_dll.c
core/al/user/al_mad_pool.c
core/al/user/ual_av.c
core/al/user/ual_ca.c
core/al/user/ual_ci_ca.c
core/al/user/ual_cm.c
core/al/user/ual_cm_cep.c
core/al/user/ual_cq.c
core/al/user/ual_mad.c
core/al/user/ual_mad_pool.c
core/al/user/ual_mcast.c
core/al/user/ual_mgr.c
core/al/user/ual_mr.c
core/al/user/ual_mw.c
core/al/user/ual_pd.c
core/al/user/ual_pnp.c
core/al/user/ual_qp.c
core/al/user/ual_sa_req.c
core/al/user/ual_support.h
core/bus/kernel/SOURCES
core/bus/kernel/bus_driver.c
core/bus/kernel/ib_bus.inf
inc/iba/ib_types.h

index af2fdbd..0a71d42 100644 (file)
 #include "al_cm_cep.h"\r
 #include "al_common.h"\r
 #include "al_debug.h"\r
+\r
+#if defined(EVENT_TRACING)\r
+#ifdef offsetof\r
+#undef offsetof\r
+#endif\r
+#include "al.tmh"\r
+#endif\r
+\r
 #include "al_mad_pool.h"\r
 #include "al_mgr.h"\r
 #include "al_verbs.h"\r
@@ -67,18 +75,18 @@ do_close_al(
        IN              const   ib_al_handle_t                          h_al )\r
 #endif\r
 {\r
-       CL_ENTER( AL_DBG_MGR, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MGR );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_al, AL_OBJ_TYPE_H_AL ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_AL_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_AL_HANDLE\n") );\r
                return IB_INVALID_AL_HANDLE;\r
        }\r
 \r
        ref_al_obj( &h_al->obj );\r
        h_al->obj.pfn_destroy( &h_al->obj, NULL );\r
 \r
-       CL_EXIT( AL_DBG_MGR, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MGR );\r
        return IB_SUCCESS;\r
 }\r
 \r
@@ -133,7 +141,7 @@ __free_mads(
                status = ib_put_mad( &p_mad_element->element );\r
                if( status != IB_SUCCESS )\r
                {\r
-                       CL_TRACE( AL_DBG_ERROR, g_al_dbg_lvl,\r
+                       AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                                ("ib_put_mad failed with status %s, continuing.\n",\r
                                ib_get_err_str(status)) );\r
                }\r
@@ -173,16 +181,16 @@ ib_query_ca_by_guid(
        ib_ca_handle_t          h_ca;\r
        ib_api_status_t         status;\r
 \r
-       CL_ENTER( AL_DBG_CA, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_CA );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_al, AL_OBJ_TYPE_H_AL ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_AL_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_AL_HANDLE\n") );\r
                return IB_INVALID_AL_HANDLE;\r
        }\r
        if( !p_size )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
@@ -194,7 +202,7 @@ ib_query_ca_by_guid(
        status = ib_query_ca( h_ca, p_ca_attr, p_size );\r
        deref_al_obj( &h_ca->obj );\r
 \r
-       CL_EXIT( AL_DBG_CA, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_CA );\r
        return status;\r
 }\r
 \r
@@ -408,7 +416,7 @@ ib_cancel_query(
 \r
        if( AL_OBJ_INVALID_HANDLE( h_al, AL_OBJ_TYPE_H_AL ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_AL_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_AL_HANDLE\n") );\r
                return;\r
        }\r
 \r
index 89b2486..503b22b 100644 (file)
 #include "al.h"\r
 #include "al_av.h"\r
 #include "al_debug.h"\r
+\r
+#if defined(EVENT_TRACING)\r
+#ifdef offsetof\r
+#undef offsetof\r
+#endif\r
+#include "al_av.tmh"\r
+#endif\r
+\r
 #include "al_pd.h"\r
 #include "al_res_mgr.h"\r
 #include "al_verbs.h"\r
@@ -118,13 +126,13 @@ create_av(
 \r
        if( !p_av_attr || !ph_av )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_pd, AL_OBJ_TYPE_H_PD ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PD_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PD_HANDLE\n") );\r
                return IB_INVALID_PD_HANDLE;\r
        }\r
 \r
@@ -161,18 +169,18 @@ ib_api_status_t
 ib_destroy_av(\r
        IN              const   ib_av_handle_t                          h_av )\r
 {\r
-       CL_ENTER( AL_DBG_AV, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_AV );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_av, AL_OBJ_TYPE_H_AV ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_AV_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_AV_HANDLE\n") );\r
                return IB_INVALID_AV_HANDLE;\r
        }\r
 \r
        ref_al_obj( &h_av->obj );\r
        h_av->obj.pfn_destroy( &h_av->obj, NULL );\r
 \r
-       CL_EXIT( AL_DBG_AV, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_AV );\r
        return IB_SUCCESS;\r
 }\r
 \r
@@ -235,16 +243,16 @@ query_av(
 {\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_AV, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_AV );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_av, AL_OBJ_TYPE_H_AV ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_AV_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_AV_HANDLE\n") );\r
                return IB_INVALID_AV_HANDLE;\r
        }\r
        if( !p_av_attr || !ph_pd )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
@@ -257,7 +265,7 @@ query_av(
                h_av->av_attr = *p_av_attr;\r
        }\r
 \r
-       CL_EXIT( AL_DBG_AV, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_AV );\r
        return status;\r
 }\r
 \r
@@ -280,16 +288,16 @@ modify_av(
 {\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_AV, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_AV );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_av, AL_OBJ_TYPE_H_AV ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_AV_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_AV_HANDLE\n") );\r
                return IB_INVALID_AV_HANDLE;\r
        }\r
        if( !p_av_mod )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
@@ -301,6 +309,6 @@ modify_av(
                h_av->av_attr = *p_av_mod;\r
        }\r
 \r
-       CL_EXIT( AL_DBG_AV, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_AV );\r
        return status;\r
 }\r
index 7ebacd5..efc3445 100644 (file)
 #include "al_ca.h"\r
 #include "al_cq.h"\r
 #include "al_debug.h"\r
+\r
+#if defined(EVENT_TRACING)\r
+#ifdef offsetof\r
+#undef offsetof\r
+#endif\r
+#include "al_ca.tmh"\r
+#endif\r
+\r
 #include "al_mgr.h"\r
 #include "al_mr.h"\r
 #include "al_mw.h"\r
@@ -73,7 +81,7 @@ ib_open_ca(
 \r
        if( AL_OBJ_INVALID_HANDLE( h_al, AL_OBJ_TYPE_H_AL ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_AL_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_AL_HANDLE\n") );\r
                return IB_INVALID_AL_HANDLE;\r
        }\r
 \r
@@ -100,10 +108,10 @@ open_ca(
        ib_api_status_t                 status;\r
        al_obj_type_t                   obj_type = AL_OBJ_TYPE_H_CA;\r
 \r
-       CL_ENTER( AL_DBG_CA, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_CA );\r
        if( !ph_ca )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
@@ -111,7 +119,7 @@ open_ca(
        h_ca = (ib_ca_handle_t)cl_zalloc( sizeof( ib_ca_t ) );\r
        if( !h_ca )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("IB_INSUFFICIENT_MEMORY\n") );\r
                return IB_INSUFFICIENT_MEMORY;\r
        }\r
@@ -127,7 +135,7 @@ open_ca(
        if( status != IB_SUCCESS )\r
        {\r
                __free_ca( &h_ca->obj );\r
-               CL_EXIT( AL_DBG_CA, g_al_dbg_lvl );\r
+               AL_EXIT( AL_DBG_CA );\r
                return status;\r
        }\r
 \r
@@ -144,7 +152,7 @@ open_ca(
        if( !h_ca->obj.p_ci_ca )\r
        {\r
                h_ca->obj.pfn_destroy( &h_ca->obj, NULL );\r
-               CL_EXIT( AL_DBG_CA, g_al_dbg_lvl );\r
+               AL_EXIT( AL_DBG_CA );\r
                return IB_INVALID_GUID;\r
        }\r
 \r
@@ -157,7 +165,7 @@ open_ca(
                if( status != IB_SUCCESS )\r
                {\r
                        h_ca->obj.pfn_destroy( &h_ca->obj, NULL );\r
-                       CL_EXIT( AL_DBG_CA, g_al_dbg_lvl );\r
+                       AL_EXIT( AL_DBG_CA );\r
                        return status;\r
                }\r
        }\r
@@ -165,7 +173,7 @@ open_ca(
 \r
        *ph_ca = h_ca;\r
 \r
-       CL_EXIT( AL_DBG_CA, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_CA );\r
        return IB_SUCCESS;\r
 }\r
 \r
@@ -178,18 +186,18 @@ ib_close_ca(
        IN              const   ib_ca_handle_t                          h_ca,\r
        IN              const   ib_pfn_destroy_cb_t                     pfn_destroy_cb OPTIONAL )\r
 {\r
-       CL_ENTER( AL_DBG_CA, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_CA );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_ca, AL_OBJ_TYPE_H_CA ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_CA_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_CA_HANDLE\n") );\r
                return IB_INVALID_CA_HANDLE;\r
        }\r
 \r
        ref_al_obj( &h_ca->obj );\r
        h_ca->obj.pfn_destroy( &h_ca->obj, pfn_destroy_cb );\r
 \r
-       CL_EXIT( AL_DBG_CA, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_CA );\r
        return IB_SUCCESS;\r
 }\r
 \r
@@ -255,22 +263,22 @@ query_ca(
 {\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_CA, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_CA );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_ca, AL_OBJ_TYPE_H_CA ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_CA_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_CA_HANDLE\n") );\r
                return IB_INVALID_CA_HANDLE;\r
        }\r
        if( !p_size )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
        status = verbs_query_ca( h_ca, p_ca_attr, p_size );\r
 \r
-       CL_EXIT( AL_DBG_CA, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_CA );\r
        return status;\r
 }\r
 \r
@@ -285,22 +293,22 @@ ib_modify_ca(
 {\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_CA, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_CA );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_ca, AL_OBJ_TYPE_H_CA ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_CA_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_CA_HANDLE\n") );\r
                return IB_INVALID_CA_HANDLE;\r
        }\r
        if( !p_port_attr_mod )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
        status = verbs_modify_ca(h_ca, port_num, ca_mod, p_port_attr_mod);\r
 \r
-       CL_EXIT( AL_DBG_CA, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_CA );\r
        return status;\r
 }\r
 \r
@@ -318,11 +326,11 @@ ib_alloc_pd(
 {\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_PD, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_PD );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_ca, AL_OBJ_TYPE_H_CA ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_CA_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_CA_HANDLE\n") );\r
                return IB_INVALID_CA_HANDLE;\r
        }\r
 \r
@@ -332,7 +340,7 @@ ib_alloc_pd(
        if( status == IB_SUCCESS )\r
                deref_al_obj( &(*ph_pd)->obj );\r
 \r
-       CL_EXIT( AL_DBG_PD, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_PD );\r
        return status;\r
 }\r
 \r
@@ -348,11 +356,11 @@ ib_create_cq(
 {\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_CQ, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_CQ );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_ca, AL_OBJ_TYPE_H_CA ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_CA_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_CA_HANDLE\n") );\r
                return IB_INVALID_CA_HANDLE;\r
        }\r
 \r
@@ -363,7 +371,7 @@ ib_create_cq(
        if( status == IB_SUCCESS )\r
                deref_al_obj( &(*ph_cq)->obj );\r
 \r
-       CL_EXIT( AL_DBG_CQ, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_CQ );\r
        return status;\r
 }\r
 \r
index a6b1a9e..354761e 100644 (file)
 #include "al_common.h"\r
 #include "al_cq.h"\r
 #include "al_debug.h"\r
+\r
+#if defined(EVENT_TRACING)\r
+#ifdef offsetof\r
+#undef offsetof\r
+#endif\r
+#include "al_ci_ca_shared.tmh"\r
+#endif\r
+\r
 #include "al_mgr.h"\r
 #include "al_pnp.h"\r
 #include "al_qp.h"\r
@@ -114,13 +122,13 @@ get_port_info(
        uint32_t                        attr_size;\r
        uint8_t                         i;\r
 \r
-       CL_ENTER( AL_DBG_CA, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_CA );\r
 \r
        /* Get the size of the CA attribute structure. */\r
        status = ib_query_ca( p_ci_ca->h_ca, NULL, &attr_size );\r
        if( status != IB_INSUFFICIENT_MEMORY )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("ib_query_ca failed with status %s.\n", ib_get_err_str(status)) );\r
                return status;\r
        }\r
@@ -129,7 +137,7 @@ get_port_info(
        p_ca_attr = cl_malloc( attr_size );\r
        if( !p_ca_attr )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("cl_malloc failed to allocate p_ca_attr!\n") );\r
                return IB_INSUFFICIENT_RESOURCES;\r
        }\r
@@ -140,7 +148,7 @@ get_port_info(
        {\r
                cl_free( p_ca_attr );\r
 \r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("ib_query_ca failed with status %s.\n", ib_get_err_str(status)) );\r
                return status;\r
        }\r
@@ -152,7 +160,7 @@ get_port_info(
        {\r
                cl_free( p_ca_attr );\r
 \r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("cl_malloc failed to allocate port_array!\n") );\r
                return IB_INSUFFICIENT_RESOURCES;\r
        }\r
@@ -177,7 +185,7 @@ get_port_info(
 \r
        cl_free( p_ca_attr );\r
 \r
-       CL_EXIT( AL_DBG_CA, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_CA );\r
        return IB_SUCCESS;\r
 }\r
 \r
@@ -191,7 +199,7 @@ ci_ca_async_event(
        cl_pool_item_t*                 p_item;\r
        event_item_t*                   p_event_item;\r
 \r
-       CL_ENTER( AL_DBG_CA, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_CA );\r
 \r
        CL_ASSERT( p_event_rec );\r
 \r
@@ -203,7 +211,7 @@ ci_ca_async_event(
        {\r
                /* Ignore events if the object is being destroyed. */\r
                cl_spinlock_release( &p_obj->lock );\r
-               CL_EXIT( AL_DBG_CA, g_al_dbg_lvl );\r
+               AL_EXIT( AL_DBG_CA );\r
                return;\r
        }\r
 \r
@@ -226,7 +234,7 @@ ci_ca_async_event(
        {\r
                /* Could not get an item.  This event will not be reported. */\r
                cl_spinlock_release( &p_obj->lock );\r
-               CL_EXIT( AL_DBG_CA, g_al_dbg_lvl );\r
+               AL_EXIT( AL_DBG_CA );\r
                return;\r
        }\r
 \r
@@ -244,7 +252,7 @@ ci_ca_async_event(
        p_event_item->async_item.pfn_callback = ci_ca_process_event_cb;\r
        cl_async_proc_queue( gp_async_proc_mgr, &p_event_item->async_item );\r
 \r
-       CL_EXIT( AL_DBG_CA, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_CA );\r
 }\r
 \r
 \r
@@ -256,7 +264,7 @@ ci_ca_process_event_cb(
        event_item_t*                   p_event_item;\r
        al_obj_t*                               p_obj;\r
 \r
-       CL_ENTER( AL_DBG_CA, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_CA );\r
 \r
        CL_ASSERT( p_async_item );\r
 \r
@@ -333,7 +341,7 @@ ci_ca_process_event_cb(
        /* Dereference the object. */\r
        deref_al_obj( p_obj );\r
 \r
-       CL_EXIT( AL_DBG_CA, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_CA );\r
 }\r
 \r
 \r
@@ -441,11 +449,11 @@ get_port_attr(
        uintn_t                 port_index, gid_index;\r
        ib_port_attr_t  *p_port_attr;\r
 \r
-       CL_ENTER( AL_DBG_CA, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_CA );\r
 \r
        if( !p_ca_attr || !p_gid )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("No p_ca_attr or p_gid.\n") );\r
                return NULL;\r
        }\r
@@ -460,13 +468,13 @@ get_port_attr(
                        if( !cl_memcmp( &p_port_attr->p_gid_table[gid_index],\r
                                p_gid, sizeof(ib_gid_t) ) )\r
                        {\r
-                               CL_EXIT( AL_DBG_CA, g_al_dbg_lvl );\r
+                               AL_EXIT( AL_DBG_CA );\r
                                return p_port_attr;\r
                        }\r
                }\r
        }\r
 \r
-       CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("No match found.\n") );\r
+       AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("No match found.\n") );\r
        return NULL;\r
 }\r
 \r
@@ -503,7 +511,7 @@ ci_ca_update_attr(
        uint32_t                        attr_size;\r
        ib_api_status_t         status;\r
 \r
-       CL_ENTER( AL_DBG_CA, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_CA );\r
 \r
        /* Query to get the CA attributes size. */\r
        attr_size = 0;\r
@@ -517,7 +525,7 @@ ci_ca_update_attr(
        p_pnp_attr = (ib_ca_attr_t*)cl_zalloc( attr_size * 2 );\r
        if( !p_pnp_attr )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_CA, g_al_dbg_lvl,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_WARNING, AL_DBG_CA,\r
                        ("Unable to allocate buffer for PnP attributes\n") );\r
                return IB_INSUFFICIENT_MEMORY;\r
        }\r
@@ -526,7 +534,7 @@ ci_ca_update_attr(
        status = ib_query_ca( p_ci_ca->h_ca, p_pnp_attr, &attr_size );\r
        if( status != IB_SUCCESS )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_CA, g_al_dbg_lvl,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_WARNING, AL_DBG_CA,\r
                        ("Unable to query attributes\n") );\r
                cl_free( p_pnp_attr );\r
                return status;\r
@@ -544,7 +552,7 @@ ci_ca_update_attr(
        p_ci_ca->p_user_attr = (ib_ca_attr_t*)(((uint8_t*)p_pnp_attr) + attr_size);\r
        ci_ca_unlock_attr( p_ci_ca );\r
 \r
-       CL_EXIT( AL_DBG_CA, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_CA );\r
        return IB_SUCCESS;\r
 }\r
 \r
index 518284f..7168f26 100644 (file)
 #include "al_debug.h"\r
 \r
 \r
+#if defined(EVENT_TRACING)\r
+#ifdef offsetof\r
+#undef offsetof\r
+#endif\r
+#include "al_cm_qp.tmh"\r
+#endif\r
+\r
 typedef struct _al_listen\r
 {\r
        al_obj_t                                        obj;\r
@@ -101,7 +108,7 @@ __cep_timewait_qp(
                        ( (h_qp->obj.state != CL_INITIALIZED) && \r
                        (h_qp->obj.state != CL_DESTROYING) ) )\r
                {\r
-                       AL_TRACE_EXIT( AL_DBG_CM, ("IB_INVALID_QP_HANDLE\n") );\r
+                       AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_QP_HANDLE\n") );\r
                        return;\r
                }\r
 \r
@@ -112,7 +119,7 @@ __cep_timewait_qp(
                status = h_qp->pfn_modify_qp( h_qp, &qp_mod, NULL );\r
                if( status != IB_SUCCESS )\r
                {\r
-                       AL_TRACE_EXIT( AL_DBG_ERROR,\r
+                       AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                                ("pfn_modify_qp to IB_QPS_ERROR returned %s\n",\r
                                ib_get_err_str( status )) );\r
                        return;\r
@@ -415,7 +422,7 @@ __proc_failed_send(
                __proc_dconn_timeout( h_qp );\r
                break;\r
        default:\r
-               AL_TRACE( AL_DBG_ERROR,\r
+               AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("Invalid CM send MAD attribute ID %d.\n", p_mad->attr_id) );\r
                break;\r
        }\r
@@ -720,7 +727,7 @@ __cep_lap_qp(
        status = al_cep_get_rts_attr( p_cm->h_al, p_cm->cid, &qp_mod );\r
        if( status != IB_SUCCESS )\r
        {\r
-               AL_TRACE( AL_DBG_ERROR,\r
+               AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("al_cep_get_rts_attr returned %s.\n", ib_get_err_str(status)) );\r
                goto done;\r
        }\r
@@ -728,7 +735,7 @@ __cep_lap_qp(
        status = ib_modify_qp( p_cm->h_qp, &qp_mod );\r
        if( status != IB_SUCCESS )\r
        {\r
-               AL_TRACE( AL_DBG_ERROR,\r
+               AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("ib_modify_qp for LAP returned %s.\n", ib_get_err_str(status)) );\r
        }\r
 \r
@@ -840,7 +847,7 @@ __proc_conn(
        //      break;\r
 \r
        default:\r
-               AL_TRACE( AL_DBG_ERROR,\r
+               AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("Invalid CM recv MAD attribute ID %d.\n", p_mad->attr_id) );\r
        }\r
 \r
@@ -935,7 +942,7 @@ __cm_handler(
        p_async_mad = (cep_async_mad_t*)cl_zalloc( sizeof(cep_async_mad_t) );\r
        if( !p_async_mad )\r
        {\r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("failed to cl_zalloc cm_async_mad_t (%d bytes)\n",\r
                        sizeof(cep_async_mad_t)) );\r
                return;\r
@@ -980,7 +987,7 @@ __cep_init_qp(
                status = ib_modify_qp( h_qp, &qp_mod );\r
                if( status != IB_SUCCESS )\r
                {\r
-                       AL_TRACE( AL_DBG_ERROR,\r
+                       AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                                ("ib_modify_qp to IB_QPS_RESET returned %s\n",\r
                                ib_get_err_str(status) ) );\r
                }\r
@@ -989,7 +996,7 @@ __cep_init_qp(
                status = ib_modify_qp( h_qp, p_init );\r
                if( status != IB_SUCCESS )\r
                {\r
-                       AL_TRACE( AL_DBG_ERROR,\r
+                       AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                                ("ib_modify_qp returned %s.\n", ib_get_err_str(status) ) );\r
                        return status;\r
                }\r
@@ -1011,7 +1018,7 @@ __cep_pre_req(
                ((al_conn_qp_t*)p_cm_req->h_qp)->cid, p_cm_req, &qp_mod );\r
        if( status != IB_SUCCESS )\r
        {\r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("al_cep_pre_req returned %s.\n", ib_get_err_str( status )) );\r
                return status;\r
        }\r
@@ -1026,7 +1033,7 @@ __cep_pre_req(
        status = __cep_init_qp( p_cm_req->h_qp, &qp_mod );\r
        if( status != IB_SUCCESS )\r
        {\r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("__cep_init_qp returned %s\n", ib_get_err_str(status)) );\r
                return status;\r
        }\r
@@ -1071,7 +1078,7 @@ __cep_conn_req(
        status = al_create_cep( h_al, __cm_handler, p_cm_req->h_qp, &cid );\r
        if( status != IB_SUCCESS )\r
        {\r
-               AL_TRACE( AL_DBG_ERROR,\r
+               AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("al_create_cep returned %s.\n", ib_get_err_str( status )) );\r
                goto done;\r
        }\r
@@ -1088,7 +1095,7 @@ __cep_conn_req(
        status = __cep_pre_req( p_cm_req );\r
        if( status != IB_SUCCESS )\r
        {\r
-               AL_TRACE( AL_DBG_ERROR,\r
+               AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("__cep_pre_req returned %s.\n", ib_get_err_str( status )) );\r
                goto err;\r
        }\r
@@ -1106,7 +1113,7 @@ __cep_conn_req(
                //if( p_sync_event )\r
                //      cl_event_destroy( p_sync_event );\r
 \r
-               AL_TRACE( AL_DBG_ERROR,\r
+               AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("al_cep_send_req returned %s.\n", ib_get_err_str(status)) );\r
 err:\r
                ref_al_obj( &p_qp->qp.obj );\r
@@ -1118,7 +1125,7 @@ err:
        /* wait on event if synchronous operation */\r
        //if( p_sync_event )\r
        //{\r
-       //      CL_TRACE( AL_DBG_CM, g_al_dbg_lvl,\r
+       //      AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_CM,\r
        //              ("event blocked on REQ...\n") );\r
        //      cl_event_wait_on( p_sync_event, EVENT_NO_TIMEOUT, FALSE );\r
 \r
@@ -1141,7 +1148,7 @@ ib_cm_req(
 \r
        if( !p_cm_req )\r
        {\r
-               AL_TRACE_EXIT( AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
@@ -1149,7 +1156,7 @@ ib_cm_req(
        switch( p_cm_req->qp_type )\r
        {\r
        default:\r
-               AL_TRACE_EXIT( AL_DBG_ERROR, ("Invalid qp_type.\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("Invalid qp_type.\n") );\r
                return IB_INVALID_SETTING;\r
 \r
        case IB_QPT_RELIABLE_CONN:\r
@@ -1157,7 +1164,7 @@ ib_cm_req(
                if( AL_OBJ_INVALID_HANDLE( p_cm_req->h_qp, AL_OBJ_TYPE_H_QP ) ||\r
                        (p_cm_req->h_qp->type != p_cm_req->qp_type) )\r
                {\r
-                       AL_TRACE_EXIT( AL_DBG_ERROR, ("IB_INVALID_QP_HANDLE\n") );\r
+                       AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_QP_HANDLE\n") );\r
                        return IB_INVALID_QP_HANDLE;\r
                }\r
 \r
@@ -1167,7 +1174,7 @@ ib_cm_req(
        case IB_QPT_UNRELIABLE_DGRM:\r
                if( AL_OBJ_INVALID_HANDLE( p_cm_req->h_al, AL_OBJ_TYPE_H_AL ) )\r
                {\r
-                       AL_TRACE_EXIT( AL_DBG_ERROR, ("IB_INVALID_AL_HANDLE\n") );\r
+                       AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_AL_HANDLE\n") );\r
                        return IB_INVALID_AL_HANDLE;\r
                }\r
                status = IB_UNSUPPORTED;\r
@@ -1202,7 +1209,7 @@ __cep_rts_qp(
        status = al_cep_get_rtr_attr( h_cm.h_al, h_cm.cid, &qp_mod );\r
        if( status != IB_SUCCESS )\r
        {\r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("al_cep_get_rtr_attr returned %s\n", ib_get_err_str( status )) );\r
                return status;\r
        }\r
@@ -1228,7 +1235,7 @@ __cep_rts_qp(
        status = ib_modify_qp( h_qp, &qp_mod );\r
        if( status != IB_SUCCESS )\r
        {\r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("ib_modify_qp to RTR returned %s.\n", ib_get_err_str(status) ) );\r
                return status;\r
        }\r
@@ -1237,7 +1244,7 @@ __cep_rts_qp(
        status = al_cep_get_rts_attr( h_cm.h_al, h_cm.cid, &qp_mod );\r
        if( status != IB_SUCCESS )\r
        {\r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("al_cep_get_rts_attr returned %s\n", ib_get_err_str( status )) );\r
                return status;\r
        }\r
@@ -1245,7 +1252,7 @@ __cep_rts_qp(
        status = ib_modify_qp( h_qp, &qp_mod );\r
        if( status != IB_SUCCESS )\r
        {\r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("ib_modify_qp to RTS returned %s.\n", ib_get_err_str(status) ) );\r
                return status;\r
        }\r
@@ -1270,7 +1277,7 @@ __cep_pre_rep(
        status = __cep_init_qp( p_cm_rep->h_qp, p_qp_mod );\r
        if( status != IB_SUCCESS )\r
        {\r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("cm_init_qp returned %s.\n", ib_get_err_str(status)) );\r
                return status;\r
        }\r
@@ -1282,7 +1289,7 @@ __cep_pre_rep(
                        (ib_recv_wr_t** __ptr64)p_cm_rep->pp_recv_failure );\r
                if( status != IB_SUCCESS )\r
                {\r
-                       AL_TRACE_EXIT( AL_DBG_ERROR,\r
+                       AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                                ("ib_post_recv returned %s.\n", ib_get_err_str(status)) );\r
                        return status;\r
                }\r
@@ -1293,7 +1300,7 @@ __cep_pre_rep(
                p_cm_rep->access_ctrl, p_cm_rep->sq_depth, p_cm_rep->rq_depth );\r
        if( status != IB_SUCCESS )\r
        {\r
-               AL_TRACE( AL_DBG_ERROR,\r
+               AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("__cep_rts_qp returned %s.\n", ib_get_err_str(status)) );\r
        }\r
 \r
@@ -1320,7 +1327,7 @@ __cep_conn_rep(
        if( cid != AL_INVALID_CID )\r
        {\r
                /* We don't destroy the CEP to allow the user to retry accepting. */\r
-               AL_TRACE_EXIT( AL_DBG_ERROR, ("QP already connected.\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("QP already connected.\n") );\r
                return IB_INVALID_QP_HANDLE;\r
        }\r
 \r
@@ -1335,7 +1342,7 @@ __cep_conn_rep(
                h_cm.h_al, h_cm.cid, p_cm_rep->h_qp, p_cm_rep, &qp_mod );\r
        if( status != IB_SUCCESS )\r
        {\r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("al_cep_pre_rep returned %s.\n", ib_get_err_str( status )) );\r
                goto err;\r
        }\r
@@ -1347,7 +1354,7 @@ __cep_conn_rep(
        status = __cep_pre_rep( h_cm, &qp_mod, p_cm_rep );\r
        if( status != IB_SUCCESS )\r
        {\r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("__cep_pre_req returned %s\n", ib_get_err_str(status)) );\r
                goto err;\r
        }\r
@@ -1355,7 +1362,7 @@ __cep_conn_rep(
        status = al_cep_send_rep( h_cm.h_al, h_cm.cid );\r
        if( status != IB_SUCCESS )\r
        {\r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("al_cep_send_rep returned %s\n", ib_get_err_str(status)) );\r
 err:\r
                cl_atomic_xchg(\r
@@ -1393,7 +1400,7 @@ ib_cm_rep(
 \r
        if( !p_cm_rep )\r
        {\r
-               AL_TRACE_EXIT( AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
@@ -1402,7 +1409,7 @@ ib_cm_rep(
        switch( p_cm_rep->qp_type )\r
        {\r
        default:\r
-               AL_TRACE( AL_DBG_ERROR, ("Invalid qp_type.\n") );\r
+               AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("Invalid qp_type.\n") );\r
                status = IB_INVALID_SETTING;\r
                break;\r
 \r
@@ -1411,12 +1418,12 @@ ib_cm_rep(
                if( AL_OBJ_INVALID_HANDLE( p_cm_rep->h_qp, AL_OBJ_TYPE_H_QP ) ||\r
                        (p_cm_rep->h_qp->type != p_cm_rep->qp_type) )\r
                {\r
-                       AL_TRACE_EXIT( AL_DBG_ERROR, ("IB_INVALID_QP_HANDLE\n") );\r
+                       AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_QP_HANDLE\n") );\r
                        status = IB_INVALID_QP_HANDLE;\r
                }\r
                else if( p_cm_rep->h_qp->obj.h_al != h_cm_req.h_al )\r
                {\r
-                       AL_TRACE_EXIT( AL_DBG_ERROR, ("IB_INVALID_QP_HANDLE\n") );\r
+                       AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_QP_HANDLE\n") );\r
                        status = IB_INVALID_QP_HANDLE;\r
                }\r
                break;\r
@@ -1426,7 +1433,7 @@ ib_cm_rep(
                        (AL_OBJ_INVALID_HANDLE( p_cm_rep->h_qp, AL_OBJ_TYPE_H_QP ) ||\r
                        (p_cm_rep->h_qp->type != p_cm_rep->qp_type) ) )\r
                {\r
-                       AL_TRACE_EXIT( AL_DBG_ERROR, ("IB_INVALID_QP_HANDLE\n") );\r
+                       AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_QP_HANDLE\n") );\r
                        status = IB_INVALID_QP_HANDLE;\r
                }\r
                break;\r
@@ -1464,7 +1471,7 @@ ib_cm_rtu(
 \r
        if( !p_cm_rtu )\r
        {\r
-               AL_TRACE_EXIT( AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
@@ -1474,7 +1481,7 @@ ib_cm_rtu(
        // */\r
        //if( p_conn->p_sync_event )\r
        //{\r
-       //      CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl,\r
+       //      AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
        //              ("Connection in invalid state. Sync call in progress.\n" ) );\r
 \r
        //      cm_res_release( p_conn );\r
@@ -1489,7 +1496,7 @@ ib_cm_rtu(
                p_cm_rtu->access_ctrl, p_cm_rtu->sq_depth, p_cm_rtu->rq_depth );\r
        if( status != IB_SUCCESS )\r
        {\r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("__cep_rts_qp returned %s.\n", ib_get_err_str( status )) );\r
                goto err;\r
        }\r
@@ -1520,7 +1527,7 @@ err:
                        }\r
                }\r
 \r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("al_cep_rtu returned %s.\n", ib_get_err_str( status )) );\r
                return status;\r
        }\r
@@ -1541,14 +1548,14 @@ ib_cm_mra(
 \r
        if( !p_cm_mra )\r
        {\r
-               AL_TRACE_EXIT( AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
        status = al_cep_mra( h_cm.h_al, h_cm.cid, p_cm_mra );\r
        if( status != IB_SUCCESS )\r
        {\r
-               AL_TRACE( AL_DBG_ERROR,\r
+               AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("al_cep_mra returned %s\n", ib_get_err_str( status )) );\r
        }\r
 \r
@@ -1569,7 +1576,7 @@ ib_cm_rej(
 \r
        if( !p_cm_rej )\r
        {\r
-               AL_TRACE_EXIT( AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
@@ -1607,7 +1614,7 @@ ib_cm_dreq(
 \r
        if( !p_cm_dreq )\r
        {\r
-               AL_TRACE_EXIT( AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
@@ -1615,7 +1622,7 @@ ib_cm_dreq(
        switch( p_cm_dreq->qp_type )\r
        {\r
        default:\r
-               AL_TRACE_EXIT( AL_DBG_ERROR, ("Invalid qp_type.\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("Invalid qp_type.\n") );\r
                return IB_INVALID_SETTING;\r
 \r
        case IB_QPT_RELIABLE_CONN:\r
@@ -1623,7 +1630,7 @@ ib_cm_dreq(
                if( AL_OBJ_INVALID_HANDLE( p_cm_dreq->h_qp, AL_OBJ_TYPE_H_QP ) ||\r
                        (p_cm_dreq->h_qp->type != p_cm_dreq->qp_type) )\r
                {\r
-                       AL_TRACE_EXIT( AL_DBG_ERROR, ("IB_INVALID_QP_HANDLE\n") );\r
+                       AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_QP_HANDLE\n") );\r
                        return IB_INVALID_QP_HANDLE;\r
                }\r
                break;\r
@@ -1688,7 +1695,7 @@ ib_cm_drep(
 \r
        if( !p_cm_drep )\r
        {\r
-               AL_TRACE_EXIT( AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
@@ -1741,7 +1748,7 @@ ib_cm_lap(
 \r
        if( !p_cm_lap )\r
        {\r
-               AL_TRACE_EXIT( AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
@@ -1749,7 +1756,7 @@ ib_cm_lap(
        switch( p_cm_lap->qp_type )\r
        {\r
        default:\r
-               AL_TRACE_EXIT( AL_DBG_ERROR, ("Invalid qp_type.\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("Invalid qp_type.\n") );\r
                return IB_INVALID_SETTING;\r
 \r
        case IB_QPT_RELIABLE_CONN:\r
@@ -1757,7 +1764,7 @@ ib_cm_lap(
                if( AL_OBJ_INVALID_HANDLE( p_cm_lap->h_qp, AL_OBJ_TYPE_H_QP ) ||\r
                        (p_cm_lap->h_qp->type != p_cm_lap->qp_type) )\r
                {\r
-                       AL_TRACE_EXIT( AL_DBG_ERROR, ("IB_INVALID_QP_HANDLE\n") );\r
+                       AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_QP_HANDLE\n") );\r
                        return IB_INVALID_QP_HANDLE;\r
                }\r
                break;\r
@@ -1767,7 +1774,7 @@ ib_cm_lap(
                ((al_conn_qp_t*)p_cm_lap->h_qp)->cid, p_cm_lap );\r
        if( status != IB_SUCCESS )\r
        {\r
-               AL_TRACE( AL_DBG_ERROR,\r
+               AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("al_cep_lap returned %s.\n", ib_get_err_str( status )) );\r
        }\r
 \r
@@ -1788,7 +1795,7 @@ ib_cm_apr(
 \r
        if( !p_cm_apr )\r
        {\r
-               AL_TRACE_EXIT( AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
@@ -1796,7 +1803,7 @@ ib_cm_apr(
        switch( p_cm_apr->qp_type )\r
        {\r
        default:\r
-               AL_TRACE_EXIT( AL_DBG_ERROR, ("Invalid qp_type.\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("Invalid qp_type.\n") );\r
                return IB_INVALID_SETTING;\r
 \r
        case IB_QPT_RELIABLE_CONN:\r
@@ -1804,7 +1811,7 @@ ib_cm_apr(
                if( AL_OBJ_INVALID_HANDLE( p_cm_apr->h_qp, AL_OBJ_TYPE_H_QP ) ||\r
                        (p_cm_apr->h_qp->type != p_cm_apr->qp_type) )\r
                {\r
-                       AL_TRACE_EXIT( AL_DBG_ERROR, ("IB_INVALID_QP_HANDLE\n") );\r
+                       AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_QP_HANDLE\n") );\r
                        return IB_INVALID_QP_HANDLE;\r
                }\r
                break;\r
@@ -1813,7 +1820,7 @@ ib_cm_apr(
        status = al_cep_pre_apr( h_cm_lap.h_al, h_cm_lap.cid, p_cm_apr, &qp_mod );\r
        if( status != IB_SUCCESS )\r
        {\r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("al_cep_pre_apr returned %s.\n", ib_get_err_str( status )) );\r
                return status;\r
        }\r
@@ -1822,7 +1829,7 @@ ib_cm_apr(
        status = ib_modify_qp( h_cm_lap.h_qp, &qp_mod );\r
        if( status != IB_SUCCESS )\r
        {\r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("ib_modify_qp for LAP returned %s.\n",\r
                        ib_get_err_str( status )) );\r
                return status;\r
@@ -1847,7 +1854,7 @@ ib_force_apm(
 \r
        if( AL_OBJ_INVALID_HANDLE( h_qp, AL_OBJ_TYPE_H_QP ) )\r
        {\r
-               AL_TRACE_EXIT( AL_DBG_ERROR, ("IB_INVALID_QP_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_QP_HANDLE\n") );\r
                return IB_INVALID_QP_HANDLE;\r
        }\r
 \r
@@ -1879,7 +1886,7 @@ __destroying_listen(
                p_obj->h_al, p_listen->cid, deref_al_obj );\r
        if( status != IB_SUCCESS )\r
        {\r
-               AL_TRACE( AL_DBG_ERROR,\r
+               AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("al_destroy_cep returned %s.\n", ib_get_err_str( status )) );\r
                deref_al_obj( p_obj );\r
        }\r
@@ -1941,7 +1948,7 @@ __cep_listen(
        if( status != IB_SUCCESS )\r
        {\r
                p_listen->obj.pfn_destroy( &p_listen->obj, NULL );\r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("attach_al_obj returned %s.\n", ib_get_err_str(status)) );\r
                return status;\r
        }\r
@@ -1951,7 +1958,7 @@ __cep_listen(
        if( status != IB_SUCCESS )\r
        {\r
                p_listen->obj.pfn_destroy( &p_listen->obj, NULL );\r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("al_create_cep returned %s.\n", ib_get_err_str(status)) );\r
                return status;\r
        }\r
@@ -1969,7 +1976,7 @@ __cep_listen(
        if( status != IB_SUCCESS )\r
        {\r
                p_listen->obj.pfn_destroy( &p_listen->obj, NULL );\r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("al_cep_listen returned %s.\n", ib_get_err_str(status)) );\r
                return status;\r
        }\r
@@ -1998,19 +2005,19 @@ ib_cm_listen(
 \r
        if( AL_OBJ_INVALID_HANDLE( h_al, AL_OBJ_TYPE_H_AL ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_AL_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_AL_HANDLE\n") );\r
                return IB_INVALID_AL_HANDLE;\r
        }\r
        if( !p_cm_listen || !pfn_listen_err_cb || !ph_cm_listen )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
        status = __cep_listen(h_al, p_cm_listen, pfn_listen_err_cb, listen_context,\r
                ph_cm_listen );\r
 \r
-       CL_EXIT( AL_DBG_CM, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_CM );\r
        return status;\r
 }\r
 \r
@@ -2024,7 +2031,7 @@ ib_cm_cancel(
 \r
        if( AL_OBJ_INVALID_HANDLE( h_cm_listen, AL_OBJ_TYPE_H_LISTEN ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_HANDLE\n") );\r
                return IB_INVALID_HANDLE;\r
        }\r
 \r
index f46e428..7da15fe 100644 (file)
@@ -44,7 +44,7 @@ __reset_qp(
        ib_qp_mod_t                     qp_mod;\r
        ib_api_status_t         status;\r
 \r
-       CL_ENTER( AL_DBG_CM, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_CM );\r
 \r
        cl_memclr( &qp_mod, sizeof(ib_qp_mod_t) );\r
        qp_mod.req_state = IB_QPS_RESET;\r
@@ -52,12 +52,12 @@ __reset_qp(
        status = ib_modify_qp( h_qp, &qp_mod );\r
        if( status != IB_SUCCESS )\r
        {\r
-               CL_TRACE( AL_DBG_ERROR, g_al_dbg_lvl,\r
+               AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("ib_modify_qp to IB_QPS_RESET returned %s\n",\r
                        ib_get_err_str(status) ) );\r
        }\r
 \r
-       CL_EXIT( AL_DBG_CM, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_CM );\r
        return status;\r
 }\r
 \r
@@ -74,7 +74,7 @@ __init_qp(
        ib_qp_mod_t                     qp_mod;\r
        ib_api_status_t         status;\r
 \r
-       CL_ENTER( AL_DBG_CM, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_CM );\r
 \r
        cl_memclr( &qp_mod, sizeof(ib_qp_mod_t) );\r
        qp_mod.req_state = IB_QPS_INIT;\r
@@ -86,7 +86,7 @@ __init_qp(
        if( !p_port_attr )\r
        {\r
                ci_ca_unlock_attr( h_qp->obj.p_ci_ca );\r
-               CL_TRACE( AL_DBG_ERROR, g_al_dbg_lvl, ("invalid p_gid\n" ) );\r
+               AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("invalid p_gid\n" ) );\r
                return IB_INVALID_GID;\r
        }\r
 \r
@@ -96,19 +96,19 @@ __init_qp(
 \r
        if( qp_mod.state.init.pkey_index == BAD_PKEY_INDEX )\r
        {\r
-               CL_TRACE( AL_DBG_ERROR, g_al_dbg_lvl, ("invalid PKEY\n" ) );\r
+               AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("invalid PKEY\n" ) );\r
                return IB_INVALID_PKEY;\r
        }\r
 \r
        status = ib_modify_qp( h_qp, &qp_mod );\r
        if( status != IB_SUCCESS )\r
        {\r
-               CL_TRACE( AL_DBG_ERROR, g_al_dbg_lvl,\r
+               AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("ib_modify_qp to IB_QPS_INIT returned %s\n",\r
                        ib_get_err_str(status) ) );\r
        }\r
 \r
-       CL_EXIT( AL_DBG_CM, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_CM );\r
        return status;\r
 }\r
 \r
@@ -139,7 +139,7 @@ cm_init_qp(
                status = __reset_qp( h_qp );\r
                if( status != IB_SUCCESS )\r
                {\r
-                       CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl,\r
+                       AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                                ("__reset_qp returned %s\n", ib_get_err_str(status) ) );\r
                        return status;\r
                }\r
@@ -148,7 +148,7 @@ cm_init_qp(
                status = __init_qp( h_qp, p_gid, pkey, access_ctrl );\r
                if( status != IB_SUCCESS )\r
                {\r
-                       CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl,\r
+                       AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                                ("__init_qp returned %s.\n", ib_get_err_str(status) ) );\r
                        return status;\r
                }\r
@@ -167,13 +167,13 @@ cm_rts_qp(
 {\r
        ib_api_status_t status;\r
 \r
-       CL_ENTER( AL_DBG_CM, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_CM );\r
 \r
        /* Set the QP to RTR. */\r
        status = ib_modify_qp( h_qp, p_qp_mod_rtr );\r
        if( status != IB_SUCCESS )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("ib_modify_qp to RTR returned %s.\n", ib_get_err_str(status) ) );\r
                return status;\r
        }\r
@@ -182,12 +182,12 @@ cm_rts_qp(
        status = ib_modify_qp( h_qp, p_qp_mod_rts );\r
        if( status != IB_SUCCESS )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("ib_modify_qp to RTS returned %s.\n", ib_get_err_str(status) ) );\r
                return status;\r
        }\r
 \r
-       CL_EXIT( AL_DBG_CM, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_CM );\r
        return IB_SUCCESS;\r
 }\r
 \r
@@ -208,14 +208,14 @@ cm_reset_qp(
        ib_qp_mod_t                     qp_mod;\r
        ib_api_status_t         status;\r
 \r
-       CL_ENTER( AL_DBG_CM, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_CM );\r
 \r
        /* Special checks on the QP state for error handling - see above. */\r
        if( !h_qp || !AL_OBJ_IS_TYPE( h_qp, AL_OBJ_TYPE_H_QP ) ||\r
                ( (h_qp->obj.state != CL_INITIALIZED) && \r
                  (h_qp->obj.state != CL_DESTROYING) ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_CM, g_al_dbg_lvl, ("IB_INVALID_QP_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_WARNING, AL_DBG_CM, ("IB_INVALID_QP_HANDLE\n") );\r
                return IB_INVALID_QP_HANDLE;\r
        }\r
 \r
@@ -232,7 +232,7 @@ cm_reset_qp(
                status = h_qp->pfn_modify_qp( h_qp, &qp_mod, NULL );\r
                if( status != IB_SUCCESS )\r
                {\r
-                       CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl,\r
+                       AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                                ("pfn_modify_qp to IB_QPS_ERROR returned %s\n",\r
                                ib_get_err_str(status) ) );\r
                        return status;\r
@@ -246,7 +246,7 @@ cm_reset_qp(
        UNUSED_PARAM( timewait );\r
 #endif /* CL_KERNEL */\r
 \r
-       CL_EXIT( AL_DBG_CM, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_CM );\r
        return IB_SUCCESS;\r
 }\r
 \r
@@ -265,7 +265,7 @@ cm_save_rep_qp_attr(
        IN OUT                  ib_qp_mod_t * const                     p_qp_mod_rtr,\r
        IN OUT                  ib_qp_mod_t * const                     p_qp_mod_rts )\r
 {\r
-       CL_ENTER( AL_DBG_CM, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_CM );\r
 \r
        /* Update the QP RTR transition information. */\r
        p_qp_mod_rtr->state.rtr.rq_psn = p_cm_rep->h_qp->num;\r
@@ -328,7 +328,7 @@ cm_save_rep_qp_attr(
                cm_local_ack_timeout( ib_path_rec_pkt_life( p_path_rec ),\r
                p_cm_rep->target_ack_delay );\r
 \r
-       CL_EXIT( AL_DBG_CM, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_CM );\r
 }\r
 \r
 \r
@@ -342,7 +342,7 @@ cm_save_rtu_qp_attr(
        IN              const   ib_cm_rtu_t * const                     p_cm_rtu,\r
        IN OUT                  ib_qp_mod_t * const                     p_qp_mod_rtr )\r
 {\r
-       CL_ENTER( AL_DBG_CM, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_CM );\r
 \r
        /* Update the QP RTR transition information. */\r
        if( p_cm_rtu->access_ctrl )\r
@@ -363,7 +363,7 @@ cm_save_rtu_qp_attr(
                p_qp_mod_rtr->state.rtr.rq_depth = p_cm_rtu->rq_depth;\r
        }\r
 \r
-       CL_EXIT( AL_DBG_CM, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_CM );\r
 }\r
 \r
 \r
index 061df31..6021574 100644 (file)
 #include "al_ci_ca.h"\r
 #include "al_common.h"\r
 #include "al_debug.h"\r
+\r
+#if defined(EVENT_TRACING)\r
+#ifdef offsetof\r
+#undef offsetof\r
+#endif\r
+#include "al_common.tmh"\r
+#endif\r
+\r
 #include "al_mgr.h"\r
 #include <complib/cl_math.h>\r
 #include "ib_common.h"\r
@@ -68,7 +76,7 @@ sync_destroy_obj(
        IN              const   ib_pfn_destroy_cb_t                     pfn_destroy_cb );\r
 \r
 \r
-#if defined( _DEBUG_ )\r
+\r
 const char* ib_obj_type_str[] =\r
 {\r
        "AL_OBJ_TYPE_UNKNOWN",\r
@@ -113,7 +121,6 @@ const char* ib_obj_type_str[] =
        "AL_OBJ_TYPE_H_SA_REG",\r
        "AL_OBJ_TYPE_H_FMR"\r
 };\r
-#endif\r
 \r
 \r
 /*\r
@@ -165,10 +172,10 @@ init_al_obj(
 {\r
        cl_status_t                             cl_status;\r
 \r
-       CL_ENTER( AL_DBG_AL_OBJ, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_AL_OBJ );\r
        CL_ASSERT( p_obj && pfn_free );\r
        CL_ASSERT( p_obj->state == CL_UNINITIALIZED );\r
-       CL_TRACE( AL_DBG_AL_OBJ, g_al_dbg_lvl, ("%p\n", p_obj ) );\r
+       AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_AL_OBJ, ("%p\n", p_obj ) );\r
 \r
        /* Initialize the object. */\r
        p_obj->async_item.pfn_callback = async_destroy_cb;\r
@@ -209,7 +216,7 @@ init_al_obj(
         */\r
        ref_al_obj( p_obj );\r
 \r
-       CL_EXIT( AL_DBG_AL_OBJ, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_AL_OBJ );\r
        return IB_SUCCESS;\r
 }\r
 \r
@@ -265,7 +272,7 @@ attach_al_obj(
        \r
        CL_ASSERT( p_child_obj->state == CL_INITIALIZED );\r
 \r
-       AL_TRACE( AL_DBG_AL_OBJ,\r
+       AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_AL_OBJ,\r
                ("%p(%s) to %p(%s)\n",\r
                p_child_obj, ib_get_obj_type( p_child_obj ),\r
                p_parent_obj, ib_get_obj_type( p_parent_obj ) ) );\r
@@ -324,7 +331,7 @@ detach_al_obj(
 {\r
        al_obj_t                                *p_parent_obj;\r
 \r
-       CL_ENTER( AL_DBG_AL_OBJ, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_AL_OBJ );\r
        \r
        p_parent_obj = p_obj->p_parent_obj;\r
        CL_ASSERT( p_obj );\r
@@ -334,7 +341,7 @@ detach_al_obj(
        CL_ASSERT( p_parent_obj->state == CL_INITIALIZED ||\r
                p_parent_obj->state == CL_DESTROYING );\r
 \r
-       CL_TRACE( AL_DBG_AL_OBJ, g_al_dbg_lvl,\r
+       AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_AL_OBJ,\r
                ("%p(%s) from %p(%s)\n",\r
                p_obj, ib_get_obj_type( p_obj ),\r
                p_parent_obj, ib_get_obj_type( p_parent_obj ) ) );\r
@@ -344,7 +351,7 @@ detach_al_obj(
        cl_qlist_remove_item( &p_parent_obj->obj_list,\r
                (cl_list_item_t*)&p_obj->pool_item );\r
        cl_spinlock_release( &p_parent_obj->lock );\r
-       CL_EXIT( AL_DBG_AL_OBJ, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_AL_OBJ );\r
 }\r
 \r
 \r
@@ -359,13 +366,13 @@ ref_al_obj(
 {\r
        uint32_t        ref_cnt;\r
 \r
-       CL_ENTER( AL_DBG_AL_OBJ, g_al_dbg_lvl );\r
-       CL_TRACE( AL_DBG_AL_OBJ, g_al_dbg_lvl,\r
+       AL_ENTER( AL_DBG_AL_OBJ );\r
+       AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_AL_OBJ,\r
                ("%p(%s)\n", p_obj, ib_get_obj_type( p_obj ) ) );\r
        ref_cnt = cl_atomic_inc( &p_obj->ref_cnt );\r
        CL_ASSERT( ref_cnt != 1 || p_obj->type == AL_OBJ_TYPE_H_CQ );\r
 \r
-       CL_EXIT( AL_DBG_AL_OBJ, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_AL_OBJ );\r
        return ref_cnt;\r
 }\r
 \r
@@ -381,14 +388,14 @@ deref_al_obj(
 {\r
        int32_t                 ref_cnt;\r
 \r
-       CL_ENTER( AL_DBG_AL_OBJ, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_AL_OBJ );\r
 \r
        CL_ASSERT( p_obj );\r
        CL_ASSERT( p_obj->state == CL_INITIALIZED ||\r
                p_obj->state == CL_DESTROYING );\r
        CL_ASSERT( p_obj->ref_cnt );\r
 \r
-       CL_TRACE( AL_DBG_AL_OBJ, g_al_dbg_lvl,\r
+       AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_AL_OBJ,\r
                ("%p(%s)\n", p_obj, ib_get_obj_type( p_obj ) ) );\r
 \r
        ref_cnt = cl_atomic_dec( &p_obj->ref_cnt );\r
@@ -413,7 +420,7 @@ deref_al_obj(
                }\r
        }\r
 \r
-       CL_EXIT( AL_DBG_AL_OBJ, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_AL_OBJ );\r
        return ref_cnt;\r
 }\r
 \r
@@ -426,7 +433,7 @@ void
 destroy_al_obj(\r
        IN                              al_obj_t * const                        p_obj )\r
 {\r
-       CL_ENTER( AL_DBG_AL_OBJ, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_AL_OBJ );\r
 \r
        CL_ASSERT( p_obj );\r
        CL_ASSERT( p_obj->state == CL_DESTROYING ||\r
@@ -446,7 +453,7 @@ destroy_al_obj(
        cl_spinlock_destroy( &p_obj->lock );\r
        p_obj->state = CL_DESTROYED;\r
 \r
-       CL_EXIT( AL_DBG_AL_OBJ, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_AL_OBJ );\r
 }\r
 \r
 \r
@@ -456,14 +463,14 @@ async_destroy_obj(
        IN                              struct _al_obj                          *p_obj,\r
        IN              const   ib_pfn_destroy_cb_t                     pfn_destroy_cb )\r
 {\r
-       CL_ENTER( AL_DBG_AL_OBJ, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_AL_OBJ );\r
 \r
        if( pfn_destroy_cb == ib_sync_destroy )\r
                sync_destroy_obj( p_obj, pfn_destroy_cb );\r
        else if( destroy_obj( p_obj, pfn_destroy_cb ) )\r
                deref_al_obj( p_obj );  /* Only destroy the object once. */\r
 \r
-       CL_EXIT( AL_DBG_AL_OBJ, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_AL_OBJ );\r
 }\r
 \r
 \r
@@ -475,7 +482,7 @@ sync_destroy_obj(
 {\r
        cl_status_t             cl_status;\r
 \r
-       CL_ENTER( AL_DBG_AL_OBJ, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_AL_OBJ );\r
 \r
        if( !destroy_obj( p_obj, pfn_destroy_cb ) )\r
        {\r
@@ -504,7 +511,7 @@ sync_destroy_obj(
 \r
                if( cl_status != CL_SUCCESS )\r
                {\r
-                       CL_TRACE( AL_DBG_ERROR, g_al_dbg_lvl,\r
+                       AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                                ("Error waiting for references to be released - delaying.\n") );\r
                        print_al_obj( p_obj );\r
                        /*\r
@@ -527,7 +534,7 @@ sync_destroy_obj(
                CL_ASSERT( cl_status == CL_SUCCESS );\r
                if( cl_status != CL_SUCCESS )\r
                {\r
-                       CL_TRACE( AL_DBG_ERROR, g_al_dbg_lvl,\r
+                       AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                                ("Forcing object destruction.\n") );\r
                        print_al_obj( p_obj );\r
                        //print_tail_al_objs();\r
@@ -537,7 +544,7 @@ sync_destroy_obj(
        }\r
        async_destroy_cb( &p_obj->async_item );\r
 \r
-       CL_EXIT( AL_DBG_AL_OBJ, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_AL_OBJ );\r
 }\r
 \r
 \r
@@ -550,13 +557,13 @@ destroy_obj(
        cl_list_item_t                  *p_list_item;\r
        al_obj_t                                *p_child_obj;\r
 \r
-       CL_ENTER( AL_DBG_AL_OBJ, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_AL_OBJ );\r
 \r
        CL_ASSERT( p_obj );\r
        CL_ASSERT( p_obj->state == CL_INITIALIZED ||\r
                p_obj->state == CL_DESTROYING );\r
 \r
-       CL_TRACE( AL_DBG_AL_OBJ, g_al_dbg_lvl,\r
+       AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_AL_OBJ,\r
                ("%p(%s)\n", p_obj, ib_get_obj_type( p_obj ) ) );\r
 \r
        /*\r
@@ -592,13 +599,13 @@ destroy_obj(
                detach_al_obj( p_obj );\r
 \r
        /*      Destroy all child resources.  No need to lock during destruction. */\r
-       CL_TRACE( AL_DBG_AL_OBJ, g_al_dbg_lvl, ("destroying children\n") );\r
+       AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_AL_OBJ, ("destroying children\n") );\r
        p_list_item = cl_qlist_tail( &p_obj->obj_list );\r
        while( p_list_item != cl_qlist_end( &p_obj->obj_list ) )\r
        {\r
                p_child_obj = PARENT_STRUCT( p_list_item, al_obj_t, pool_item );\r
                CL_ASSERT( p_child_obj->pfn_destroy );\r
-               CL_TRACE( AL_DBG_AL_OBJ, g_al_dbg_lvl,\r
+               AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_AL_OBJ,\r
                        ("bye bye: %p(%s)\n", p_child_obj,\r
                        ib_get_obj_type( p_child_obj ) ) );\r
                ref_al_obj( p_child_obj );\r
@@ -618,7 +625,7 @@ destroy_obj(
        }\r
 \r
        p_obj->user_destroy_cb = pfn_destroy_cb;\r
-       CL_EXIT( AL_DBG_AL_OBJ, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_AL_OBJ );\r
        return TRUE;\r
 }\r
 \r
@@ -631,7 +638,7 @@ async_destroy_cb(
        al_obj_t                                *p_obj;\r
        al_obj_t                                *p_parent_obj = NULL;\r
 \r
-       CL_ENTER( AL_DBG_AL_OBJ, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_AL_OBJ );\r
 \r
        CL_ASSERT( p_item );\r
        p_obj = PARENT_STRUCT( p_item, al_obj_t, async_item );\r
@@ -639,13 +646,13 @@ async_destroy_cb(
        CL_ASSERT( p_obj->state == CL_DESTROYING );\r
        CL_ASSERT( !p_obj->ref_cnt );\r
 \r
-       CL_TRACE( AL_DBG_AL_OBJ, g_al_dbg_lvl,\r
+       AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_AL_OBJ,\r
                ("%p\n", p_obj ) );\r
 \r
        /* Cleanup any hardware related resources. */\r
        if( p_obj->pfn_cleanup )\r
        {\r
-               CL_TRACE( AL_DBG_AL_OBJ, g_al_dbg_lvl, ("cleaning up\n" ) );\r
+               AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_AL_OBJ, ("cleaning up\n" ) );\r
                p_obj->pfn_cleanup( p_obj );\r
        }\r
 \r
@@ -659,16 +666,16 @@ async_destroy_cb(
        /* Notify the user that we're done. */\r
        if( p_obj->user_destroy_cb )\r
        {\r
-               CL_TRACE( AL_DBG_AL_OBJ, g_al_dbg_lvl, ("notifying user\n" ) );\r
+               AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_AL_OBJ, ("notifying user\n" ) );\r
                p_obj->user_destroy_cb( (void*)p_obj->context );\r
        }\r
 \r
        /* Free the resources associated with the object. */\r
-       CL_TRACE( AL_DBG_AL_OBJ, g_al_dbg_lvl, ("freeing object\n" ) );\r
+       AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_AL_OBJ, ("freeing object\n" ) );\r
        p_obj->pfn_free( p_obj );\r
 \r
        /* Dereference the parent after freeing the child. */\r
        if( p_parent_obj )\r
                deref_al_obj( p_parent_obj );\r
-       CL_EXIT( AL_DBG_AL_OBJ, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_AL_OBJ );\r
 }\r
index 789d44c..02f0442 100644 (file)
@@ -280,7 +280,7 @@ inc_al_obj_desc(
  */\r
 ib_api_status_t\r
 attach_al_obj(\r
-       IN                              al_obj_t * const                        p_parent_obj ,\r
+       IN                              al_obj_t * const                        p_parent_obj,\r
        IN                              al_obj_t * const                        p_child_obj );\r
 \r
 \r
@@ -316,7 +316,7 @@ destroy_al_obj(
 \r
 \r
 \r
-#if defined( _DEBUG_ ) \r
+\r
 extern const char* ib_obj_type_str[];\r
 \r
 static inline const char*\r
@@ -328,7 +328,7 @@ ib_get_obj_type(
 \r
        return( ib_obj_type_str[ AL_BASE_TYPE( p_obj->type ) ] );\r
 }\r
-#endif\r
+\r
 \r
 \r
 \r
index 6505266..243be6e 100644 (file)
 \r
 #include "al_cq.h"\r
 #include "al_debug.h"\r
+\r
+#if defined(EVENT_TRACING)\r
+#ifdef offsetof\r
+#undef offsetof\r
+#endif\r
+#include "al_cq.tmh"\r
+#endif\r
+\r
 #include "al_ca.h"\r
 #include "al_pd.h"\r
 #include "al_qp.h"\r
@@ -73,13 +81,13 @@ create_cq(
 \r
        if( !p_cq_create || !ph_cq )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
        if( (p_cq_create->pfn_comp_cb && p_cq_create->h_wait_obj) ||\r
                (!p_cq_create->pfn_comp_cb && !p_cq_create->h_wait_obj) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_SETTING\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_SETTING\n") );\r
                return IB_INVALID_SETTING;\r
        }\r
 \r
@@ -153,18 +161,18 @@ ib_destroy_cq(
        IN              const   ib_cq_handle_t                          h_cq,\r
        IN              const   ib_pfn_destroy_cb_t                     pfn_destroy_cb OPTIONAL )\r
 {\r
-       CL_ENTER( AL_DBG_CQ, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_CQ );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_cq, AL_OBJ_TYPE_H_CQ ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_CQ_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_CQ_HANDLE\n") );\r
                return IB_INVALID_CQ_HANDLE;\r
        }\r
 \r
        ref_al_obj( &h_cq->obj );\r
        h_cq->obj.pfn_destroy( &h_cq->obj, pfn_destroy_cb );\r
 \r
-       CL_EXIT( AL_DBG_CQ, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_CQ );\r
        return IB_SUCCESS;\r
 }\r
 \r
@@ -287,22 +295,22 @@ modify_cq(
 {\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_CQ, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_CQ );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_cq, AL_OBJ_TYPE_H_CQ ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_CQ_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_CQ_HANDLE\n") );\r
                return IB_INVALID_CQ_HANDLE;\r
        }\r
        if( !p_size )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
        status = verbs_modify_cq( h_cq, p_size );\r
 \r
-       CL_EXIT( AL_DBG_CQ, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_CQ );\r
        return status;\r
 }\r
 \r
@@ -326,22 +334,22 @@ query_cq(
 {\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_CQ, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_CQ );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_cq, AL_OBJ_TYPE_H_CQ ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_CQ_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_CQ_HANDLE\n") );\r
                return IB_INVALID_CQ_HANDLE;\r
        }\r
        if( !p_size )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
        status = verbs_query_cq( h_cq, p_size );\r
 \r
-       CL_EXIT( AL_DBG_CQ, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_CQ );\r
        return status;\r
 }\r
 \r
@@ -354,22 +362,22 @@ ib_peek_cq(
 {\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_CQ, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_CQ );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_cq, AL_OBJ_TYPE_H_CQ ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_CQ_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_CQ_HANDLE\n") );\r
                return IB_INVALID_CQ_HANDLE;\r
        }\r
        if( !p_n_cqes )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
        status = verbs_peek_cq( h_cq, p_n_cqes );\r
 \r
-       CL_EXIT( AL_DBG_CQ, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_CQ );\r
        return status;\r
 }\r
 \r
@@ -386,16 +394,16 @@ ib_poll_cq(
        PERF_DECLARE( VerbsPollCq );\r
 \r
        cl_perf_start( IbPollCq );\r
-       CL_ENTER( AL_DBG_CQ, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_CQ );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_cq, AL_OBJ_TYPE_H_CQ ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_CQ_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_CQ_HANDLE\n") );\r
                return IB_INVALID_CQ_HANDLE;\r
        }\r
        if( !pp_free_wclist || !pp_done_wclist )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
@@ -403,7 +411,7 @@ ib_poll_cq(
        status = verbs_poll_cq( h_cq, pp_free_wclist, pp_done_wclist );\r
        cl_perf_stop( &g_perf, VerbsPollCq );\r
 \r
-       CL_EXIT( AL_DBG_CQ, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_CQ );\r
        cl_perf_stop( &g_perf, IbPollCq );\r
        return status;\r
 }\r
@@ -417,17 +425,17 @@ ib_rearm_cq(
 {\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_CQ, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_CQ );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_cq, AL_OBJ_TYPE_H_CQ ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_CQ_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_CQ_HANDLE\n") );\r
                return IB_INVALID_CQ_HANDLE;\r
        }\r
 \r
        status = verbs_rearm_cq( h_cq, solicited );\r
 \r
-       CL_EXIT( AL_DBG_CQ, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_CQ );\r
        return status;\r
 }\r
 \r
@@ -440,22 +448,22 @@ ib_rearm_n_cq(
 {\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_CQ, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_CQ );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_cq, AL_OBJ_TYPE_H_CQ ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_CQ_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_CQ_HANDLE\n") );\r
                return IB_INVALID_CQ_HANDLE;\r
        }\r
        if( !n_cqes )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
        status = verbs_rearm_n_cq( h_cq, n_cqes );\r
 \r
-       CL_EXIT( AL_DBG_CQ, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_CQ );\r
        return status;\r
 }\r
 \r
index 030a6bc..fd0a037 100644 (file)
 #define __AL_DEBUG_H__\r
 \r
 #ifndef __MODULE__\r
-#define __MODULE__     "al"\r
+#define __MODULE__     "[AL]"\r
 #endif\r
 \r
 #include <complib/cl_debug.h>\r
 #include <complib/cl_perf.h>\r
 \r
+extern uint32_t                        g_al_dbg_level;\r
+extern uint32_t                        g_al_dbg_flags;\r
+\r
+#if defined(EVENT_TRACING)\r
+//\r
+// Software Tracing Definitions \r
+//\r
+\r
+#ifndef CL_KERNEL\r
+\r
+#define WPP_CONTROL_GUIDS \\r
+       WPP_DEFINE_CONTROL_GUID(ALCtlGuid1,(B199CE55,F8BF,4147,B119,DACD1E5987A6),  \\r
+       WPP_DEFINE_BIT( AL_DBG_ERROR) \\r
+       WPP_DEFINE_BIT( AL_DBG_AL_OBJ) \\r
+       WPP_DEFINE_BIT( AL_DBG_HDL) \\r
+       WPP_DEFINE_BIT( AL_DBG_SMI) \\r
+       WPP_DEFINE_BIT( AL_DBG_SMI_CB) \\r
+       WPP_DEFINE_BIT( AL_DBG_MAD_POOL) \\r
+       WPP_DEFINE_BIT( AL_DBG_MAD_SVC) \\r
+       WPP_DEFINE_BIT( AL_DBG_PNP) \\r
+       WPP_DEFINE_BIT( AL_DBG_CM) \\r
+       WPP_DEFINE_BIT( AL_DBG_CA) \\r
+       WPP_DEFINE_BIT( AL_DBG_MR) \\r
+       WPP_DEFINE_BIT( AL_DBG_MGR)\\r
+       WPP_DEFINE_BIT( AL_DBG_DEV)\\r
+       WPP_DEFINE_BIT( AL_DBG_MCAST)\\r
+       WPP_DEFINE_BIT( AL_DBG_PD)\\r
+       WPP_DEFINE_BIT( AL_DBG_AV)\\r
+       WPP_DEFINE_BIT( AL_DBG_CQ)\\r
+       WPP_DEFINE_BIT( AL_DBG_QP)\\r
+       WPP_DEFINE_BIT( AL_DBG_MW)\\r
+       WPP_DEFINE_BIT( AL_DBG_PROXY_CB)\\r
+       WPP_DEFINE_BIT( AL_DBG_UAL)\\r
+       WPP_DEFINE_BIT( AL_DBG_QUERY)\\r
+       WPP_DEFINE_BIT( AL_DBG_SA_REQ)\\r
+       WPP_DEFINE_BIT( AL_DBG_IOC)\\r
+       WPP_DEFINE_BIT( AL_DBG_SUB)\\r
+       WPP_DEFINE_BIT( AL_DBG_MAD))\r
+\r
+#else\r
+\r
+#define WPP_CONTROL_GUIDS \\r
+       WPP_DEFINE_CONTROL_GUID(ALCtlGuid2,(99DC84E3,B106,431e,88A6,4DD20C9BBDE3),  \\r
+       WPP_DEFINE_BIT( AL_DBG_ERROR) \\r
+       WPP_DEFINE_BIT( AL_DBG_AL_OBJ) \\r
+       WPP_DEFINE_BIT( AL_DBG_HDL) \\r
+       WPP_DEFINE_BIT( AL_DBG_SMI) \\r
+       WPP_DEFINE_BIT( AL_DBG_SMI_CB) \\r
+       WPP_DEFINE_BIT( AL_DBG_MAD_POOL) \\r
+       WPP_DEFINE_BIT( AL_DBG_MAD_SVC) \\r
+       WPP_DEFINE_BIT( AL_DBG_PNP) \\r
+       WPP_DEFINE_BIT( AL_DBG_CM) \\r
+       WPP_DEFINE_BIT( AL_DBG_CA) \\r
+       WPP_DEFINE_BIT( AL_DBG_MR) \\r
+       WPP_DEFINE_BIT( AL_DBG_MGR)\\r
+       WPP_DEFINE_BIT( AL_DBG_DEV)\\r
+       WPP_DEFINE_BIT( AL_DBG_MCAST)\\r
+       WPP_DEFINE_BIT( AL_DBG_PD)\\r
+       WPP_DEFINE_BIT( AL_DBG_AV)\\r
+       WPP_DEFINE_BIT( AL_DBG_CQ)\\r
+       WPP_DEFINE_BIT( AL_DBG_QP)\\r
+       WPP_DEFINE_BIT( AL_DBG_MW)\\r
+       WPP_DEFINE_BIT( AL_DBG_PROXY_CB)\\r
+       WPP_DEFINE_BIT( AL_DBG_UAL)\\r
+       WPP_DEFINE_BIT( AL_DBG_QUERY)\\r
+       WPP_DEFINE_BIT( AL_DBG_SA_REQ)\\r
+       WPP_DEFINE_BIT( AL_DBG_IOC)\\r
+       WPP_DEFINE_BIT( AL_DBG_SUB)\\r
+       WPP_DEFINE_BIT( AL_DBG_MAD))\r
+\r
+#endif\r
+\r
+\r
+#define WPP_LEVEL_FLAGS_ENABLED(lvl, flags) (WPP_LEVEL_ENABLED(flags) && WPP_CONTROL(WPP_BIT_ ## flags).Level  >= lvl)\r
+#define WPP_LEVEL_FLAGS_LOGGER(lvl,flags) WPP_LEVEL_LOGGER(flags)\r
+#define WPP_FLAG_ENABLED(flags)(WPP_LEVEL_ENABLED(flags) && WPP_CONTROL(WPP_BIT_ ## flags).Level  >= TRACE_LEVEL_VERBOSE)\r
+#define WPP_FLAG_LOGGER(flags) WPP_LEVEL_LOGGER(flags)\r
+\r
+\r
+// begin_wpp config\r
+// AL_ENTER( FLAG );\r
+// AL_EXIT( FLAG );\r
+// USEPREFIX(AL_PRINT, "%!STDPREFIX! %!FUNC!() :");\r
+// USESUFFIX(AL_ENTER, " %!FUNC!():[");\r
+// USESUFFIX(AL_EXIT, " %!FUNC!():]");\r
+// end_wpp\r
+\r
+\r
+\r
+#else\r
+\r
+#include <wmistr.h>\r
+#include <evntrace.h>\r
+\r
+/*\r
+ * Debug macros\r
+ */\r
+\r
 \r
 /* Debug message source */\r
-#define        AL_DBG_AL_OBJ   (1 << 0)\r
-#define AL_DBG_HDL             (1 << 1)\r
+#define AL_DBG_ERR     (1 << 0)\r
+#define AL_DBG_AL_OBJ  (1 << 1)\r
+#define AL_DBG_HDL             (1 << 2)\r
 #define AL_DBG_SMI             (1 << 4)\r
 #define AL_DBG_SMI_CB  (1 << 5)\r
-#define        AL_DBG_MAD_POOL (1 << 7)\r
+#define AL_DBG_MAD_POOL        (1 << 7)\r
 #define AL_DBG_MAD_SVC (1 << 8)\r
 #define AL_DBG_PNP             (1 << 9)\r
 #define AL_DBG_CM              (1 << 10)\r
 #define AL_DBG_SA_REQ  (1 << 26)\r
 #define AL_DBG_IOC             (1 << 27)\r
 #define AL_DBG_SUB             (1 << 28)\r
+#define AL_DBG_MAD             (1 << 29) //TODO \r
+\r
+#define AL_DBG_ERROR   (CL_DBG_ERROR | AL_DBG_ERR)\r
+\r
+#if DBG\r
+\r
+// assignment of _level_ is need to to overcome warning C4127\r
+#define AL_PRINT( _level_,_flag_,_msg_)  \\r
+       { \\r
+               if( g_al_dbg_level >= (_level_) ) \\r
+                       CL_TRACE( _flag_, g_al_dbg_level, _msg_ ); \\r
+       }\r
+\r
 \r
-/* Debug message type */\r
-#define AL_DBG_FUNC            (1 << 29)\r
-#define AL_DBG_WARN            (1 << 30)\r
-#define AL_DBG_ERROR   CL_DBG_ERROR\r
+#define AL_PRINT_EXIT( _level_,_flag_,_msg_) \\r
+       { \\r
+               if( g_al_dbg_level >= (_level_) ) \\r
+                       CL_TRACE( _flag_, g_al_dbg_level, _msg_ );\\r
+               AL_EXIT( _flag_ );\\r
+       }\r
 \r
-#define        AL_DBG_NONE             CL_DBG_DISABLE\r
-#define AL_DBG_FULL            CL_DBG_ALL\r
+#define AL_ENTER( _flag_) \\r
+       { \\r
+               if( g_al_dbg_level >= TRACE_LEVEL_VERBOSE ) \\r
+                       CL_ENTER( _flag_, g_al_dbg_level ); \\r
+       }\r
 \r
-#define AL_DBG_MAD             (AL_DBG_SMI | AL_DBG_SMI_CB | \\r
-                                                AL_DBG_MAD_POOL | AL_DBG_MAD_SVC)\r
-#define AL_DBG_NORMAL  AL_DBG_ERROR\r
-#define AL_DBG_VERBOSE (AL_DBG_FULL & (~AL_DBG_AL_OBJ))\r
+#define AL_EXIT( _flag_)\\r
+       { \\r
+               if( g_al_dbg_level >= TRACE_LEVEL_VERBOSE ) \\r
+                       CL_EXIT( _flag_, g_al_dbg_level ); \\r
+       }\r
 \r
-extern uint32_t                        g_al_dbg_lvl;\r
 \r
-/* Macros for simplifying CL_ENTER, CL_TRACE, etc. */\r
-#define AL_ENTER( msg_lvl )                            \\r
-       CL_ENTER( (msg_lvl | AL_DBG_FUNC), g_al_dbg_lvl )\r
+#else\r
 \r
-#define AL_EXIT( msg_lvl )                             \\r
-       CL_EXIT( (msg_lvl | AL_DBG_FUNC), g_al_dbg_lvl )\r
+#define AL_PRINT( lvl, flags, msg)\r
 \r
-#define AL_TRACE( msg_lvl, msg )               \\r
-       CL_TRACE( (msg_lvl), g_al_dbg_lvl, msg )\r
+#define AL_PRINT_EXIT( _level_,_flag_,_msg_)\r
+\r
+#define AL_ENTER( _flag_)\r
+\r
+#define AL_EXIT( _flag_)\r
+\r
+\r
+#endif\r
 \r
-#define AL_TRACE_EXIT( msg_lvl, msg )  \\r
-       CL_TRACE_EXIT( (msg_lvl), g_al_dbg_lvl, msg )\r
+#endif //EVENT_TRACING\r
 \r
-#define AL_PRINT( msg_lvl, msg )               \\r
-       CL_PRINT( (msg_lvl), g_al_dbg_lvl, msg )\r
 \r
 \r
 enum al_perf_counters\r
index 9d95fa6..c858c76 100644 (file)
 \r
 #include "al_ca.h"\r
 #include "al_debug.h"\r
+\r
+#if defined(EVENT_TRACING)\r
+#ifdef offsetof\r
+#undef offsetof\r
+#endif\r
+#include "al_dm.tmh"\r
+#endif\r
+\r
 #include "al_dm.h"\r
 #include "al_mgr.h"\r
 #include "ib_common.h"\r
@@ -206,16 +214,16 @@ ib_create_ioc(
 {\r
        ib_ioc_handle_t                 h_ioc;\r
 \r
-       CL_ENTER( AL_DBG_IOC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_IOC );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_ca, AL_OBJ_TYPE_H_CA ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_CA_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_CA_HANDLE\n") );\r
                return IB_INVALID_CA_HANDLE;\r
        }\r
        if( !p_ioc_profile || !ph_ioc )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
@@ -233,7 +241,7 @@ ib_create_ioc(
        /* Return the IOC handle to the user. */\r
        *ph_ioc = h_ioc;\r
 \r
-       CL_EXIT( AL_DBG_IOC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_IOC );\r
        return IB_SUCCESS;\r
 }\r
 \r
@@ -243,18 +251,18 @@ ib_api_status_t
 ib_destroy_ioc(\r
        IN              const   ib_ioc_handle_t                         h_ioc )\r
 {\r
-       CL_ENTER( AL_DBG_IOC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_IOC );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_ioc, AL_OBJ_TYPE_H_IOC ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_HANDLE\n") );\r
                return IB_INVALID_HANDLE;\r
        }\r
 \r
        ref_al_obj( &h_ioc->obj );\r
        h_ioc->obj.pfn_destroy( &h_ioc->obj, NULL );\r
 \r
-       CL_EXIT( AL_DBG_IOC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_IOC );\r
        return IB_SUCCESS;\r
 }\r
 \r
@@ -304,11 +312,11 @@ ib_reg_ioc(
        al_iou_t*                               p_iou;\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_IOC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_IOC );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_ioc, AL_OBJ_TYPE_H_IOC ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_HANDLE\n") );\r
                return IB_INVALID_HANDLE;\r
        }\r
 \r
@@ -320,7 +328,7 @@ ib_reg_ioc(
        /* Register the IOC with the IO unit. */\r
        status = add_ioc( p_iou, h_ioc );\r
 \r
-       CL_EXIT( AL_DBG_IOC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_IOC );\r
        return status;\r
 }\r
 \r
@@ -335,16 +343,16 @@ ib_add_svc_entry(
        ib_svc_handle_t                 h_svc;\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_IOC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_IOC );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_ioc, AL_OBJ_TYPE_H_IOC ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_HANDLE\n") );\r
                return IB_INVALID_HANDLE;\r
        }\r
        if( !p_svc_entry || !ph_svc )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
@@ -368,13 +376,13 @@ ib_add_svc_entry(
        if( h_ioc->ioc_profile.num_svc_entries == MAX_NUM_SVC_ENTRIES )\r
        {\r
                cl_spinlock_release( &h_ioc->obj.lock );\r
-               CL_EXIT( AL_DBG_IOC, g_al_dbg_lvl );\r
+               AL_EXIT( AL_DBG_IOC );\r
                return IB_INSUFFICIENT_RESOURCES;\r
        }\r
        h_svc = cl_zalloc( sizeof( ib_svc_handle_t ) );\r
        if( !h_svc )\r
        {\r
-               CL_EXIT( AL_DBG_IOC, g_al_dbg_lvl );\r
+               AL_EXIT( AL_DBG_IOC );\r
                return IB_INSUFFICIENT_MEMORY;\r
        }\r
 \r
@@ -390,7 +398,7 @@ ib_add_svc_entry(
        if( status != IB_SUCCESS )\r
        {\r
                free_svc_entry( &h_svc->obj );\r
-               CL_EXIT( AL_DBG_IOC, g_al_dbg_lvl );\r
+               AL_EXIT( AL_DBG_IOC );\r
                return status;\r
        }\r
 \r
@@ -399,7 +407,7 @@ ib_add_svc_entry(
        if( status != IB_SUCCESS )\r
        {\r
                h_svc->obj.pfn_destroy( &h_svc->obj, NULL );\r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("attach_al_obj returned %s.\n", ib_get_err_str(status)) );\r
                return status;\r
        }\r
@@ -418,7 +426,7 @@ ib_add_svc_entry(
        /* Release the reference taken in init_al_obj. */\r
        deref_al_obj( &h_svc->obj );\r
 \r
-       CL_EXIT( AL_DBG_IOC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_IOC );\r
        return IB_SUCCESS;\r
 }\r
 \r
@@ -430,11 +438,11 @@ ib_remove_svc_entry(
 {\r
        ib_ioc_handle_t                 h_ioc;\r
 \r
-       CL_ENTER( AL_DBG_IOC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_IOC );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_svc, AL_OBJ_TYPE_H_SVC_ENTRY ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_HANDLE\n") );\r
                return IB_INVALID_HANDLE;\r
        }\r
 \r
@@ -472,7 +480,7 @@ ib_remove_svc_entry(
        /* No longer in use by this thread. */\r
        cl_atomic_dec( &h_ioc->in_use_cnt );\r
 \r
-       CL_EXIT( AL_DBG_IOC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_IOC );\r
        return IB_SUCCESS;\r
 }\r
 \r
@@ -616,7 +624,7 @@ get_ioc(
        if( status != IB_SUCCESS )\r
        {\r
                h_ioc->obj.pfn_destroy( &h_ioc->obj, NULL );\r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("attach_al_obj returned %s.\n", ib_get_err_str(status)) );\r
                return NULL;\r
        }\r
@@ -847,7 +855,7 @@ create_dm_agent(
        if( status != IB_SUCCESS )\r
        {\r
                gp_dm_agent->obj.pfn_destroy( &gp_dm_agent->obj, NULL );\r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("attach_al_obj returned %s.\n", ib_get_err_str(status)) );\r
                return status;\r
        }\r
@@ -1058,7 +1066,7 @@ create_iou(
        {\r
                p_iou->obj.pfn_destroy( &p_iou->obj, NULL );\r
                cl_spinlock_release( &gp_dm_agent->lock );\r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("attach_al_obj returned %s.\n", ib_get_err_str(status)) );\r
                return status;\r
        }\r
@@ -1069,7 +1077,7 @@ create_iou(
        if( !h_ca )\r
        {\r
                p_iou->obj.pfn_destroy( &p_iou->obj, NULL );\r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("acquire_ca for GUID %016I64x failed.\n", p_pnp_rec->guid) );\r
                return IB_INVALID_CA_HANDLE;\r
        }\r
@@ -1195,7 +1203,7 @@ create_iou_port(
        if( status != IB_SUCCESS )\r
        {\r
                p_iou_port->obj.pfn_destroy( &p_iou_port->obj, NULL );\r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("attach_al_obj returned %s.\n", ib_get_err_str(status)) );\r
                return status;\r
        }\r
index f087575..2b2aca5 100644 (file)
  */\r
 \r
 #include "al_debug.h"\r
+\r
+#if defined(EVENT_TRACING)\r
+#ifdef offsetof\r
+#undef offsetof\r
+#endif\r
+#include "al_init.tmh"\r
+#endif\r
+\r
 #include "al_dev.h"\r
 #include "al_init.h"\r
 #include "al_mgr.h"\r
@@ -39,9 +47,8 @@
 \r
 \r
 \r
-uint32_t                               g_al_dbg_lvl = AL_DBG_ERROR;\r
-\r
-\r
+uint32_t                               g_al_dbg_level = TRACE_LEVEL_ERROR;\r
+uint32_t                               g_al_dbg_flags = 0xf0;\r
 /*\r
  * Device driver initialization routine.\r
  */\r
@@ -51,8 +58,8 @@ al_initialize( void )
        cl_status_t             cl_status;\r
        ib_api_status_t status = IB_ERROR;\r
 \r
-       CL_ENTER( AL_DBG_DEV, g_al_dbg_lvl );\r
-       CL_TRACE( AL_DBG_DEV, g_al_dbg_lvl, ("Hello World! =)\n") );\r
+       AL_ENTER( AL_DBG_DEV );\r
+       AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_DEV, ("Hello World! =)\n") );\r
 \r
        /*\r
         * Initialize access layer services.\r
@@ -64,7 +71,7 @@ al_initialize( void )
 #endif\r
        if( !gp_async_proc_mgr )\r
        {\r
-               CL_TRACE( AL_DBG_ERROR, g_al_dbg_lvl, ("alloc_async_proc failed.\n") );\r
+               AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("alloc_async_proc failed.\n") );\r
                return IB_INSUFFICIENT_MEMORY;\r
        }\r
        gp_async_pnp_mgr = gp_async_proc_mgr + 1;\r
@@ -76,7 +83,7 @@ al_initialize( void )
        cl_status = cl_async_proc_init( gp_async_obj_mgr, 1, "AL_OBJ" );\r
        if( cl_status != CL_SUCCESS )\r
        {\r
-               CL_TRACE( AL_DBG_ERROR, g_al_dbg_lvl,\r
+               AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("Failed to init async_obj_mgr: status = 0x%x.\n", cl_status) );\r
                return ib_convert_cl_status( cl_status );\r
        }\r
@@ -84,7 +91,7 @@ al_initialize( void )
        cl_status = cl_async_proc_init( gp_async_proc_mgr, 1, "Althread" );\r
        if( cl_status != CL_SUCCESS )\r
        {\r
-               CL_TRACE( AL_DBG_ERROR, g_al_dbg_lvl,\r
+               AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("Failed to init async_proc_mgr: status = 0x%x.\n", cl_status) );\r
                return ib_convert_cl_status( cl_status );\r
        }\r
@@ -92,7 +99,7 @@ al_initialize( void )
        cl_status = cl_async_proc_init( gp_async_pnp_mgr, 1, "AL_PNP" );\r
        if( cl_status != CL_SUCCESS )\r
        {\r
-               CL_TRACE( AL_DBG_ERROR, g_al_dbg_lvl,\r
+               AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("Failed to init async_pnp_mgr: status = 0x%x.\n", cl_status) );\r
                return ib_convert_cl_status( cl_status );\r
        }\r
@@ -100,12 +107,12 @@ al_initialize( void )
        status = create_al_mgr();\r
        if( status != IB_SUCCESS )\r
        {\r
-               CL_TRACE( AL_DBG_ERROR, g_al_dbg_lvl,\r
+               AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("init_al_mgr: status = 0x%x.\n", status) );\r
                return status;\r
        }\r
 \r
-       CL_EXIT( AL_DBG_DEV, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_DEV );\r
        return status;\r
 }\r
 \r
@@ -117,20 +124,20 @@ al_initialize( void )
 void\r
 al_cleanup( void )\r
 {\r
-       CL_ENTER( AL_DBG_DEV, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_DEV );\r
 \r
        /*\r
         * Destroy access layer device interface.\r
         */\r
-       CL_TRACE( AL_DBG_DEV, g_al_dbg_lvl, ("Destroying %s device.\n",\r
-               AL_DEVICE_NAME) );\r
+       AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_DEV, ("Destroying %s device.\n",\r
+               (const char *)AL_DEVICE_NAME) );\r
 \r
        /*\r
         * Destroy access layer services.\r
         */\r
        if( gp_al_mgr )\r
        {\r
-               CL_TRACE( AL_DBG_DEV, g_al_dbg_lvl, ("Destroying AL Mgr.\n") );\r
+               AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_DEV, ("Destroying AL Mgr.\n") );\r
                ref_al_obj( &gp_al_mgr->obj );\r
                gp_al_mgr->obj.pfn_destroy( &gp_al_mgr->obj, NULL );\r
        }\r
@@ -138,7 +145,7 @@ al_cleanup( void )
 #if AL_OBJ_PRIVATE_ASYNC_PROC\r
        if( gp_async_obj_mgr )\r
        {\r
-               CL_TRACE( AL_DBG_DEV, g_al_dbg_lvl,\r
+               AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_DEV,\r
                        ("Destroying async obj mgr.\n") );\r
                cl_async_proc_destroy( gp_async_obj_mgr );\r
                gp_async_obj_mgr = NULL;\r
@@ -147,7 +154,7 @@ al_cleanup( void )
 \r
        if( gp_async_pnp_mgr )\r
        {\r
-               CL_TRACE( AL_DBG_DEV, g_al_dbg_lvl,\r
+               AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_DEV,\r
                        ("Destroying async pnp mgr.\n") );\r
                cl_async_proc_destroy( gp_async_pnp_mgr );\r
                gp_async_pnp_mgr = NULL;\r
@@ -155,12 +162,12 @@ al_cleanup( void )
 \r
        if( gp_async_proc_mgr )\r
        {\r
-               CL_TRACE( AL_DBG_DEV, g_al_dbg_lvl,\r
+               AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_DEV,\r
                        ("Destroying async proc mgr.\n") );\r
                cl_async_proc_destroy( gp_async_proc_mgr );\r
                cl_free( gp_async_proc_mgr );\r
                gp_async_proc_mgr = NULL;\r
        }\r
 \r
-       CL_TRACE_EXIT( AL_DBG_DEV, g_al_dbg_lvl, ("Goodbye Cruel World =(\n") );\r
+       AL_PRINT_EXIT( TRACE_LEVEL_WARNING, AL_DBG_DEV, ("Goodbye Cruel World =(\n") );\r
 }\r
index 4038e9c..00066a5 100644 (file)
 \r
 #include "al.h"\r
 #include "al_debug.h"\r
+\r
+#if defined(EVENT_TRACING)\r
+#ifdef offsetof\r
+#undef offsetof\r
+#endif\r
+#include "al_mad.tmh"\r
+#endif\r
+\r
 #include "al_cq.h"\r
 #include "al_mad.h"\r
 #include "al_qp.h"\r
@@ -291,7 +299,7 @@ build_mad_recv(
        IN                              ib_mad_element_t*                       p_mad_element,\r
        IN                              ib_wc_t*                                        p_wc )\r
 {\r
-       CL_ENTER( AL_DBG_SMI, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_SMI );\r
 \r
        CL_ASSERT( p_mad_element );\r
        CL_ASSERT( p_wc );\r
@@ -329,7 +337,7 @@ build_mad_recv(
        if( p_wc->recv.ud.recv_opt & IB_RECV_OPT_IMMEDIATE )\r
                p_mad_element->immediate_data = p_wc->recv.ud.immediate_data;\r
 \r
-       CL_EXIT( AL_DBG_SMI, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_SMI );\r
 }\r
 \r
 \r
@@ -351,11 +359,11 @@ create_mad_disp(
        ib_api_status_t                 status;\r
        cl_status_t                             cl_status;\r
 \r
-       CL_ENTER( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MAD_SVC );\r
        h_mad_disp = cl_zalloc( sizeof( al_mad_disp_t ) );\r
        if( !h_mad_disp )\r
        {\r
-               CL_TRACE( AL_DBG_ERROR, g_al_dbg_lvl, ("insufficient memory\n") );\r
+               AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("insufficient memory\n") );\r
                return IB_INSUFFICIENT_MEMORY;\r
        }\r
 \r
@@ -367,7 +375,7 @@ create_mad_disp(
                NULL, __cleanup_mad_disp, __free_mad_disp );\r
        if( status != IB_SUCCESS )\r
        {\r
-               CL_TRACE( AL_DBG_ERROR, g_al_dbg_lvl, ("init obj: %s\n",\r
+               AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("init obj: %s\n",\r
                        ib_get_err_str(status)) );\r
                __free_mad_disp( &h_mad_disp->obj );\r
                return status;\r
@@ -376,7 +384,7 @@ create_mad_disp(
        if( status != IB_SUCCESS )\r
        {\r
                h_mad_disp->obj.pfn_destroy( &h_mad_disp->obj, NULL );\r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("attach_al_obj returned %s.\n", ib_get_err_str(status)) );\r
                return status;\r
        }\r
@@ -409,7 +417,7 @@ create_mad_disp(
        /* Release the reference taken in init_al_obj. */\r
        deref_al_obj( &h_mad_disp->obj );\r
 \r
-       CL_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MAD_SVC );\r
        return IB_SUCCESS;\r
 }\r
 \r
@@ -421,7 +429,7 @@ __cleanup_mad_disp(
 {\r
        al_mad_disp_handle_t    h_mad_disp;\r
 \r
-       CL_ENTER( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MAD_SVC );\r
        CL_ASSERT( p_obj );\r
        h_mad_disp = PARENT_STRUCT( p_obj, al_mad_disp_t, obj );\r
 \r
@@ -429,7 +437,7 @@ __cleanup_mad_disp(
        if( h_mad_disp->h_qp )\r
                deref_al_obj( &h_mad_disp->h_qp->obj );\r
 \r
-       CL_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MAD_SVC );\r
 }\r
 \r
 \r
@@ -440,7 +448,7 @@ __free_mad_disp(
 {\r
        al_mad_disp_handle_t    h_mad_disp;\r
 \r
-       CL_ENTER( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MAD_SVC );\r
        CL_ASSERT( p_obj );\r
        h_mad_disp = PARENT_STRUCT( p_obj, al_mad_disp_t, obj );\r
 \r
@@ -448,7 +456,7 @@ __free_mad_disp(
        cl_vector_destroy( &h_mad_disp->version_vector );\r
        destroy_al_obj( p_obj );\r
        cl_free( h_mad_disp );\r
-       CL_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MAD_SVC );\r
 }\r
 \r
 \r
@@ -465,7 +473,7 @@ __mad_disp_reg(
        size_t                                  i;\r
        cl_status_t                             cl_status;\r
 \r
-       CL_ENTER( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MAD_SVC );\r
        cl_spinlock_acquire( &h_mad_disp->obj.lock );\r
 \r
        /* Find an empty slot in the client vector for the registration. */\r
@@ -503,7 +511,7 @@ __mad_disp_reg(
                if( !__mad_disp_reg_unsol( h_mad_disp, h_mad_reg, p_mad_svc ) )\r
                {\r
                        cl_spinlock_release( &h_mad_disp->obj.lock );\r
-                       CL_TRACE( AL_DBG_ERROR, g_al_dbg_lvl, ("reg unsol failed\n") );\r
+                       AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("reg unsol failed\n") );\r
                        return NULL;\r
                }\r
        }\r
@@ -516,7 +524,7 @@ __mad_disp_reg(
        /* The MAD service needs to take a reference on the dispatcher. */\r
        ref_al_obj( &h_mad_disp->obj );\r
 \r
-       CL_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MAD_SVC );\r
        return h_mad_reg;\r
 }\r
 \r
@@ -621,7 +629,7 @@ __mad_disp_reg_unsol(
        uint8_t                         i;\r
 \r
        /* Ensure that we are ready to handle this version number. */\r
-       CL_ENTER( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MAD_SVC );\r
        cl_status = cl_vector_set_min_size( &h_mad_disp->version_vector,\r
                __mgmt_version_index( p_mad_svc->mgmt_version ) + 1 );\r
        if( cl_status != CL_SUCCESS )\r
@@ -653,7 +661,7 @@ __mad_disp_reg_unsol(
                        /* No one else can be registered for this method. */\r
                        if( cl_ptr_vector_get( p_method_ptr_vector, i ) )\r
                        {\r
-                               CL_TRACE(AL_DBG_ERROR, g_al_dbg_lvl, \r
+                               AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                                        ("Other client already registered for Un-Solicited Method "\r
                                        "%u for version %u of class %u.\n", i, p_mad_svc->mgmt_version,\r
                                        p_mad_svc->mgmt_class ) );\r
@@ -669,7 +677,7 @@ __mad_disp_reg_unsol(
                {\r
                        cl_ptr_vector_set( p_method_ptr_vector, i, h_mad_reg );\r
 \r
-                       CL_TRACE( AL_DBG_MAD_SVC, g_al_dbg_lvl,\r
+                       AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_MAD_SVC,\r
                                ("Register version:%u (%u) class:0x%02X(%u) method:0x%02X Hdl:%p\n",\r
                                p_mad_svc->mgmt_version,\r
                                __mgmt_version_index( p_mad_svc->mgmt_version ),\r
@@ -680,7 +688,7 @@ __mad_disp_reg_unsol(
                }\r
        }\r
 \r
-       CL_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MAD_SVC );\r
        return TRUE;\r
 }\r
 \r
@@ -718,7 +726,7 @@ __mad_disp_dereg(
        cl_ptr_vector_t                 *p_method_ptr_vector;\r
        size_t                                  i;\r
 \r
-       CL_ENTER( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MAD_SVC );\r
        h_mad_disp = h_mad_reg->h_mad_disp;\r
 \r
        cl_spinlock_acquire( &h_mad_disp->obj.lock );\r
@@ -749,7 +757,7 @@ __mad_disp_dereg(
 \r
        /* The MAD service no longer requires access to the MAD dispatcher. */\r
        deref_al_obj( &h_mad_disp->obj );\r
-       CL_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MAD_SVC );\r
 }\r
 \r
 \r
@@ -765,7 +773,7 @@ __mad_disp_queue_send(
         * Increment the reference count on the registration to ensure that\r
         * the MAD service does not go away until the send completes.\r
         */\r
-       CL_ENTER( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MAD_SVC );\r
        cl_atomic_inc( &h_mad_reg->ref_cnt );\r
        ref_al_obj( &h_mad_reg->h_mad_svc->obj );\r
 \r
@@ -778,7 +786,7 @@ __mad_disp_queue_send(
         * If we are the originator of the transaction, we need to modify the\r
         * TID to ensure that duplicate TIDs are not used by multiple clients.\r
         */\r
-       CL_TRACE( AL_DBG_MAD_SVC, g_al_dbg_lvl, ("dispatching TID: 0x%0"PRIx64"\n",\r
+       AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_MAD_SVC, ("dispatching TID: 0x%I64x\n",\r
                p_mad_hdr->trans_id) );\r
        p_mad_wr->client_tid = p_mad_hdr->trans_id;\r
        if( __use_tid_routing( p_mad_hdr, TRUE ) )\r
@@ -790,8 +798,8 @@ __mad_disp_queue_send(
                al_set_al_tid( &p_mad_hdr->trans_id, h_mad_reg->client_id );\r
 #pragma warning( pop )\r
 \r
-               CL_TRACE( AL_DBG_MAD_SVC, g_al_dbg_lvl,\r
-                       ("modified TID to: 0x%0"PRIx64"\n", p_mad_hdr->trans_id) );\r
+               AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_MAD_SVC,\r
+                       ("modified TID to: 0x%0I64x\n", p_mad_hdr->trans_id) );\r
        }\r
 \r
        /* Post the work request to the QP. */\r
@@ -799,7 +807,7 @@ __mad_disp_queue_send(
        h_mad_reg->h_mad_disp->h_qp->pfn_queue_mad(\r
                h_mad_reg->h_mad_disp->h_qp, p_mad_wr );\r
 \r
-       CL_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MAD_SVC );\r
 }\r
 \r
 \r
@@ -828,9 +836,9 @@ mad_disp_send_done(
        al_mad_reg_handle_t             h_mad_reg;\r
        ib_mad_t                                *p_mad_hdr;\r
 \r
-       CL_ENTER( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MAD_SVC );\r
 \r
-       CL_TRACE( AL_DBG_MAD_SVC, g_al_dbg_lvl, ("p_mad_wr 0x%p\n", p_mad_wr ) );\r
+       AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_MAD_SVC, ("p_mad_wr 0x%p\n", p_mad_wr ) );\r
 \r
        /* Get the MAD header. */\r
        p_mad_hdr = get_mad_hdr_from_wr( p_mad_wr );\r
@@ -843,7 +851,7 @@ mad_disp_send_done(
        CL_ASSERT( h_mad_reg && (h_mad_reg->client_id == p_mad_wr->client_id) );\r
 \r
        /* Reset the TID and WR ID. */\r
-       CL_TRACE( AL_DBG_MAD_SVC, g_al_dbg_lvl, ("send done TID: 0x%"PRIx64"\n",\r
+       AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_MAD_SVC, ("send done TID: 0x%I64x\n",\r
                p_mad_hdr->trans_id) );\r
        p_mad_hdr->trans_id = p_mad_wr->client_tid;\r
        p_mad_wr->send_wr.wr_id = 0;\r
@@ -856,7 +864,7 @@ mad_disp_send_done(
        deref_al_obj( &h_mad_reg->h_mad_svc->obj );\r
        cl_atomic_dec( &h_mad_reg->ref_cnt );\r
 \r
-       CL_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MAD_SVC );\r
 }\r
 \r
 \r
@@ -878,11 +886,11 @@ mad_disp_recv_done(
        cl_ptr_vector_t                 *p_method_ptr_vector;\r
        uint8_t                                 method;\r
 \r
-       CL_ENTER( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MAD_SVC );\r
        p_mad_hdr = ib_get_mad_buf( p_mad_element );\r
 \r
-       CL_TRACE( AL_DBG_MAD_SVC, g_al_dbg_lvl,\r
-               ("TID = 0x%"PRIx64 "\n"\r
+       AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_MAD_SVC,\r
+               ("TID = 0x%I64x\n"\r
                 "class = 0x%x.\n"\r
                 "version = 0x%x.\n"\r
                 "method = 0x%x.\n",\r
@@ -896,7 +904,7 @@ mad_disp_recv_done(
        if( __use_tid_routing( p_mad_hdr, FALSE ) )\r
        {\r
                /* The MAD was received in response to a send. */\r
-               CL_TRACE( AL_DBG_MAD_SVC, g_al_dbg_lvl, ("routing based on TID\n"));\r
+               AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_MAD_SVC, ("routing based on TID\n"));\r
 \r
                /* Verify that we have a registration entry. */\r
                if( al_get_al_tid( p_mad_hdr->trans_id ) >=\r
@@ -904,7 +912,7 @@ mad_disp_recv_done(
                {\r
                        /* No clients for this version-class-method. */\r
                        cl_spinlock_release( &h_mad_disp->obj.lock );\r
-                       CL_TRACE_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl,\r
+                       AL_PRINT_EXIT( TRACE_LEVEL_WARNING, AL_DBG_MAD_SVC,\r
                                ("invalid client ID\n") );\r
                        return IB_NOT_FOUND;\r
                }\r
@@ -923,7 +931,7 @@ mad_disp_recv_done(
        }\r
        else\r
        {\r
-               CL_TRACE( AL_DBG_MAD_SVC, g_al_dbg_lvl,\r
+               AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_MAD_SVC,\r
                        ("routing based on version, class, method\n"));\r
 \r
                /* The receive is unsolicited.  Find the client. */\r
@@ -932,7 +940,7 @@ mad_disp_recv_done(
                {\r
                        /* No clients for this version of MADs. */\r
                        cl_spinlock_release( &h_mad_disp->obj.lock );\r
-                       CL_TRACE_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl,\r
+                       AL_PRINT_EXIT( TRACE_LEVEL_WARNING, AL_DBG_MAD_SVC,\r
                                ("no clients registered for this class version\n") );\r
                        return IB_NOT_FOUND;\r
                }\r
@@ -946,7 +954,7 @@ mad_disp_recv_done(
                {\r
                        /* No clients for this version-class. */\r
                        cl_spinlock_release( &h_mad_disp->obj.lock );\r
-                       CL_TRACE_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl,\r
+                       AL_PRINT_EXIT( TRACE_LEVEL_WARNING, AL_DBG_MAD_SVC,\r
                                ("no clients registered for this class\n") );\r
                        return IB_NOT_FOUND;\r
                }\r
@@ -960,7 +968,7 @@ mad_disp_recv_done(
                {\r
                        /* No clients for this version-class-method. */\r
                        cl_spinlock_release( &h_mad_disp->obj.lock );\r
-                       CL_TRACE_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl,\r
+                       AL_PRINT_EXIT( TRACE_LEVEL_WARNING, AL_DBG_MAD_SVC,\r
                                ("no clients registered for this method-out of range\n") );\r
                        return IB_NOT_FOUND;\r
                }\r
@@ -970,7 +978,7 @@ mad_disp_recv_done(
                {\r
                        /* No clients for this version-class-method. */\r
                        cl_spinlock_release( &h_mad_disp->obj.lock );\r
-                       CL_TRACE_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl,\r
+                       AL_PRINT_EXIT( TRACE_LEVEL_WARNING, AL_DBG_MAD_SVC,\r
                                ("no clients registered for method %u of class %u(%u) version %u(%u)\n",\r
                                 method,\r
                                 p_mad_hdr->mgmt_class,\r
@@ -986,7 +994,7 @@ mad_disp_recv_done(
        if( !h_mad_reg->ref_cnt )\r
        {\r
                cl_spinlock_release( &h_mad_disp->obj.lock );\r
-               CL_TRACE_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_WARNING, AL_DBG_MAD_SVC,\r
                        ("no client registered\n") );\r
                return IB_NOT_FOUND;\r
        }\r
@@ -1002,7 +1010,7 @@ mad_disp_recv_done(
 \r
        h_mad_reg->pfn_recv_done( h_mad_svc, p_mad_element );\r
        deref_al_obj( &h_mad_svc->obj );\r
-       CL_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MAD_SVC );\r
        return IB_SUCCESS;\r
 }\r
 \r
@@ -1019,12 +1027,12 @@ __use_tid_routing(
        ib_rmpp_mad_t           *p_rmpp_mad;\r
        boolean_t                       is_orig;\r
 \r
-       CL_ENTER( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MAD_SVC );\r
 \r
        /* CM MADs are never TID routed. */\r
        if( p_mad_hdr->mgmt_class == IB_MCLASS_COMM_MGMT )\r
        {\r
-               CL_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+               AL_EXIT( AL_DBG_MAD_SVC );\r
                return FALSE;\r
        }\r
 \r
@@ -1068,7 +1076,7 @@ __use_tid_routing(
        if( !are_we_sender )\r
                is_orig = !is_orig;\r
 \r
-       CL_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MAD_SVC );\r
        return is_orig;\r
 }\r
 \r
@@ -1097,7 +1105,7 @@ reg_mad_svc(
        al_qp_alias_t           *p_qp_alias;\r
        ib_qp_attr_t            qp_attr;\r
 \r
-       CL_ENTER( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MAD_SVC );\r
        CL_ASSERT( h_qp );\r
 \r
        switch( h_qp->type )\r
@@ -1110,13 +1118,13 @@ reg_mad_svc(
                break;\r
 \r
        default:\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
        if( !p_mad_svc || !ph_mad_svc )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
@@ -1151,7 +1159,7 @@ reg_mad_svc(
        if( status != IB_SUCCESS )\r
        {\r
                h_mad_svc->obj.pfn_destroy( &h_mad_svc->obj, NULL );\r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("attach_al_obj returned %s.\n", ib_get_err_str(status)) );\r
                return status;\r
        }\r
@@ -1192,7 +1200,7 @@ reg_mad_svc(
 \r
        *ph_mad_svc = h_mad_svc;\r
 \r
-       CL_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MAD_SVC );\r
        return IB_SUCCESS;\r
 }\r
 \r
@@ -1211,7 +1219,7 @@ __destroying_mad_svc(
        KIRQL                                   old_irql;\r
 #endif\r
 \r
-       CL_ENTER( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MAD_SVC );\r
        CL_ASSERT( p_obj );\r
        h_mad_svc = PARENT_STRUCT( p_obj, al_mad_svc_t, obj );\r
 \r
@@ -1245,7 +1253,7 @@ __destroying_mad_svc(
                 p_list_item != cl_qlist_end( &h_mad_svc->send_list );\r
                 p_list_item = cl_qlist_next( p_list_item ) )\r
        {\r
-               CL_TRACE( AL_DBG_MAD_SVC, g_al_dbg_lvl, ("canceling MAD\n") );\r
+               AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_MAD_SVC, ("canceling MAD\n") );\r
                h_send = PARENT_STRUCT( p_list_item, al_mad_send_t, pool_item );\r
                h_send->canceled = TRUE;\r
        }\r
@@ -1297,7 +1305,7 @@ __destroying_mad_svc(
        }\r
 #endif\r
 \r
-       CL_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MAD_SVC );\r
 }\r
 \r
 \r
@@ -1361,28 +1369,28 @@ ib_send_mad(
        ib_mad_element_t                        *p_cur_mad, *p_next_mad;\r
 #endif\r
 \r
-       CL_ENTER( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MAD_SVC );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_mad_svc, AL_OBJ_TYPE_H_MAD_SVC ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_HANDLE\n") );\r
                return IB_INVALID_HANDLE;\r
        }\r
        if( !p_mad_element_list ||\r
                ( p_mad_element_list->p_next && !pp_mad_failure ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
 #ifndef CL_KERNEL\r
        /* This is a send from user mode using special QP alias */\r
-       CL_TRACE( AL_DBG_MAD_SVC, g_al_dbg_lvl,\r
-               ("ib_send_mad: ual_context non-zero, TID = 0x%"PRIx64 ".\n",\r
+       AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_MAD_SVC,\r
+               ("ib_send_mad: ual_context non-zero, TID = 0x%I64x.\n",\r
                ((ib_mad_t*)(ib_get_mad_buf( p_mad_element_list )))->trans_id ));\r
        status = spl_qp_mad_send( h_mad_svc, p_mad_element_list,\r
                pp_mad_failure );\r
-       CL_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MAD_SVC );\r
        return status;\r
 #else\r
        /* Post each send on the list. */\r
@@ -1396,7 +1404,7 @@ ib_send_mad(
                        al_mad_element_t, element ) );\r
                if( !h_send )\r
                {\r
-                       CL_TRACE( AL_DBG_ERROR, g_al_dbg_lvl, ("unable to get mad_send\n") );\r
+                       AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("unable to get mad_send\n") );\r
                        if( pp_mad_failure )\r
                                *pp_mad_failure = p_cur_mad;\r
                        return IB_INSUFFICIENT_RESOURCES;\r
@@ -1406,7 +1414,7 @@ ib_send_mad(
                status = __init_send_mad( h_mad_svc, h_send, p_cur_mad );\r
                if( status != IB_SUCCESS )\r
                {\r
-                       CL_TRACE( AL_DBG_ERROR, g_al_dbg_lvl, ("init_send_mad failed: %s\n",\r
+                       AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("init_send_mad failed: %s\n",\r
                                ib_get_err_str(status)) );\r
                        put_mad_send( h_send );\r
                        if( pp_mad_failure )\r
@@ -1437,7 +1445,7 @@ ib_send_mad(
         */\r
        __mad_disp_resume_send( h_mad_svc->h_mad_reg );\r
 \r
-       CL_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MAD_SVC );\r
        return status;\r
 #endif\r
 }\r
@@ -1454,7 +1462,7 @@ __init_send_mad(
        uint8_t                         rmpp_version;\r
        ib_api_status_t         status;\r
 \r
-       CL_ENTER( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MAD_SVC );\r
 \r
        /* Initialize tracking the send. */\r
        h_send->p_send_mad = p_mad_element;\r
@@ -1467,13 +1475,13 @@ __init_send_mad(
        if( h_send->uses_rmpp )\r
        {\r
                /* The RMPP header is present. */\r
-               CL_TRACE( AL_DBG_MAD_SVC, g_al_dbg_lvl, ("RMPP is activated\n") );\r
+               AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_MAD_SVC, ("RMPP is activated\n") );\r
                p_rmpp_hdr = (ib_rmpp_mad_t*)p_mad_element->p_mad_buf;\r
 \r
                /* We only support version 1. */\r
                if( rmpp_version != DEFAULT_RMPP_VERSION )\r
                {\r
-                       CL_TRACE( AL_DBG_ERROR, g_al_dbg_lvl, ("unsupported version\n") );\r
+                       AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("unsupported version\n") );\r
                        return IB_INVALID_SETTING;\r
                }\r
 \r
@@ -1513,7 +1521,7 @@ __init_send_mad(
                }\r
        }\r
 \r
-       CL_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MAD_SVC );\r
        return IB_SUCCESS;\r
 }\r
 \r
@@ -1603,7 +1611,7 @@ __queue_rmpp_seg(
 {\r
        ib_rmpp_mad_t           *p_rmpp_hdr;\r
 \r
-       CL_ENTER( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MAD_SVC );\r
 \r
        CL_ASSERT( h_mad_reg && h_send );\r
        CL_ASSERT( h_send->cur_seg <= h_send->seg_limit );\r
@@ -1667,7 +1675,7 @@ __queue_rmpp_seg(
        /* Send the MAD. */\r
        __queue_mad_wr( h_mad_reg, h_send );\r
 \r
-       CL_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MAD_SVC );\r
 }\r
 \r
 \r
@@ -1686,7 +1694,7 @@ __queue_mad_wr(
        uint8_t                         *p_rmpp_src, *p_rmpp_dst;\r
        uintn_t                         hdr_len, offset, max_len;\r
 \r
-       CL_ENTER( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MAD_SVC );\r
        p_send_wr = &h_send->mad_wr.send_wr;\r
 \r
        cl_memclr( p_send_wr, sizeof( ib_send_wr_t ) );\r
@@ -1749,7 +1757,7 @@ __queue_mad_wr(
 \r
        __mad_disp_queue_send( h_mad_reg, &h_send->mad_wr );\r
 \r
-       CL_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MAD_SVC );\r
 }\r
 \r
 \r
@@ -1783,23 +1791,23 @@ ib_cancel_mad(
        ib_api_status_t                 status;\r
 #endif\r
 \r
-       CL_ENTER( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MAD_SVC );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_mad_svc, AL_OBJ_TYPE_H_MAD_SVC ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_HANDLE\n") );\r
                return IB_INVALID_HANDLE;\r
        }\r
        if( !p_mad_element )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
 #ifndef CL_KERNEL\r
        /* This is a send from user mode using special QP alias */\r
        status = spl_qp_cancel_mad( h_mad_svc, p_mad_element );\r
-       CL_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MAD_SVC );\r
        return status;\r
 #else\r
        /* Search for the MAD in our MAD list.  It may have already completed. */\r
@@ -1810,7 +1818,7 @@ ib_cancel_mad(
        if( !p_list_item )\r
        {\r
                cl_spinlock_release( &h_mad_svc->obj.lock );\r
-               CL_TRACE( AL_DBG_MAD_SVC, g_al_dbg_lvl, ("mad not found\n") );\r
+               AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_MAD_SVC, ("mad not found\n") );\r
                return IB_NOT_FOUND;\r
        }\r
 \r
@@ -1826,7 +1834,7 @@ ib_cancel_mad(
        }\r
 \r
        cl_spinlock_release( &h_mad_svc->obj.lock );\r
-       CL_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MAD_SVC );\r
        return IB_SUCCESS;\r
 #endif\r
 }\r
@@ -1847,12 +1855,12 @@ ib_delay_mad(
 \r
        if( AL_OBJ_INVALID_HANDLE( h_mad_svc, AL_OBJ_TYPE_H_MAD_SVC ) )\r
        {\r
-               AL_TRACE_EXIT( AL_DBG_ERROR, ("IB_INVALID_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_HANDLE\n") );\r
                return IB_INVALID_HANDLE;\r
        }\r
        if( !p_mad_element )\r
        {\r
-               AL_TRACE_EXIT( AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
@@ -1871,7 +1879,7 @@ ib_delay_mad(
        if( !p_list_item )\r
        {\r
                cl_spinlock_release( &h_mad_svc->obj.lock );\r
-               AL_TRACE( AL_DBG_MAD_SVC, ("MAD not found\n") );\r
+               AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_MAD_SVC, ("MAD not found\n") );\r
                return IB_NOT_FOUND;\r
        }\r
 \r
@@ -1901,11 +1909,11 @@ __mad_svc_send_done(
 {\r
        ib_mad_send_handle_t    h_send;\r
 \r
-       CL_ENTER( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MAD_SVC );\r
        CL_ASSERT( h_mad_svc && p_mad_wr && !p_wc->p_next );\r
 \r
        h_send = PARENT_STRUCT( p_mad_wr, al_mad_send_t, mad_wr );\r
-       CL_TRACE( AL_DBG_MAD_SVC, g_al_dbg_lvl, ("send callback TID:0x%"PRIx64"\n",\r
+       AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_MAD_SVC, ("send callback TID:0x%I64x\n",\r
                __get_send_tid( h_send )) );\r
 \r
        /* We need to synchronize access to the list as well as the MAD request. */\r
@@ -1914,7 +1922,7 @@ __mad_svc_send_done(
        /* Complete internally sent MADs. */\r
        if( __is_internal_send( h_mad_svc->svc_type, h_send->p_send_mad ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl, ("internal send\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_WARNING, AL_DBG_MAD_SVC, ("internal send\n") );\r
                cl_qlist_remove_item( &h_mad_svc->send_list,\r
                        (cl_list_item_t*)&h_send->pool_item );\r
                cl_spinlock_release( &h_mad_svc->obj.lock );\r
@@ -1943,8 +1951,8 @@ __mad_svc_send_done(
                if( h_send->uses_rmpp && (h_send->cur_seg <= h_send->seg_limit) )\r
                {\r
                        /* Send the next segment. */\r
-                       CL_TRACE( AL_DBG_MAD_SVC, g_al_dbg_lvl,\r
-                               ("sending next RMPP segment for TID:0x%"PRIx64"\n",\r
+                       AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_MAD_SVC,\r
+                               ("sending next RMPP segment for TID:0x%I64x\n",\r
                                __get_send_tid( h_send )) );\r
 \r
                        __queue_rmpp_seg( h_mad_svc->h_mad_reg, h_send );\r
@@ -1952,8 +1960,8 @@ __mad_svc_send_done(
                else\r
                {\r
                        /* Continue waiting for a response or ACK. */\r
-                       CL_TRACE( AL_DBG_MAD_SVC, g_al_dbg_lvl,\r
-                               ("waiting for response for TID:0x%"PRIx64"\n",\r
+                       AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_MAD_SVC,\r
+                               ("waiting for response for TID:0x%I64x\n",\r
                                __get_send_tid( h_send )) );\r
 \r
                        __set_retry_time( h_send );\r
@@ -1969,7 +1977,7 @@ __mad_svc_send_done(
         */\r
        __mad_disp_resume_send( h_mad_svc->h_mad_reg );\r
 \r
-       CL_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MAD_SVC );\r
 }\r
 \r
 \r
@@ -1983,9 +1991,9 @@ __notify_send_comp(
        IN                              ib_mad_send_handle_t            h_send,\r
        IN                              ib_wc_status_t                          wc_status )\r
 {\r
-       CL_ENTER( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MAD_SVC );\r
 \r
-       CL_TRACE( AL_DBG_MAD_SVC, g_al_dbg_lvl, ("completing TID:0x%"PRIx64"\n",\r
+       AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_MAD_SVC, ("completing TID:0x%I64x\n",\r
                __get_send_tid( h_send )) );\r
 \r
        h_send->p_send_mad->status = wc_status;\r
@@ -2003,7 +2011,7 @@ __notify_send_comp(
 \r
        __cleanup_mad_send( h_mad_svc, h_send );\r
 \r
-       CL_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MAD_SVC );\r
 }\r
 \r
 \r
@@ -2037,19 +2045,19 @@ __is_send_mad_done(
        IN                              ib_mad_send_handle_t            h_send,\r
        IN                              ib_wc_t                                         *p_wc )\r
 {\r
-       CL_ENTER( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MAD_SVC );\r
 \r
        /* Complete the send if the request failed. */\r
        if( p_wc->status != IB_WCS_SUCCESS )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("y-send failed\n" ) );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("y-send failed\n" ) );\r
                return TRUE;\r
        }\r
 \r
        /* Complete the send if it has been canceled. */\r
        if( h_send->canceled )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_WARNING, AL_DBG_MAD_SVC,\r
                        ("y-send was canceled\n") );\r
                return TRUE;\r
        }\r
@@ -2057,7 +2065,7 @@ __is_send_mad_done(
        /* Complete the send if we have its response. */\r
        if( h_send->p_resp_mad )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_WARNING, AL_DBG_MAD_SVC,\r
                        ("y-response received\n") );\r
                return TRUE;\r
        }\r
@@ -2065,7 +2073,7 @@ __is_send_mad_done(
        /* RMPP sends cannot complete until all segments have been acked. */\r
        if( h_send->uses_rmpp && (h_send->ack_seg < h_send->total_seg) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_WARNING, AL_DBG_MAD_SVC,\r
                        ("more RMPP segments to send\n") );\r
                return FALSE;\r
        }\r
@@ -2076,13 +2084,13 @@ __is_send_mad_done(
         */\r
        if( h_send->p_send_mad->resp_expected )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_WARNING, AL_DBG_MAD_SVC,\r
                        ("no-waiting on response\n") );\r
                return FALSE;\r
        }\r
        else\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl, ("send completed\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_WARNING, AL_DBG_MAD_SVC, ("send completed\n") );\r
                return TRUE;\r
        }\r
 }\r
@@ -2102,7 +2110,7 @@ __mad_svc_match_recv(
        cl_list_item_t                  *p_list_item;\r
        ib_mad_send_handle_t    h_send;\r
 \r
-       CL_ENTER( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MAD_SVC );\r
 \r
        p_recv_hdr = p_recv_mad->p_mad_buf;\r
 \r
@@ -2114,7 +2122,7 @@ __mad_svc_match_recv(
                h_send = PARENT_STRUCT( p_list_item, al_mad_send_t, pool_item );\r
 \r
                /* Match on the transaction ID, ignoring internally generated sends. */\r
-               CL_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+               AL_EXIT( AL_DBG_MAD_SVC );\r
                if( (p_recv_hdr->trans_id == h_send->mad_wr.client_tid) &&\r
                         !__is_internal_send( h_mad_svc->svc_type, h_send->p_send_mad ) )\r
                {\r
@@ -2135,18 +2143,18 @@ __mad_svc_recv_done(
        ib_mad_t                                *p_mad_hdr;\r
        ib_api_status_t                 cl_status;\r
 \r
-       CL_ENTER( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MAD_SVC );\r
 \r
        p_mad_hdr = ib_get_mad_buf( p_mad_element );\r
-       CL_TRACE( AL_DBG_MAD_SVC, g_al_dbg_lvl, ("recv done TID:0x%"PRIx64"\n",\r
+       AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_MAD_SVC, ("recv done TID:0x%I64x\n",\r
                p_mad_hdr->trans_id) );\r
 \r
        /* Raw MAD services get all receives. */\r
        if( h_mad_svc->svc_type == IB_MAD_SVC_RAW )\r
        {\r
                /* Report the receive. */\r
-               CL_TRACE_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl,\r
-                       ("recv TID:0x%"PRIx64"\n", p_mad_hdr->trans_id) );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_WARNING, AL_DBG_MAD_SVC,\r
+                       ("recv TID:0x%I64x\n", p_mad_hdr->trans_id) );\r
                h_mad_svc->pfn_user_recv_cb( h_mad_svc, (void*)h_mad_svc->obj.context,\r
                        p_mad_element );\r
                return;\r
@@ -2158,8 +2166,8 @@ __mad_svc_recv_done(
         */\r
        if( p_mad_hdr->status & IB_MAD_STATUS_BUSY )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl,\r
-                       ("responder busy TID:0x%"PRIx64"\n", p_mad_hdr->trans_id) );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
+                       ("responder busy TID:0x%I64x\n", p_mad_hdr->trans_id) );\r
                ib_put_mad( p_mad_element );\r
                return;\r
        }\r
@@ -2172,7 +2180,7 @@ __mad_svc_recv_done(
                if( cl_status != CL_SUCCESS )\r
                {\r
                        /* The reassembly is not done. */\r
-                       CL_TRACE_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl,\r
+                       AL_PRINT_EXIT( TRACE_LEVEL_WARNING, AL_DBG_MAD_SVC,\r
                                ("no RMPP receive to report\n") );\r
                        return;\r
                }\r
@@ -2198,12 +2206,12 @@ __mad_svc_recv_done(
        else\r
        {\r
                /* Report the receive. */\r
-               CL_TRACE( AL_DBG_MAD_SVC, g_al_dbg_lvl, ("unsol recv TID:0x%"PRIx64"\n",\r
+               AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_MAD_SVC, ("unsol recv TID:0x%I64x\n",\r
                        p_mad_hdr->trans_id) );\r
                h_mad_svc->pfn_user_recv_cb( h_mad_svc, (void*)h_mad_svc->obj.context,\r
                        p_mad_element );\r
        }\r
-       CL_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MAD_SVC );\r
 }\r
 \r
 \r
@@ -2224,7 +2232,7 @@ __process_recv_resp(
         * Try to find the send.  The send may have already timed out or\r
         * have been canceled, so we need to search for it.\r
         */\r
-       CL_ENTER( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MAD_SVC );\r
        p_mad_hdr = ib_get_mad_buf( p_mad_element );\r
        cl_spinlock_acquire( &h_mad_svc->obj.lock );\r
 \r
@@ -2232,8 +2240,8 @@ __process_recv_resp(
        if( !h_send )\r
        {\r
                /* A matching send was not found. */\r
-               CL_TRACE_EXIT( AL_DBG_WARN, g_al_dbg_lvl,\r
-                       ("unmatched resp TID:0x%"PRIx64"\n", p_mad_hdr->trans_id) );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_WARNING, AL_DBG_MAD_SVC,\r
+                       ("unmatched resp TID:0x%I64x\n", p_mad_hdr->trans_id) );\r
                cl_spinlock_release( &h_mad_svc->obj.lock );\r
                ib_put_mad( p_mad_element );\r
                return;\r
@@ -2249,15 +2257,15 @@ __process_recv_resp(
        if( h_send->retry_time == MAX_TIME )\r
        {\r
                /* The send is currently active.  Do not report it. */\r
-               CL_TRACE( AL_DBG_MAD_SVC, g_al_dbg_lvl,\r
-                       ("resp send active TID:0x%"PRIx64"\n", p_mad_hdr->trans_id) );\r
+               AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_MAD_SVC,\r
+                       ("resp send active TID:0x%I64x\n", p_mad_hdr->trans_id) );\r
                h_send->p_resp_mad = p_mad_element;\r
                cl_spinlock_release( &h_mad_svc->obj.lock );\r
        }\r
        else\r
        {\r
-               CL_TRACE( AL_DBG_MAD_SVC, g_al_dbg_lvl,\r
-                       ("resp received TID:0x%"PRIx64"\n", p_mad_hdr->trans_id) );\r
+               AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_MAD_SVC,\r
+                       ("resp received TID:0x%I64x\n", p_mad_hdr->trans_id) );\r
 \r
                /* Report the send completion below. */\r
                cl_qlist_remove_item( &h_mad_svc->send_list,\r
@@ -2273,7 +2281,7 @@ __process_recv_resp(
                        h_send->p_send_mad );\r
                __cleanup_mad_send( h_mad_svc, h_send );\r
        }\r
-       CL_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MAD_SVC );\r
 }\r
 \r
 \r
@@ -2288,11 +2296,11 @@ __recv_requires_rmpp(
 {\r
        ib_rmpp_mad_t                           *p_rmpp_mad;\r
 \r
-       CL_ENTER( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MAD_SVC );\r
 \r
        p_rmpp_mad = (ib_rmpp_mad_t*)ib_get_mad_buf( p_mad_element );\r
 \r
-       CL_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MAD_SVC );\r
 \r
        switch( mad_svc_type )\r
        {\r
@@ -2356,7 +2364,7 @@ __do_rmpp_recv(
        ib_rmpp_mad_t           *p_rmpp_mad;\r
        cl_status_t                     cl_status;\r
 \r
-       CL_ENTER( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MAD_SVC );\r
 \r
        p_rmpp_mad = ib_get_mad_buf( *pp_mad_element );\r
        CL_ASSERT( ib_rmpp_is_flag_set( p_rmpp_mad, IB_RMPP_FLAG_ACTIVE ) );\r
@@ -2390,7 +2398,7 @@ __do_rmpp_recv(
                break;\r
        }\r
 \r
-       CL_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MAD_SVC );\r
        return cl_status;\r
 }\r
 \r
@@ -2799,7 +2807,7 @@ __process_rmpp_ack(
        boolean_t                               send_done = FALSE;\r
        ib_wc_status_t                  wc_status = IB_WCS_SUCCESS;\r
 \r
-       CL_ENTER( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MAD_SVC );\r
        p_rmpp_mad = (ib_rmpp_mad_t*)ib_get_mad_buf( p_mad_element );\r
 \r
        /*\r
@@ -2811,7 +2819,7 @@ __process_rmpp_ack(
        if( !h_send )\r
        {\r
                cl_spinlock_release( &h_mad_svc->obj.lock );\r
-               CL_TRACE_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_WARNING, AL_DBG_MAD_SVC,\r
                        ("ACK cannot find a matching send\n") );\r
                return;\r
        }\r
@@ -2820,7 +2828,7 @@ __process_rmpp_ack(
        if( cl_ntoh32( p_rmpp_mad->seg_num ) < h_send->ack_seg )\r
        {\r
                cl_spinlock_release( &h_mad_svc->obj.lock );\r
-               CL_TRACE_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_WARNING, AL_DBG_MAD_SVC,\r
                        ("old ACK - being dropped\n") );\r
                return;\r
        }\r
@@ -2841,7 +2849,7 @@ __process_rmpp_ack(
        if( h_send->retry_time == MAX_TIME )\r
        {\r
                cl_spinlock_release( &h_mad_svc->obj.lock );\r
-               CL_TRACE_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_WARNING, AL_DBG_MAD_SVC,\r
                        ("ACK processed, waiting for send to complete\n") );\r
                return;\r
        }\r
@@ -2885,7 +2893,7 @@ __process_rmpp_ack(
         */\r
        __mad_disp_resume_send( h_mad_svc->h_mad_reg );\r
 \r
-       CL_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MAD_SVC );\r
 }\r
 \r
 \r
@@ -2901,7 +2909,7 @@ __process_rmpp_nack(
        ib_mad_send_handle_t    h_send;\r
        ib_rmpp_mad_t                   *p_rmpp_mad;\r
 \r
-       CL_ENTER( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MAD_SVC );\r
        p_rmpp_mad = (ib_rmpp_mad_t*)ib_get_mad_buf( p_mad_element );\r
 \r
        /* Search for the send.  The send may have timed out or been canceled. */\r
@@ -2918,7 +2926,7 @@ __process_rmpp_nack(
        {\r
                h_send->canceled = TRUE;\r
                cl_spinlock_release( &h_mad_svc->obj.lock );\r
-               CL_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+               AL_EXIT( AL_DBG_MAD_SVC );\r
                return;\r
        }\r
 \r
@@ -2928,7 +2936,7 @@ __process_rmpp_nack(
        cl_spinlock_release( &h_mad_svc->obj.lock );\r
        __notify_send_comp( h_mad_svc, h_send, IB_WCS_CANCELED );\r
 \r
-       CL_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MAD_SVC );\r
 }\r
 \r
 \r
@@ -2949,11 +2957,11 @@ static void
 __send_timer_cb(\r
        IN                              void                                            *context )\r
 {\r
-       CL_ENTER( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MAD_SVC );\r
 \r
        __check_send_queue( (ib_mad_svc_handle_t)context );\r
 \r
-       CL_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MAD_SVC );\r
 }\r
 \r
 \r
@@ -2971,7 +2979,7 @@ __check_send_queue(
        uint64_t                                cur_time;\r
        cl_qlist_t                              timeout_list;\r
 \r
-       CL_ENTER( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MAD_SVC );\r
 \r
        /*\r
         * The timeout out list is used to call the user back without\r
@@ -2994,7 +3002,7 @@ __check_send_queue(
                if( h_send->retry_time == MAX_TIME )\r
                {\r
                        /* The request is still active. */\r
-                       CL_TRACE( AL_DBG_MAD_SVC, g_al_dbg_lvl, ("active TID:0x%"PRIx64"\n",\r
+                       AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_MAD_SVC, ("active TID:0x%I64x\n",\r
                                __get_send_tid( h_send )) );\r
                        continue;\r
                }\r
@@ -3004,7 +3012,7 @@ __check_send_queue(
                if( h_send->canceled )\r
                {\r
                        /* The request has been canceled. */\r
-                       CL_TRACE( AL_DBG_MAD_SVC, g_al_dbg_lvl, ("canceling TID:0x%"PRIx64"\n",\r
+                       AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_MAD_SVC, ("canceling TID:0x%I64x\n",\r
                                __get_send_tid( h_send )) );\r
 \r
                        h_send->p_send_mad->status = IB_WCS_CANCELED;\r
@@ -3017,7 +3025,7 @@ __check_send_queue(
                if( cur_time < h_send->retry_time )\r
                {\r
                        /* The request has not timed out. */\r
-                       CL_TRACE( AL_DBG_MAD_SVC, g_al_dbg_lvl, ("waiting on TID:0x%"PRIx64"\n",\r
+                       AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_MAD_SVC, ("waiting on TID:0x%I64x\n",\r
                                __get_send_tid( h_send )) );\r
 \r
                        /* Set the retry timer to the minimum needed time, in ms. */\r
@@ -3029,7 +3037,7 @@ __check_send_queue(
                /* See if we need to retry the send operation. */\r
                if( h_send->retry_cnt )\r
                {\r
-                       CL_TRACE( AL_DBG_MAD_SVC, g_al_dbg_lvl, ("retrying TID:0x%"PRIx64"\n",\r
+                       AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_MAD_SVC, ("retrying TID:0x%I64x\n",\r
                                __get_send_tid( h_send )) );\r
 \r
                        /* Retry the send. */\r
@@ -3061,8 +3069,8 @@ __check_send_queue(
                        continue;\r
                }\r
                /* The request has timed out or failed to be retried. */\r
-               AL_TRACE( AL_DBG_MAD_SVC | AL_DBG_WARN,\r
-                       ("timing out TID:0x%"PRIx64"\n", __get_send_tid( h_send )) );\r
+               AL_PRINT( TRACE_LEVEL_WARNING, AL_DBG_MAD_SVC,\r
+                       ("timing out TID:0x%I64x\n", __get_send_tid( h_send )) );\r
 \r
                h_send->p_send_mad->status = IB_WCS_TIMEOUT_RETRY_ERR;\r
                cl_qlist_remove_item( &h_mad_svc->send_list, p_list_item );\r
@@ -3088,7 +3096,7 @@ __check_send_queue(
                __cleanup_mad_send( h_mad_svc, h_send );\r
                p_list_item = cl_qlist_remove_head( &timeout_list );\r
        }\r
-       CL_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MAD_SVC );\r
 }\r
 \r
 \r
@@ -3102,7 +3110,7 @@ __recv_timer_cb(
        cl_list_item_t                  *p_list_item, *p_next_item;\r
        boolean_t                               restart_timer;\r
 \r
-       CL_ENTER( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MAD_SVC );\r
 \r
        h_mad_svc = (ib_mad_svc_handle_t)context;\r
 \r
@@ -3134,7 +3142,7 @@ __recv_timer_cb(
 \r
        if( restart_timer )\r
                cl_timer_start( &h_mad_svc->recv_timer, AL_REASSEMBLY_TIMEOUT );\r
-       CL_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MAD_SVC );\r
 }\r
 \r
 \r
@@ -3148,22 +3156,22 @@ ib_local_mad(
 {\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MAD_SVC );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_ca, AL_OBJ_TYPE_H_CA ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_CA_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_CA_HANDLE\n") );\r
                return IB_INVALID_CA_HANDLE;\r
        }\r
        if( !p_mad_in || !p_mad_out )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
        status = verbs_local_mad( h_ca, port_num, p_mad_in, p_mad_out );\r
 \r
-       CL_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MAD_SVC );\r
        return status;\r
 }\r
 \r
index 6ebd9c5..ce2b75a 100644 (file)
@@ -117,7 +117,7 @@ reg_mad_pool(
 /* Deregister a MAD pool key if it is of the expected type. */\r
 ib_api_status_t\r
 dereg_mad_pool(\r
-       IN              const   ib_pool_key_t                           pool_key ,\r
+       IN              const   ib_pool_key_t                           pool_key,\r
        IN              const   al_key_type_t                           expected_type );\r
 \r
 \r
index 14cb159..7dfca76 100644 (file)
 #include "al.h"\r
 #include "al_ca.h"\r
 #include "al_debug.h"\r
+\r
+#if defined(EVENT_TRACING)\r
+#ifdef offsetof\r
+#undef offsetof\r
+#endif\r
+#include "al_mcast.tmh"\r
+#endif\r
+\r
 #include "al_mgr.h"\r
 #include "al_qp.h"\r
 #include "al_verbs.h"\r
@@ -102,7 +110,7 @@ al_join_mcast(
        cl_status_t                             cl_status;\r
        boolean_t                               sync;\r
 \r
-       CL_ENTER( AL_DBG_MCAST, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MCAST );\r
 \r
        /*\r
         * Validate the port GUID.  There is no need to validate the pkey index as\r
@@ -113,7 +121,7 @@ al_join_mcast(
        status = get_port_num( h_qp->obj.p_ci_ca, p_mcast_req->port_guid, NULL );\r
        if( status != IB_SUCCESS )\r
        {\r
-               CL_TRACE( AL_DBG_ERROR, g_al_dbg_lvl,\r
+               AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("get_port_num failed, status: %s\n", ib_get_err_str(status)) );\r
                return status;\r
        }\r
@@ -122,7 +130,7 @@ al_join_mcast(
        h_mcast = cl_zalloc( sizeof( ib_mcast_t ) );\r
        if( !h_mcast )\r
        {\r
-               CL_TRACE( AL_DBG_ERROR, g_al_dbg_lvl, ("zalloc of h_mcast failed\n") );\r
+               AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("zalloc of h_mcast failed\n") );\r
                return IB_INSUFFICIENT_MEMORY;\r
        }\r
 \r
@@ -137,7 +145,7 @@ al_join_mcast(
        {\r
                if( !cl_is_blockable() )\r
                {\r
-                       AL_TRACE_EXIT( AL_DBG_ERROR,\r
+                       AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                                ("Thread context not blockable\n") );\r
                        __free_mcast( &h_mcast->obj );\r
                        return IB_INVALID_SETTING;\r
@@ -146,7 +154,7 @@ al_join_mcast(
                cl_status = cl_event_init( &h_mcast->event, TRUE );\r
                if( cl_status != CL_SUCCESS )\r
                {\r
-                       CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl,\r
+                       AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                                ("unable to initialize event for sync operation\n") );\r
                        __free_mcast( &h_mcast->obj );\r
                        return ib_convert_cl_status( cl_status );\r
@@ -158,7 +166,7 @@ al_join_mcast(
                __destroying_mcast, __cleanup_mcast, __free_mcast );\r
        if( status != IB_SUCCESS )\r
        {\r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("init_al_obj returned %s\n", ib_get_err_str( status )) );\r
                __free_mcast( &h_mcast->obj );\r
                return status;\r
@@ -178,7 +186,7 @@ al_join_mcast(
        if( status != IB_SUCCESS )\r
        {\r
                h_mcast->obj.pfn_destroy( &h_mcast->obj, NULL );\r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("attach_al_obj returned %s.\n", ib_get_err_str(status)) );\r
                return status;\r
        }\r
@@ -200,7 +208,7 @@ al_join_mcast(
        }\r
        else\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("unable to send join request: %s\n", ib_get_err_str(status)) );\r
                h_mcast->obj.pfn_destroy( &h_mcast->obj, NULL );\r
        }\r
@@ -210,7 +218,7 @@ al_join_mcast(
         * have the SA req outstanding.\r
         */\r
 \r
-       CL_EXIT( AL_DBG_MCAST, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MCAST );\r
        return status;\r
 }\r
 \r
@@ -223,7 +231,7 @@ __destroying_mcast(
        ib_user_query_t                 sa_mad_data;\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_MCAST, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MCAST );\r
 \r
        h_mcast = PARENT_STRUCT( p_obj, ib_mcast_t, obj );\r
 \r
@@ -268,7 +276,7 @@ __destroying_mcast(
        if( status != IB_SUCCESS )\r
                deref_al_obj( &h_mcast->obj );\r
 \r
-       CL_EXIT( AL_DBG_MCAST, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MCAST );\r
 }\r
 \r
 \r
@@ -279,7 +287,7 @@ __cleanup_mcast(
        ib_mcast_handle_t               h_mcast;\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_MCAST, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MCAST );\r
 \r
        h_mcast = PARENT_STRUCT( p_obj, ib_mcast_t, obj );\r
 \r
@@ -291,17 +299,17 @@ __cleanup_mcast(
         */\r
        if( h_mcast->h_ci_mcast )\r
        {\r
-               CL_TRACE( AL_DBG_MCAST, g_al_dbg_lvl,\r
+               AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_MCAST,\r
                        ("detaching from multicast group\n") );\r
                status = verbs_detach_mcast( h_mcast );\r
                if( status != IB_SUCCESS )\r
                {\r
-                       CL_TRACE( AL_DBG_ERROR, g_al_dbg_lvl,\r
+                       AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                                ("detach failed: %s\n", ib_get_err_str(status)) );\r
                }\r
        }\r
 \r
-       CL_EXIT( AL_DBG_MCAST, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MCAST );\r
 }\r
 \r
 \r
@@ -331,7 +339,7 @@ send_join(
        ib_user_query_t                 sa_mad_data;\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_MCAST, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MCAST );\r
 \r
        /* Set the request information. */\r
        p_mcast->sa_reg_req.pfn_sa_req_cb = join_req_cb;\r
@@ -349,7 +357,7 @@ send_join(
 \r
        if( p_mcast_req->create )\r
        {\r
-               CL_TRACE( AL_DBG_MCAST, g_al_dbg_lvl,\r
+               AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_MCAST,\r
                        ("requesting creation of mcast group\n") );\r
 \r
                /* Set the necessary creation components. */\r
@@ -397,7 +405,7 @@ send_join(
        status = al_send_sa_req( &p_mcast->sa_reg_req, p_mcast->port_guid,\r
                p_mcast_req->timeout_ms, p_mcast_req->retry_cnt, &sa_mad_data, 0 );\r
 \r
-       CL_EXIT( AL_DBG_MCAST, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MCAST );\r
        return status;\r
 }\r
 \r
@@ -413,7 +421,7 @@ join_req_cb(
        ib_mcast_handle_t               h_mcast;\r
        ib_sa_mad_t                             *p_sa_mad;\r
 \r
-       CL_ENTER( AL_DBG_MCAST, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MCAST );\r
        h_mcast = PARENT_STRUCT( p_sa_req, ib_mcast_t, sa_reg_req );\r
 \r
        /* Record the status of the join request. */\r
@@ -421,14 +429,14 @@ join_req_cb(
 \r
        if( p_mad_response )\r
        {\r
-               CL_TRACE( AL_DBG_MCAST, g_al_dbg_lvl, ("processing response\n") );\r
+               AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_MCAST, ("processing response\n") );\r
                p_sa_mad = (ib_sa_mad_t*)ib_get_mad_buf( p_mad_response );\r
                h_mcast->resp_status = p_sa_mad->status;\r
 \r
                /* Record the join membership information. */\r
                if( h_mcast->req_status == IB_SUCCESS )\r
                {\r
-                       CL_TRACE( AL_DBG_MCAST, g_al_dbg_lvl, ("join successful\n") );\r
+                       AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_MCAST, ("join successful\n") );\r
                        h_mcast->member_rec = *((ib_member_rec_t*)p_sa_mad->data);\r
                }\r
 \r
@@ -460,7 +468,7 @@ join_async_cb(
        ib_mcast_rec_t                  mcast_rec;\r
        boolean_t                               sync;\r
 \r
-       CL_ENTER( AL_DBG_MCAST, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MCAST );\r
 \r
        h_mcast = PARENT_STRUCT( p_item, ib_mcast_t, async );\r
 \r
@@ -527,7 +535,7 @@ join_async_cb(
        else\r
                deref_al_obj( &h_mcast->obj );\r
 \r
-       CL_EXIT( AL_DBG_MCAST, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MCAST );\r
 }\r
 \r
 \r
@@ -538,11 +546,11 @@ ib_leave_mcast(
        IN              const   ib_pfn_destroy_cb_t                     pfn_destroy_cb OPTIONAL )\r
 {\r
 \r
-       CL_ENTER( AL_DBG_MCAST, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MCAST );\r
 \r
        if( !h_mcast )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("IB_INVALID_MCAST_HANDLE\n") );\r
                return IB_INVALID_MCAST_HANDLE;\r
        }\r
@@ -565,7 +573,7 @@ leave_req_cb(
 {\r
        ib_mcast_handle_t               h_mcast;\r
 \r
-       CL_ENTER( AL_DBG_MCAST, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MCAST );\r
        h_mcast = PARENT_STRUCT( p_sa_req, ib_mcast_t, sa_dereg_req );\r
 \r
        if( p_mad_response )\r
@@ -576,7 +584,7 @@ leave_req_cb(
         * the SA operation is complete.\r
         */\r
        deref_al_obj( &h_mcast->obj );\r
-       CL_EXIT( AL_DBG_MCAST, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MCAST );\r
 }\r
 \r
 \r
@@ -621,7 +629,7 @@ al_attach_mcast(
        if( status != IB_SUCCESS )\r
        {\r
                h_attach->obj.pfn_destroy( &h_attach->obj, NULL );\r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("attach_al_obj returned %s.\n", ib_get_err_str(status)) );\r
                return status;\r
        }\r
index 33ddcc1..4830707 100644 (file)
 #include "al.h"\r
 #include "al_common.h"\r
 #include "al_debug.h"\r
+#if defined(EVENT_TRACING)\r
+#ifdef offsetof\r
+#undef offsetof\r
+#endif\r
+#include "al_mgr_shared.tmh"\r
+#endif\r
 #include "al_ci_ca.h"\r
 #include "ib_common.h"\r
 #include "al_debug.h"\r
@@ -55,7 +61,7 @@ print_al_obj(
 \r
        UNUSED_PARAM( p_obj );\r
 \r
-       CL_TRACE( AL_DBG_ERROR, g_al_dbg_lvl,\r
+       AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                ("AL object %p(%s), parent: %p ref_cnt: %d\n",\r
                p_obj, ib_get_obj_type( p_obj ), p_obj->p_parent_obj,\r
                p_obj->ref_cnt) );\r
@@ -119,7 +125,7 @@ find_ci_ca(
        cl_list_item_t          *p_list_item;\r
        al_ci_ca_t                      *p_ci_ca;\r
 \r
-       CL_ENTER( AL_DBG_MGR, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MGR );\r
 \r
        for( p_list_item = cl_qlist_head( &gp_al_mgr->ci_ca_list );\r
                 p_list_item != cl_qlist_end( &gp_al_mgr->ci_ca_list );\r
@@ -129,14 +135,14 @@ find_ci_ca(
                if( p_ci_ca->verbs.guid == ci_ca_guid &&\r
                        p_ci_ca->obj.state == CL_INITIALIZED )\r
                {\r
-                       CL_TRACE( AL_DBG_MGR, g_al_dbg_lvl,\r
-                               ("find_ci_ca:CA guid %"PRIx64".\n", ci_ca_guid) );\r
-                       CL_EXIT( AL_DBG_MGR, g_al_dbg_lvl );\r
+                       AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_MGR,\r
+                               ("find_ci_ca:CA guid %I64x.\n", ci_ca_guid) );\r
+                       AL_EXIT( AL_DBG_MGR );\r
                        return p_ci_ca;\r
                }\r
        }\r
 \r
-       CL_EXIT( AL_DBG_MGR, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MGR );\r
        return NULL;\r
 }\r
 \r
@@ -168,9 +174,9 @@ void
 release_ci_ca(\r
        IN              const   ib_ca_handle_t                          h_ca )\r
 {\r
-       CL_ENTER( AL_DBG_MGR, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MGR );\r
        remove_ca( h_ca );\r
-       CL_EXIT( AL_DBG_MGR, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MGR );\r
 }\r
 \r
 \r
@@ -179,12 +185,12 @@ void
 add_ci_ca(\r
        IN                              al_ci_ca_t* const                       p_ci_ca )\r
 {\r
-       CL_ENTER( AL_DBG_MGR, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MGR );\r
        cl_spinlock_acquire( &gp_al_mgr->obj.lock );\r
        cl_qlist_insert_tail( &gp_al_mgr->ci_ca_list, &p_ci_ca->list_item );\r
        ref_al_obj( &gp_al_mgr->obj );\r
        cl_spinlock_release( &gp_al_mgr->obj.lock );\r
-       CL_EXIT( AL_DBG_MGR, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MGR );\r
 }\r
 \r
 \r
@@ -192,12 +198,12 @@ void
 remove_ci_ca(\r
        IN                              al_ci_ca_t* const                       p_ci_ca )\r
 {\r
-       CL_ENTER( AL_DBG_MGR, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MGR );\r
        cl_spinlock_acquire( &gp_al_mgr->obj.lock );\r
        cl_qlist_remove_item( &gp_al_mgr->ci_ca_list, &p_ci_ca->list_item );\r
        cl_spinlock_release( &gp_al_mgr->obj.lock );\r
        deref_al_obj( &gp_al_mgr->obj );\r
-       CL_EXIT( AL_DBG_MGR, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MGR );\r
 }\r
 \r
 \r
@@ -244,7 +250,7 @@ __get_guid_by_gid (
        ib_ca_attr_t            *p_ca_attr = NULL;\r
        ib_port_attr_t          *p_port_attr = NULL;\r
 \r
-       CL_ENTER( AL_DBG_MGR, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MGR );\r
 \r
        CL_ASSERT( h_al && p_gid && p_guid );\r
 \r
@@ -331,7 +337,7 @@ end:
        if ( p_guid_array )\r
                cl_free( p_guid_array );\r
 \r
-       CL_EXIT( AL_DBG_MGR, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MGR );\r
        return status;\r
 }\r
 \r
@@ -345,22 +351,22 @@ ib_get_ca_by_gid(
 {\r
        ib_api_status_t         status;\r
 \r
-       CL_ENTER( AL_DBG_MGR, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MGR );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_al, AL_OBJ_TYPE_H_AL ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_AL_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_AL_HANDLE\n") );\r
                return IB_INVALID_AL_HANDLE;\r
        }\r
        if( !p_gid || !p_ca_guid )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
        status = __get_guid_by_gid( h_al, p_gid, SEARCH_CA_GUID, p_ca_guid );\r
 \r
-       CL_EXIT( AL_DBG_MGR, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MGR );\r
        return status;\r
 }\r
 \r
@@ -374,22 +380,22 @@ ib_get_port_by_gid(
 {\r
        ib_api_status_t         status;\r
 \r
-       CL_ENTER( AL_DBG_MGR, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MGR );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_al, AL_OBJ_TYPE_H_AL ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_AL_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_AL_HANDLE\n") );\r
                return IB_INVALID_AL_HANDLE;\r
        }\r
        if( !p_gid || !p_port_guid )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
        status = __get_guid_by_gid( h_al, p_gid, SEARCH_PORT_GUID, p_port_guid );\r
 \r
-       CL_EXIT( AL_DBG_MGR, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MGR );\r
        return status;\r
 }\r
 \r
@@ -408,16 +414,16 @@ ib_get_ca_guids(
        al_ci_ca_t                      *p_ci_ca;\r
        uintn_t                         guid_cnt;\r
 \r
-       CL_ENTER( AL_DBG_MGR, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MGR );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_al, AL_OBJ_TYPE_H_AL ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_AL_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_AL_HANDLE\n") );\r
                return IB_INVALID_AL_HANDLE;\r
        }\r
        if( !p_guid_cnt )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
@@ -439,7 +445,7 @@ ib_get_ca_guids(
                /* Return the actual count. */\r
                *p_guid_cnt = guid_cnt;\r
 \r
-               CL_EXIT( AL_DBG_MGR, g_al_dbg_lvl );\r
+               AL_EXIT( AL_DBG_MGR );\r
                return IB_INSUFFICIENT_MEMORY;\r
        }\r
 \r
@@ -459,7 +465,7 @@ ib_get_ca_guids(
        /* Allow CA additions or removals. */\r
        cl_spinlock_release( &gp_al_mgr->obj.lock );\r
 \r
-       CL_EXIT( AL_DBG_MGR, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MGR );\r
        return IB_SUCCESS;\r
 }\r
 \r
@@ -496,7 +502,7 @@ __get_ca_guid(
        al_ci_ca_t                      *p_ci_ca;\r
        ib_api_status_t         status;\r
 \r
-       CL_ENTER( AL_DBG_MGR, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MGR );\r
 \r
        /* Prevent CA additions or removals. */\r
        cl_spinlock_acquire( &gp_al_mgr->obj.lock );\r
@@ -506,7 +512,7 @@ __get_ca_guid(
                index >= cl_qlist_count( &gp_al_mgr->ci_ca_list ) )\r
        {\r
                cl_spinlock_release( &gp_al_mgr->obj.lock );\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_INDEX\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_INDEX\n") );\r
                return IB_INVALID_INDEX;\r
        }\r
 \r
@@ -534,7 +540,7 @@ __get_ca_guid(
 \r
        cl_spinlock_release( &gp_al_mgr->obj.lock );\r
 \r
-       CL_EXIT( AL_DBG_MGR, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MGR );\r
        return status;\r
 }\r
 \r
@@ -564,7 +570,7 @@ __get_port_guid(
        al_ci_ca_t                      *p_ci_ca;\r
        ib_api_status_t         status;\r
 \r
-       CL_ENTER( AL_DBG_MGR, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MGR );\r
 \r
        /* Prevent CA additions or removals. */\r
        cl_spinlock_acquire( &gp_al_mgr->obj.lock );\r
@@ -611,7 +617,7 @@ __get_port_guid(
                status = IB_INVALID_INDEX;\r
        }\r
 \r
-       CL_EXIT( AL_DBG_MGR, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MGR );\r
        return status;\r
 }\r
 \r
@@ -627,16 +633,16 @@ ib_get_guid(
 {\r
        ib_api_status_t         status;\r
 \r
-       CL_ENTER( AL_DBG_MGR, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MGR );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_al, AL_OBJ_TYPE_H_AL ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_AL_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_AL_HANDLE\n") );\r
                return IB_INVALID_AL_HANDLE;\r
        }\r
        if( !p_guid )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
@@ -651,16 +657,16 @@ ib_get_guid(
                break;\r
 \r
        case IB_PNP_IOC:\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("IOC GUIDs not supported at this time\n") );\r
                return IB_UNSUPPORTED;\r
 \r
        default:\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_SETTING\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_SETTING\n") );\r
                return IB_INVALID_SETTING;\r
        }\r
 \r
-       CL_EXIT( AL_DBG_MGR, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MGR );\r
        return status;\r
 }\r
 \r
index 27afa98..8fc389d 100644 (file)
 #include <iba/ib_al.h>\r
 #include "al.h"\r
 #include "al_debug.h"\r
+#if defined(EVENT_TRACING)\r
+#ifdef offsetof\r
+#undef offsetof\r
+#endif\r
+#include "al_mr_shared.tmh"\r
+#endif\r
 #include "al_mr.h"\r
 #include "al_pd.h"\r
 #include "al_res_mgr.h"\r
@@ -159,11 +165,11 @@ ib_reg_mem(
 {\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_MR, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MR );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_pd, AL_OBJ_TYPE_H_PD ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PD_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PD_HANDLE\n") );\r
                return IB_INVALID_PD_HANDLE;\r
        }\r
 \r
@@ -191,11 +197,11 @@ reg_mem(
        ib_mr_handle_t                  h_mr;\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_MR, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MR );\r
 \r
        if( !p_mr_create || !p_lkey || !p_rkey || !ph_mr )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
@@ -203,7 +209,7 @@ reg_mem(
        h_mr = alloc_mr();\r
        if( !h_mr )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("unable to allocate memory handle\n") );\r
                return IB_INSUFFICIENT_MEMORY;\r
        }\r
@@ -212,7 +218,7 @@ reg_mem(
        if( status != IB_SUCCESS )\r
        {\r
                h_mr->obj.pfn_destroy( &h_mr->obj, NULL );\r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("attach_al_obj returned %s.\n", ib_get_err_str(status)) );\r
                return status;\r
        }\r
@@ -222,14 +228,14 @@ reg_mem(
        if( status != IB_SUCCESS )\r
        {\r
                h_mr->obj.pfn_destroy( &h_mr->obj, NULL );\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("unable to register memory: %s\n", ib_get_err_str(status)) );\r
                return status;\r
        }\r
 \r
        *ph_mr = h_mr;\r
 \r
-       CL_EXIT( AL_DBG_MR, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MR );\r
        return IB_SUCCESS;\r
 }\r
 \r
@@ -247,16 +253,16 @@ ib_reg_phys(
        ib_mr_handle_t                  h_mr;\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_MR, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MR );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_pd, AL_OBJ_TYPE_H_PD ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PD_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PD_HANDLE\n") );\r
                return IB_INVALID_PD_HANDLE;\r
        }\r
        if( !p_vaddr || !p_lkey || !p_rkey || !ph_mr )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
@@ -264,7 +270,7 @@ ib_reg_phys(
        h_mr = alloc_mr();\r
        if( !h_mr )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("unable to allocate memory handle\n") );\r
                return IB_INSUFFICIENT_MEMORY;\r
        }\r
@@ -273,7 +279,7 @@ ib_reg_phys(
        if( status != IB_SUCCESS )\r
        {\r
                h_mr->obj.pfn_destroy( &h_mr->obj, NULL );\r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("attach_al_obj returned %s.\n", ib_get_err_str(status)) );\r
                return status;\r
        }\r
@@ -283,7 +289,7 @@ ib_reg_phys(
                p_lkey, p_rkey, h_mr );\r
        if( status != IB_SUCCESS )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("unable to register memory: %s\n", ib_get_err_str(status)) );\r
                h_mr->obj.pfn_destroy( &h_mr->obj, NULL );\r
                return status;\r
@@ -294,7 +300,7 @@ ib_reg_phys(
        /* Release the reference taken in alloc_mr for initialization. */\r
        deref_al_obj( &h_mr->obj );\r
 \r
-       CL_EXIT( AL_DBG_MR, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MR );\r
        return IB_SUCCESS;\r
 }\r
 \r
@@ -311,7 +317,7 @@ ib_rereg_mem(
 {\r
        if( AL_OBJ_INVALID_HANDLE( h_mr, AL_OBJ_TYPE_H_MR ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_MR_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_MR_HANDLE\n") );\r
                return IB_INVALID_MR_HANDLE;\r
        }\r
 \r
@@ -332,24 +338,24 @@ rereg_mem(
 {\r
        ib_api_status_t         status;\r
 \r
-       CL_ENTER( AL_DBG_MR, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MR );\r
 \r
        if( ( mr_mod_mask & IB_MR_MOD_PD ) )\r
        {\r
                if( AL_OBJ_INVALID_HANDLE( h_pd, AL_OBJ_TYPE_H_PD ) )\r
                {\r
-                       AL_TRACE_EXIT( AL_DBG_ERROR, ("IB_INVALID_PD_HANDLE\n") );\r
+                       AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PD_HANDLE\n") );\r
                        return IB_INVALID_PD_HANDLE;\r
                }\r
                if( h_pd->obj.h_al != h_mr->obj.h_al )\r
                {\r
-                       AL_TRACE_EXIT( AL_DBG_ERROR, ("IB_INVALID_PD_HANDLE\n") );\r
+                       AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PD_HANDLE\n") );\r
                        return IB_INVALID_PD_HANDLE;\r
                }\r
        }\r
        if( !p_lkey || !p_rkey )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
@@ -360,14 +366,14 @@ rereg_mem(
        /* If we're changing the PD, we need to update the object hierarchy. */\r
        if( h_pd && (status == IB_SUCCESS) )\r
        {\r
-               CL_TRACE( AL_DBG_MR, g_al_dbg_lvl, ("associating MR with new PD\n") );\r
+               AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_MR, ("associating MR with new PD\n") );\r
                detach_al_obj( &h_mr->obj );\r
                deref_al_obj( h_mr->obj.p_parent_obj );\r
                status = attach_al_obj( &h_pd->obj, &h_mr->obj );\r
                CL_ASSERT( status );\r
        }\r
 \r
-       CL_EXIT( AL_DBG_MR, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MR );\r
        return status;\r
 }\r
 \r
@@ -385,29 +391,29 @@ ib_rereg_phys(
 {\r
        ib_api_status_t         status;\r
 \r
-       CL_ENTER( AL_DBG_MR, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MR );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_mr, AL_OBJ_TYPE_H_MR ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_MR_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_MR_HANDLE\n") );\r
                return IB_INVALID_MR_HANDLE;\r
        }\r
        if( ( mr_mod_mask & IB_MR_MOD_PD ) )\r
        {\r
                if( AL_OBJ_INVALID_HANDLE( h_pd, AL_OBJ_TYPE_H_PD ) )\r
                {\r
-                       AL_TRACE_EXIT( AL_DBG_ERROR, ("IB_INVALID_PD_HANDLE\n") );\r
+                       AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PD_HANDLE\n") );\r
                        return IB_INVALID_PD_HANDLE;\r
                }\r
                if( h_pd->obj.p_parent_obj != h_mr->obj.p_parent_obj->p_parent_obj )\r
                {\r
-                       AL_TRACE_EXIT( AL_DBG_ERROR, ("IB_INVALID_PD_HANDLE\n") );\r
+                       AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PD_HANDLE\n") );\r
                        return IB_INVALID_PD_HANDLE;\r
                }\r
        }\r
        if( !p_vaddr || !p_lkey || !p_rkey )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
@@ -418,14 +424,14 @@ ib_rereg_phys(
        /* If we're changing the PD, we need to update the object hierarchy. */\r
        if( h_pd && (status == IB_SUCCESS) )\r
        {\r
-               CL_TRACE( AL_DBG_MR, g_al_dbg_lvl, ("associating MR with new PD\n") );\r
+               AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_MR, ("associating MR with new PD\n") );\r
                detach_al_obj( &h_mr->obj );\r
                deref_al_obj( h_mr->obj.p_parent_obj );\r
                status = attach_al_obj( &h_pd->obj, &h_mr->obj );\r
                CL_ASSERT( status );\r
        }\r
 \r
-       CL_EXIT( AL_DBG_MR, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MR );\r
        return status;\r
 }\r
 \r
@@ -445,12 +451,12 @@ ib_reg_shared(
 \r
        if( AL_OBJ_INVALID_HANDLE( h_mr, AL_OBJ_TYPE_H_MR ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_MR_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_MR_HANDLE\n") );\r
                return IB_INVALID_MR_HANDLE;\r
        }\r
        if( AL_OBJ_INVALID_HANDLE( h_pd, AL_OBJ_TYPE_H_PD ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PD_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PD_HANDLE\n") );\r
                return IB_INVALID_PD_HANDLE;\r
        }\r
 \r
@@ -480,11 +486,11 @@ reg_shared(
        ib_mr_handle_t                  h_new_mr;\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_MR, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MR );\r
 \r
        if( !p_vaddr || !p_lkey || !p_rkey || !ph_mr )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
@@ -492,7 +498,7 @@ reg_shared(
        h_new_mr = alloc_mr();\r
        if( !h_new_mr )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("unable to allocate memory handle\n") );\r
                return IB_INSUFFICIENT_MEMORY;\r
        }\r
@@ -501,7 +507,7 @@ reg_shared(
        if( status != IB_SUCCESS )\r
        {\r
                h_new_mr->obj.pfn_destroy( &h_new_mr->obj, NULL );\r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("attach_al_obj returned %s.\n", ib_get_err_str(status)) );\r
                return status;\r
        }\r
@@ -512,14 +518,14 @@ reg_shared(
        if( status != IB_SUCCESS )\r
        {\r
                h_new_mr->obj.pfn_destroy( &h_new_mr->obj, NULL );\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("unable to register memory: %s\n", ib_get_err_str(status)) );\r
                return status;\r
        }\r
 \r
        *ph_mr = h_new_mr;\r
 \r
-       CL_EXIT( AL_DBG_MR, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MR );\r
        return IB_SUCCESS;\r
 }\r
 \r
@@ -531,11 +537,11 @@ ib_dereg_mr(
 {\r
        ib_api_status_t         status;\r
 \r
-       CL_ENTER( AL_DBG_MR, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MR );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_mr, AL_OBJ_TYPE_H_MR ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_MR_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_MR_HANDLE\n") );\r
                return IB_INVALID_MR_HANDLE;\r
        }\r
 \r
@@ -545,7 +551,7 @@ ib_dereg_mr(
        if( status != IB_SUCCESS )\r
                deref_al_obj( &h_mr->obj );\r
 \r
-       CL_EXIT( AL_DBG_MR, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MR );\r
        return status;\r
 }\r
 \r
@@ -561,7 +567,7 @@ dereg_mr(
 \r
        if( !verbs_check_mr(h_mr) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_MR_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_MR_HANDLE\n") );\r
                return IB_INVALID_MR_HANDLE;\r
        }\r
 \r
@@ -584,7 +590,7 @@ dereg_mr(
                h_mr->obj.pfn_destroy( &h_mr->obj, NULL );\r
        }\r
 \r
-       CL_EXIT( AL_DBG_MR, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MR );\r
        return status;\r
 }\r
 \r
@@ -597,16 +603,16 @@ ib_query_mr(
 {\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_MR, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MR );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_mr, AL_OBJ_TYPE_H_MR ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_MR_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_MR_HANDLE\n") );\r
                return IB_INVALID_MR_HANDLE;\r
        }\r
        if( !p_mr_attr )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
@@ -619,10 +625,10 @@ ib_query_mr(
        }\r
        else\r
        {\r
-               CL_TRACE( AL_DBG_ERROR, g_al_dbg_lvl,\r
+               AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("unable to query memory region: %s\n", ib_get_err_str(status)) );\r
        }\r
 \r
-       CL_EXIT( AL_DBG_MR, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MR );\r
        return status;\r
 }\r
index 76e13c9..b7a30a5 100644 (file)
 #include <iba/ib_al.h>\r
 \r
 #include "al_debug.h"\r
+#if defined(EVENT_TRACING)\r
+#ifdef offsetof\r
+#undef offsetof\r
+#endif\r
+#include "al_mw.tmh"\r
+#endif\r
 #include "al_mw.h"\r
 #include "al_pd.h"\r
 #include "al_verbs.h"\r
@@ -66,7 +72,7 @@ create_mw(
 \r
        if( !p_rkey || !ph_mw )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
@@ -94,7 +100,7 @@ create_mw(
        if( status != IB_SUCCESS )\r
        {\r
                h_mw->obj.pfn_destroy( &h_mw->obj, NULL );\r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("attach_al_obj returned %s.\n", ib_get_err_str(status)) );\r
                return status;\r
        }\r
@@ -123,11 +129,11 @@ ib_destroy_mw(
 {\r
        ib_api_status_t         status;\r
 \r
-       CL_ENTER( AL_DBG_MW, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MW );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_mw, AL_OBJ_TYPE_H_MW ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_MW_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_MW_HANDLE\n") );\r
                return IB_INVALID_MW_HANDLE;\r
        }\r
 \r
@@ -138,7 +144,7 @@ ib_destroy_mw(
        if( status != IB_SUCCESS )\r
                deref_al_obj( &h_mw->obj );\r
 \r
-       CL_EXIT( AL_DBG_MW, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MW );\r
        return status;\r
 }\r
 \r
@@ -150,11 +156,11 @@ destroy_mw(
 {\r
        ib_api_status_t         status;\r
 \r
-       CL_ENTER( AL_DBG_MW, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MW );\r
 \r
        if( !verbs_check_mw( h_mw ) )\r
        {\r
-               AL_TRACE_EXIT( AL_DBG_ERROR, ("IB_INVALID_MW_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_MW_HANDLE\n") );\r
                return IB_INVALID_MW_HANDLE;\r
        }\r
 \r
@@ -226,16 +232,16 @@ query_mw(
        ib_pd_handle_t                  h_ci_pd;\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_MW, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MW );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_mw, AL_OBJ_TYPE_H_MW ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_MW_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_MW_HANDLE\n") );\r
                return IB_INVALID_MW_HANDLE;\r
        }\r
        if( !ph_pd || !p_rkey )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
@@ -248,6 +254,6 @@ query_mw(
                CL_ASSERT( (*ph_pd)->h_ci_pd == h_ci_pd );\r
        }\r
 \r
-       CL_EXIT( AL_DBG_MW, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MW );\r
        return status;\r
 }\r
index bce9adb..16c426c 100644 (file)
 #include "al_ca.h"\r
 #include "al_cq.h"\r
 #include "al_debug.h"\r
+#if defined(EVENT_TRACING)\r
+#ifdef offsetof\r
+#undef offsetof\r
+#endif\r
+#include "al_pd.tmh"\r
+#endif\r
 #include "al_mgr.h"\r
 #include "al_mr.h"\r
 #include "al_mw.h"\r
@@ -79,7 +85,7 @@ alloc_pd(
 \r
        if( !ph_pd )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
@@ -109,7 +115,7 @@ alloc_pd(
        if( status != IB_SUCCESS )\r
        {\r
                h_pd->obj.pfn_destroy( &h_pd->obj, NULL );\r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("attach_al_obj returned %s.\n", ib_get_err_str(status)) );\r
                return status;\r
        }\r
@@ -151,18 +157,18 @@ ib_dealloc_pd(
        IN              const   ib_pd_handle_t                          h_pd,\r
        IN              const   ib_pfn_destroy_cb_t                     pfn_destroy_cb OPTIONAL )\r
 {\r
-       CL_ENTER( AL_DBG_PD, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_PD );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_pd, AL_OBJ_TYPE_H_PD ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PD_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PD_HANDLE\n") );\r
                return IB_INVALID_PD_HANDLE;\r
        }\r
 \r
        ref_al_obj( &h_pd->obj );\r
        h_pd->obj.pfn_destroy( &h_pd->obj, pfn_destroy_cb );\r
 \r
-       CL_EXIT( AL_DBG_PD, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_PD );\r
        return IB_SUCCESS;\r
 }\r
 \r
@@ -265,11 +271,11 @@ ib_create_qp(
 {\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_QP, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_QP );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_pd, AL_OBJ_TYPE_H_PD ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PD_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PD_HANDLE\n") );\r
                return IB_INVALID_PD_HANDLE;\r
        }\r
 \r
@@ -280,7 +286,7 @@ ib_create_qp(
        if( status == IB_SUCCESS )\r
                deref_al_obj( &(*ph_qp)->obj );\r
 \r
-       CL_EXIT( AL_DBG_QP, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_QP );\r
        return status;\r
 }\r
 \r
@@ -298,11 +304,11 @@ ib_get_spl_qp(
 {\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_QP, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_QP );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_pd, AL_OBJ_TYPE_H_PD ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PD_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PD_HANDLE\n") );\r
                return IB_INVALID_PD_HANDLE;\r
        }\r
 \r
@@ -313,7 +319,7 @@ ib_get_spl_qp(
        if( status == IB_SUCCESS )\r
                deref_al_obj( &(*ph_qp)->obj );\r
 \r
-       CL_EXIT( AL_DBG_QP, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_QP );\r
        return status;\r
 }\r
 \r
@@ -327,11 +333,11 @@ ib_create_av(
 {\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_AV, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_AV );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_pd, AL_OBJ_TYPE_H_PD ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PD_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PD_HANDLE\n") );\r
                return IB_INVALID_PD_HANDLE;\r
        }\r
 \r
@@ -341,7 +347,7 @@ ib_create_av(
        if( status == IB_SUCCESS )\r
                deref_al_obj( &(*ph_av)->obj );\r
 \r
-       CL_EXIT( AL_DBG_AV, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_AV );\r
        return status;\r
 }\r
 \r
@@ -355,11 +361,11 @@ ib_create_mw(
 {\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_MW, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MW );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_pd, AL_OBJ_TYPE_H_PD ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PD_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PD_HANDLE\n") );\r
                return IB_INVALID_PD_HANDLE;\r
        }\r
 \r
@@ -368,7 +374,7 @@ ib_create_mw(
        if( status == IB_SUCCESS )\r
                deref_al_obj( &(*ph_mw)->obj );\r
 \r
-       CL_EXIT( AL_DBG_MW, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MW );\r
        return status;\r
 }\r
 \r
index b28c050..bcd2f5a 100644 (file)
 #include "al_cm_cep.h"\r
 #include "al_cq.h"\r
 #include "al_debug.h"\r
+#if defined(EVENT_TRACING)\r
+#ifdef offsetof\r
+#undef offsetof\r
+#endif\r
+#include "al_qp.tmh"\r
+#endif\r
 #include "al_mad.h"\r
 #include "al_mad_pool.h"\r
 #include "al_mcast.h"\r
@@ -284,7 +290,7 @@ create_qp(
 \r
        if( !p_qp_create || !ph_qp )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
@@ -377,7 +383,7 @@ get_spl_qp(
 \r
        if( !p_qp_create || !ph_qp )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
@@ -990,18 +996,18 @@ ib_destroy_qp(
        IN              const   ib_qp_handle_t                          h_qp,\r
        IN              const   ib_pfn_destroy_cb_t                     pfn_destroy_cb OPTIONAL )\r
 {\r
-       CL_ENTER( AL_DBG_QP, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_QP );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_qp, AL_OBJ_TYPE_H_QP ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_QP_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_QP_HANDLE\n") );\r
                return IB_INVALID_QP_HANDLE;\r
        }\r
 \r
        ref_al_obj( &h_qp->obj );\r
        h_qp->obj.pfn_destroy( &h_qp->obj, pfn_destroy_cb );\r
 \r
-       CL_EXIT( AL_DBG_QP, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_QP );\r
        return IB_SUCCESS;\r
 }\r
 \r
@@ -1061,7 +1067,7 @@ destroying_qp(
                        status = dereg_mad_pool( p_qp_alias->pool_key, AL_KEY_ALIAS );\r
                        if( status != IB_SUCCESS )\r
                        {\r
-                               AL_TRACE( AL_DBG_ERROR, ("dereg_mad_pool returned %s.\n",\r
+                               AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("dereg_mad_pool returned %s.\n",\r
                                        ib_get_err_str(status)) );\r
                                deref_al_obj( &p_qp_alias->pool_key->obj );\r
                        }\r
@@ -1131,7 +1137,7 @@ cleanup_qp(
                status = verbs_destroy_qp( h_qp );\r
                if( status != IB_SUCCESS )\r
                {\r
-                       CL_TRACE( AL_DBG_ERROR, g_al_dbg_lvl,\r
+                       AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                                ("verbs_destroy_qp failed with status %s.\n",\r
                                ib_get_err_str(status)) );\r
                }\r
@@ -1233,23 +1239,23 @@ query_qp(
 {\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_QP, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_QP );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_qp, AL_OBJ_TYPE_H_QP ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_QP_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_QP_HANDLE\n") );\r
                return IB_INVALID_QP_HANDLE;\r
        }\r
        if( !p_qp_attr )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
        status = verbs_query_qp( h_qp, p_qp_attr );\r
        if( status != IB_SUCCESS )\r
        {\r
-               CL_EXIT( AL_DBG_QP, g_al_dbg_lvl );\r
+               AL_EXIT( AL_DBG_QP );\r
                return status;\r
        }\r
 \r
@@ -1259,7 +1265,7 @@ query_qp(
        p_qp_attr->h_sq_cq = h_qp->h_send_cq;\r
        p_qp_attr->qp_type = h_qp->type;\r
 \r
-       CL_EXIT( AL_DBG_QP, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_QP );\r
        return IB_SUCCESS;\r
 }\r
 \r
@@ -1283,22 +1289,22 @@ modify_qp(
 {\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_QP, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_QP );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_qp, AL_OBJ_TYPE_H_QP ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_QP_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_QP_HANDLE\n") );\r
                return IB_INVALID_QP_HANDLE;\r
        }\r
        if( !p_qp_mod )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
        status = h_qp->pfn_modify_qp( h_qp, p_qp_mod, p_umv_buf );\r
 \r
-       CL_EXIT( AL_DBG_QP, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_QP );\r
        return status;\r
 }\r
 \r
@@ -1347,11 +1353,11 @@ ib_init_dgrm_svc(
 {\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_QP, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_QP );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_qp, AL_OBJ_TYPE_H_QP ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_QP_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_QP_HANDLE\n") );\r
                return IB_INVALID_QP_HANDLE;\r
        }\r
 \r
@@ -1367,20 +1373,20 @@ ib_init_dgrm_svc(
        case IB_QPT_MAD:\r
                if( !p_dgrm_info )\r
                {\r
-                       CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl,\r
+                       AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                                ("IB_INVALID_PARAMETER\n") );\r
                        return IB_INVALID_PARAMETER;\r
                }\r
                break;\r
 \r
        default:\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
        status = h_qp->pfn_init_dgrm_svc( h_qp, p_dgrm_info );\r
 \r
-       CL_EXIT( AL_DBG_QP, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_QP );\r
        return status;\r
 }\r
 \r
@@ -1504,11 +1510,11 @@ ib_reg_mad_svc(
 {\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MAD_SVC );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_qp, AL_OBJ_TYPE_H_QP ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_QP_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_QP_HANDLE\n") );\r
                return IB_INVALID_QP_HANDLE;\r
        }\r
 \r
@@ -1518,7 +1524,7 @@ ib_reg_mad_svc(
        if( status == IB_SUCCESS )\r
                deref_al_obj( &(*ph_mad_svc)->obj );\r
 \r
-       CL_EXIT( AL_DBG_MAD_SVC, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MAD_SVC );\r
        return status;\r
 }\r
 \r
@@ -1530,22 +1536,22 @@ ib_join_mcast(
 {\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_MCAST, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MCAST );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_qp, AL_OBJ_TYPE_H_QP ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_QP_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_QP_HANDLE\n") );\r
                return IB_INVALID_QP_HANDLE;\r
        }\r
        if( !p_mcast_req )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
        status = h_qp->pfn_join_mcast( h_qp, p_mcast_req );\r
 \r
-       CL_EXIT( AL_DBG_MCAST, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MCAST );\r
        return status;\r
 }\r
 \r
@@ -1565,16 +1571,16 @@ ib_post_send(
        PERF_DECLARE( PostSend );\r
 \r
        cl_perf_start( IbPostSend );\r
-       CL_ENTER( AL_DBG_QP, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_QP );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_qp, AL_OBJ_TYPE_H_QP ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_QP_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_QP_HANDLE\n") );\r
                return IB_INVALID_QP_HANDLE;\r
        }\r
        if( !p_send_wr || ( p_send_wr->p_next && !pp_send_failure ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
@@ -1583,7 +1589,7 @@ ib_post_send(
                h_qp->pfn_post_send( h_qp->h_send_qp, p_send_wr, pp_send_failure );\r
        cl_perf_stop( &g_perf, PostSend );\r
 \r
-       CL_EXIT( AL_DBG_QP, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_QP );\r
        cl_perf_stop( &g_perf, IbPostSend );\r
        return status;\r
 }\r
@@ -1777,23 +1783,23 @@ ib_post_recv(
 {\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_QP, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_QP );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_qp, AL_OBJ_TYPE_H_QP ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_QP_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_QP_HANDLE\n") );\r
                return IB_INVALID_QP_HANDLE;\r
        }\r
        if( !p_recv_wr || ( p_recv_wr->p_next && !pp_recv_failure ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
        status =\r
                h_qp->pfn_post_recv( h_qp->h_recv_qp, p_recv_wr, pp_recv_failure );\r
 \r
-       CL_EXIT( AL_DBG_QP, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_QP );\r
        return status;\r
 }\r
 \r
@@ -2052,21 +2058,21 @@ ib_bind_mw(
        ib_mr_handle_t                  h_mr;\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_MW, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_MW );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_mw, AL_OBJ_TYPE_H_MW ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_MW_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_MW_HANDLE\n") );\r
                return IB_INVALID_MW_HANDLE;\r
        }\r
        if( AL_OBJ_INVALID_HANDLE( h_qp, AL_OBJ_TYPE_H_QP ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_QP_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_QP_HANDLE\n") );\r
                return IB_INVALID_QP_HANDLE;\r
        }\r
        if( !p_mw_bind || !p_rkey )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
@@ -2078,6 +2084,6 @@ ib_bind_mw(
 \r
        p_mw_bind->h_mr = h_mr;\r
 \r
-       CL_EXIT( AL_DBG_MW, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_MW );\r
        return status;\r
 }\r
index 8dc8898..dd86d3b 100644 (file)
 #include "al_ca.h"\r
 #include "al_common.h"\r
 #include "al_debug.h"\r
+\r
+#if defined(EVENT_TRACING)\r
+#ifdef offsetof\r
+#undef offsetof\r
+#endif\r
+#include "al_query.tmh"\r
+#endif\r
 #include "al_mgr.h"\r
 #include "al_query.h"\r
 #include "ib_common.h"\r
@@ -66,21 +73,21 @@ ib_query(
        al_query_t                              *p_query;\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_QUERY, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_QUERY );\r
 \r
        if( AL_OBJ_INVALID_HANDLE( h_al, AL_OBJ_TYPE_H_AL ) )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_AL_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_AL_HANDLE\n") );\r
                return IB_INVALID_AL_HANDLE;\r
        }\r
        if( !p_query_req )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
        if( (p_query_req->flags & IB_FLAGS_SYNC) && !cl_is_blockable() )\r
        {\r
-               AL_TRACE_EXIT( AL_DBG_ERROR, ("IB_UNSUPPORTED\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_UNSUPPORTED\n") );\r
                return IB_UNSUPPORTED;\r
        }\r
 \r
@@ -88,7 +95,7 @@ ib_query(
        p_query = cl_zalloc( sizeof( al_query_t ) );\r
        if( !p_query )\r
        {\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("insufficient memory\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("insufficient memory\n") );\r
                return IB_INSUFFICIENT_MEMORY;\r
        }\r
 \r
@@ -112,7 +119,7 @@ ib_query(
        status = query_sa( p_query, p_query_req, p_query_req->flags );\r
        if( status != IB_SUCCESS && status != IB_INVALID_GUID )\r
        {\r
-               CL_TRACE( AL_DBG_ERROR, g_al_dbg_lvl,\r
+               AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("query_sa failed: %s\n", ib_get_err_str(status) ) );\r
        }\r
 \r
@@ -123,7 +130,7 @@ ib_query(
                cl_free( p_query );\r
        }\r
 \r
-       CL_EXIT( AL_DBG_QUERY, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_QUERY );\r
        return status;\r
 }\r
 \r
@@ -149,7 +156,7 @@ query_sa(
        }       rec;\r
        ib_api_status_t                 status;\r
 \r
-       CL_ENTER( AL_DBG_QUERY, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_QUERY );\r
 \r
        cl_memclr( &rec, sizeof(rec) );\r
 \r
@@ -161,7 +168,7 @@ query_sa(
        switch( p_query_req->query_type )\r
        {\r
        case IB_QUERY_USER_DEFINED:\r
-               CL_TRACE( AL_DBG_QUERY, g_al_dbg_lvl, ("USER_DEFINED\n") );\r
+               AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_QUERY, ("USER_DEFINED\n") );\r
                p_sa_req = (ib_user_query_t* __ptr64)p_query_req->p_query_input;\r
                if( !p_sa_req->method )\r
                {\r
@@ -171,7 +178,7 @@ query_sa(
                break;\r
 \r
        case IB_QUERY_ALL_SVC_RECS:\r
-               CL_TRACE( AL_DBG_QUERY, g_al_dbg_lvl, ("IB_QUERY_ALL_SVC_RECS\n") );\r
+               AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_QUERY, ("IB_QUERY_ALL_SVC_RECS\n") );\r
                sa_req.attr_id = IB_MAD_ATTR_SERVICE_RECORD;\r
                sa_req.attr_size = sizeof( ib_service_record_t );\r
                sa_req.comp_mask = 0;\r
@@ -179,7 +186,7 @@ query_sa(
                break;\r
 \r
        case IB_QUERY_SVC_REC_BY_NAME:\r
-               CL_TRACE( AL_DBG_QUERY, g_al_dbg_lvl, ("SVC_REC_BY_NAME\n") );\r
+               AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_QUERY, ("SVC_REC_BY_NAME\n") );\r
                sa_req.attr_id = IB_MAD_ATTR_SERVICE_RECORD;\r
                sa_req.attr_size = sizeof( ib_service_record_t );\r
                sa_req.comp_mask = IB_SR_COMPMASK_SNAME;\r
@@ -189,7 +196,7 @@ query_sa(
                break;\r
 \r
        case IB_QUERY_SVC_REC_BY_ID:\r
-               CL_TRACE( AL_DBG_QUERY, g_al_dbg_lvl, ("SVC_REC_BY_ID\n") );\r
+               AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_QUERY, ("SVC_REC_BY_ID\n") );\r
                sa_req.attr_id = IB_MAD_ATTR_SERVICE_RECORD;\r
                sa_req.attr_size = sizeof( ib_service_record_t );\r
                sa_req.comp_mask = IB_SR_COMPMASK_SID;\r
@@ -198,7 +205,7 @@ query_sa(
                break;\r
 \r
        case IB_QUERY_CLASS_PORT_INFO:\r
-               CL_TRACE( AL_DBG_QUERY, g_al_dbg_lvl, ("IB_QUERY_CLASS_PORT_INFO\n") );\r
+               AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_QUERY, ("IB_QUERY_CLASS_PORT_INFO\n") );\r
                sa_req.method = IB_MAD_METHOD_GET;\r
                sa_req.attr_id = IB_MAD_ATTR_CLASS_PORT_INFO;\r
                sa_req.attr_size = sizeof( ib_class_port_info_t );\r
@@ -207,7 +214,7 @@ query_sa(
                break;\r
 \r
        case IB_QUERY_NODE_REC_BY_NODE_GUID:\r
-               CL_TRACE( AL_DBG_QUERY, g_al_dbg_lvl, ("NODE_REC_BY_NODE_GUID\n") );\r
+               AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_QUERY, ("NODE_REC_BY_NODE_GUID\n") );\r
                /*\r
                 *      15.2.5.2:\r
                 * if >1 ports on of a CA/RTR the subnet return multiple\r
@@ -222,7 +229,7 @@ query_sa(
                break;\r
 \r
        case IB_QUERY_PORT_REC_BY_LID:\r
-               CL_TRACE( AL_DBG_QUERY, g_al_dbg_lvl, ("PORT_REC_BY_LID\n") );\r
+               AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_QUERY, ("PORT_REC_BY_LID\n") );\r
                sa_req.attr_id = IB_MAD_ATTR_PORTINFO_RECORD;\r
                sa_req.attr_size = sizeof( ib_portinfo_record_t );\r
                sa_req.comp_mask = IB_PIR_COMPMASK_BASELID;\r
@@ -232,7 +239,7 @@ query_sa(
                break;\r
 \r
        case IB_QUERY_PATH_REC_BY_PORT_GUIDS:\r
-               CL_TRACE( AL_DBG_QUERY, g_al_dbg_lvl, ("PATH_REC_BY_PORT_GUIDS\n") );\r
+               AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_QUERY, ("PATH_REC_BY_PORT_GUIDS\n") );\r
                sa_req.attr_id = IB_MAD_ATTR_PATH_RECORD;\r
                sa_req.attr_size = sizeof( ib_path_rec_t );\r
                sa_req.comp_mask = (IB_PR_COMPMASK_DGID |\r
@@ -246,7 +253,7 @@ query_sa(
                break;\r
 \r
        case IB_QUERY_PATH_REC_BY_GIDS:\r
-               CL_TRACE( AL_DBG_QUERY, g_al_dbg_lvl, ("PATH_REC_BY_GIDS\n") );\r
+               AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_QUERY, ("PATH_REC_BY_GIDS\n") );\r
                sa_req.attr_id = IB_MAD_ATTR_PATH_RECORD;\r
                sa_req.attr_size = sizeof( ib_path_rec_t );\r
                sa_req.comp_mask = (IB_PR_COMPMASK_DGID |\r
@@ -260,7 +267,7 @@ query_sa(
                break;\r
 \r
        case IB_QUERY_PATH_REC_BY_LIDS:\r
-               CL_TRACE( AL_DBG_QUERY, g_al_dbg_lvl, ("PATH_REC_BY_LIDS\n") );\r
+               AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_QUERY, ("PATH_REC_BY_LIDS\n") );\r
                /* SGID must be provided for GET_TABLE requests. */\r
                sa_req.method = IB_MAD_METHOD_GET;\r
                sa_req.attr_id = IB_MAD_ATTR_PATH_RECORD;\r
@@ -278,7 +285,7 @@ query_sa(
                break;\r
 \r
        default:\r
-               CL_TRACE_EXIT( AL_DBG_ERROR, g_al_dbg_lvl, ("UNKNOWN\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("UNKNOWN\n") );\r
                CL_ASSERT( p_query_req->query_type == IB_QUERY_USER_DEFINED ||\r
                        p_query_req->query_type == IB_QUERY_ALL_SVC_RECS ||\r
                        p_query_req->query_type == IB_QUERY_SVC_REC_BY_NAME ||\r
@@ -296,7 +303,7 @@ query_sa(
        status = al_send_sa_req(\r
                &p_query->sa_req, p_query_req->port_guid, p_query_req->timeout_ms,\r
                p_query_req->retry_cnt, p_sa_req, flags );\r
-       CL_EXIT( AL_DBG_QUERY, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_QUERY );\r
        return status;\r
 }\r
 \r
@@ -314,7 +321,7 @@ query_req_cb(
        ib_query_rec_t          query_rec;\r
        ib_sa_mad_t                     *p_sa_mad;\r
 \r
-       CL_ENTER( AL_DBG_QUERY, g_al_dbg_lvl );\r
+       AL_ENTER( AL_DBG_QUERY );\r
        p_query = PARENT_STRUCT( p_sa_req, al_query_t, sa_req );\r
 \r
        /* Initialize the results of the query. */\r
@@ -326,7 +333,7 @@ query_req_cb(
        /* Form the result of the query, if we got one. */\r
        if( query_rec.status == IB_SUCCESS )\r
        {\r
-               CL_TRACE( AL_DBG_QUERY, g_al_dbg_lvl,\r
+               AL_PRINT( TRACE_LEVEL_INFORMATION, AL_DBG_QUERY,\r
                        ("query succeeded\n") );\r
 \r
                CL_ASSERT( p_mad_response );\r
@@ -347,7 +354,7 @@ query_req_cb(
        }\r
        else\r
        {\r
-               CL_TRACE( AL_DBG_ERROR, g_al_dbg_lvl,\r
+               AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("query failed: %s\n", ib_get_err_str(query_rec.status) ) );\r
                if( p_mad_response )\r
                        query_rec.p_result_mad = p_mad_response;\r
@@ -367,5 +374,5 @@ query_req_cb(
        al_remove_query( p_query );\r
        cl_free( p_query );\r
 \r
-       CL_EXIT( AL_DBG_QUERY, g_al_dbg_lvl );\r
+       AL_EXIT( AL_DBG_QUERY );\r
 }\r
index 2dd0912..42911e3 100644 (file)
 \r
 #include "al.h"\r
 #include "al_debug.h"\r
+#if defined(EVENT_TRACING)\r
+#ifdef offsetof\r
+#undef offsetof\r
+#endif\r
+#include "al_reg_svc.tmh"\r
+#endif\r
 #include "al_reg_svc.h"\r
 #include "ib_common.h"\r
 #include "al_mgr.h"\r
@@ -262,12 +268,12 @@ ib_reg_svc(
 \r
        if( AL_OBJ_INVALID_HANDLE( h_al, AL_OBJ_TYPE_H_AL ) )\r
        {\r
-               AL_TRACE_EXIT( AL_DBG_ERROR, ("IB_INVALID_AL_HANDLE\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_AL_HANDLE\n") );\r
                return IB_INVALID_AL_HANDLE;\r
        }\r
        if( !p_reg_svc_req )\r
        {\r
-               AL_TRACE_EXIT( AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
 \r
@@ -285,7 +291,7 @@ ib_reg_svc(
                __destroying_sa_reg, NULL, __free_sa_reg );\r
        if( status != IB_SUCCESS )\r
        {\r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("init_al_obj returned %s.\n", ib_get_err_str( status )) );\r
                __free_sa_reg( &h_sa_reg->obj );\r
                return status;\r
@@ -296,7 +302,7 @@ ib_reg_svc(
        if( status != IB_SUCCESS )\r
        {\r
                h_sa_reg->obj.pfn_destroy( &h_sa_reg->obj, NULL );\r
-               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+               AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
                        ("attach_al_obj returned %s.\n", ib_get_err_str( status&nb