<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3243" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=239213413-27112008><FONT face=Arial color=#0000ff
size=2>Applied in 1773</FONT></SPAN></DIV><BR>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> ofw-bounces@lists.openfabrics.org
[mailto:ofw-bounces@lists.openfabrics.org] <B>On Behalf Of </B>Leonid
Keller<BR><B>Sent:</B> Sunday, November 23, 2008 8:38 PM<BR><B>To:</B>
ofw@lists.openfabrics.org<BR><B>Subject:</B> [ofw][patch] a fix to support
debug print in Windows 2008<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV>
<P><FONT face=Arial><FONT size=2>[ALL] a fix to support debug print in Windows
2008<SPAN class=495412418-23112008>. [mlnx:
3510]</SPAN></FONT></FONT></P><FONT face=Arial><FONT size=2><SPAN
class=495412418-23112008>
<DIV><FONT face=Arial size=2><SPAN class=186452213-16112008>Replace the use of
DbgPrint with DbgPrintEx that is displayed on windows 2008 by
default.</SPAN></FONT></DIV></SPAN></FONT></FONT>
<P><FONT face=Arial size=2>Index:
core/complib/kernel/cl_driver.c<BR>===================================================================<BR>---
core/complib/kernel/cl_driver.c (revision 1765)<BR>+++
core/complib/kernel/cl_driver.c (working copy)<BR>@@ -31,6 +31,7
@@<BR> <BR> <BR> #include "complib/comp_lib.h"<BR>+#include
<stdarg.h><BR> <BR> <BR> CL_EXPORT NTSTATUS<BR>@@ -64,3
+65,16 @@<BR> return
CL_ERROR;<BR> }<BR> }<BR>+<BR>+<BR>+#if defined( _DEBUG_
)<BR>+<BR>+VOID cl_dbg_out( IN PCCH format,
...)<BR>+{<BR>+ va_list list;<BR>+ va_start(list,
format);<BR>+ vDbgPrintEx(DPFLTR_IHVNETWORK_ID, DPFLTR_ERROR_LEVEL,
format, list);<BR>+ va_end(list);<BR>+}<BR>+#endif<BR>+<BR>Index:
hw/mlx4/kernel/bus/core/l2w_debug.c<BR>===================================================================<BR>---
hw/mlx4/kernel/bus/core/l2w_debug.c (revision 1765)<BR>+++
hw/mlx4/kernel/bus/core/l2w_debug.c (working copy)<BR>@@ -134,7 +134,7
@@<BR> buf[MAX_BUFFER_SIZE - 1] = '\0';<BR> if
(RtlStringCbVPrintfA( (char*)buf, sizeof(buf), format,
list))<BR> return;<BR>- DbgPrint( "%s\n", (char*)buf
);<BR>+ cl_dbg_out( "%s\n", (char*)buf
);<BR> va_end(list);<BR> <BR> // print to Event
Log<BR>@@ -158,7 +158,7 @@<BR> va_start(list,
format);<BR> buf[MAX_BUFFER_SIZE - 1] =
'\0';<BR> RtlStringCbVPrintfA( (char*)buf, sizeof(buf), format,
list);<BR>- DbgPrint( "%s\n", (char*)buf );<BR>+ cl_dbg_out( "%s\n",
(char*)buf
);<BR> va_end(list);<BR> #else <BR> UNUSED_PARAM(mdev);<BR>@@
-181,7 +181,7 @@<BR> va_start(list,
format);<BR> buf[MAX_BUFFER_SIZE - 1] =
'\0';<BR> RtlStringCbVPrintfA( (char*)buf, sizeof(buf), format,
list);<BR>- DbgPrint( "%s\n", (char*)buf );<BR>+ cl_dbg_out( "%s\n",
(char*)buf );<BR> va_end(list);<BR> <BR> // print
to Event Log<BR>@@ -205,7 +205,7 @@<BR> va_start(list,
format);<BR> buf[MAX_BUFFER_SIZE - 1] =
'\0';<BR> RtlStringCbVPrintfA( (char*)buf, sizeof(buf), format,
list);<BR>- DbgPrint( "%s\n", (char*)buf );<BR>+ cl_dbg_out( "%s\n",
(char*)buf
);<BR> va_end(list);<BR> #else <BR> UNUSED_PARAM(p_mdev);<BR>Index:
hw/mlx4/kernel/bus/drv/wpptrace.h<BR>===================================================================<BR>---
hw/mlx4/kernel/bus/drv/wpptrace.h (revision 1765)<BR>+++
hw/mlx4/kernel/bus/drv/wpptrace.h (working copy)<BR>@@ -91,9 +91,9
@@<BR> if (g_SdpDbgLevel >= (_level_) &&
(g_SdpDbgFlags &
(_flag_)))
\<BR>
{
\<BR> if(_level_ ==
TRACE_LEVEL_ERROR)
\<BR>-
DbgPrint ("***ERROR***
");
\<BR>- DbgPrint ("%s():
",__FUNCTION__);
\<BR>- DbgPrint
_msg_;
\<BR>+
cl_dbg_out ("***ERROR***
");
\<BR>+ cl_dbg_out ("%s():
",__FUNCTION__);
\<BR>+ cl_dbg_out
_msg_;
\<BR> }<BR> <BR> #else<BR>Index:
hw/mlx4/kernel/hca/debug.h<BR>===================================================================<BR>---
hw/mlx4/kernel/hca/debug.h (revision 1765)<BR>+++
hw/mlx4/kernel/hca/debug.h (working copy)<BR>@@ -108,9 +108,9
@@<BR> int __lvl = _level_; \<BR> if
(g.DebugPrintLevel >= (_level_) &&
\<BR> (g.DebugPrintFlags & (_flag_))) {
\<BR>- DbgPrint ("~%d:[MLX4_HCA] %s() :",
KeGetCurrentProcessorNumber(), __FUNCTION__);
\<BR>- if(__lvl == TRACE_LEVEL_ERROR) DbgPrint
("***ERROR*** "); \<BR>- DbgPrint _msg_;
\<BR>+ cl_dbg_out ("~%d:[MLX4_HCA] %s() :",
KeGetCurrentProcessorNumber(), __FUNCTION__);
\<BR>+ if(__lvl == TRACE_LEVEL_ERROR) cl_dbg_out
("***ERROR*** "); \<BR>+ cl_dbg_out _msg_;
\<BR> } \<BR> }<BR> <BR>Index:
hw/mlx4/kernel/hca/drv.c<BR>===================================================================<BR>---
hw/mlx4/kernel/hca/drv.c (revision 1765)<BR>+++
hw/mlx4/kernel/hca/drv.c (working copy)<BR>@@ -742,7 +742,7
@@<BR> PFDO_DEVICE_DATA p_fdo =
FdoGetData(Device);<BR> HCA_ENTER( HCA_DBG_PNP );<BR> if
(atomic_read(&p_fdo->usecnt)) {<BR>- DbgPrint( "MLX4: Can't
get unloaded. %d applications are still in work\n",
p_fdo->usecnt);<BR>+ cl_dbg_out( "MLX4: Can't get unloaded. %d
applications are still in work\n",
p_fdo->usecnt);<BR> return
STATUS_UNSUCCESSFUL;<BR> }<BR> HCA_EXIT( HCA_DBG_PNP
);<BR>@@ -1961,7 +1961,7 @@<BR> {<BR> PFDO_DEVICE_DATA p_fdo =
(PFDO_DEVICE_DATA)p_dev_obj->DeviceExtension;<BR> if
(atomic_read(&p_fdo->usecnt)) {<BR>- DbgPrint( "MTHCA: Can't
get unloaded. %d applications are still in work\n",
p_fdo->usecnt);<BR>+ cl_dbg_out( "MTHCA: Can't get unloaded. %d
applications are still in work\n",
p_fdo->usecnt);<BR> p_irp->IoStatus.Status =
STATUS_UNSUCCESSFUL;<BR> return cl_irp_complete( p_dev_obj,
p_irp, p_action );<BR> }<BR>Index:
hw/mlx4/kernel/inc/l2w.h<BR>===================================================================<BR>---
hw/mlx4/kernel/inc/l2w.h (revision 1765)<BR>+++
hw/mlx4/kernel/inc/l2w.h (working copy)<BR>@@ -47,7 +47,7
@@<BR> <BR> #define BUG_ON(exp) ASSERT(!(exp)) /* in
Linux follows here panic() !*/ <BR> #define
snprintf _snprintf<BR>-#define
printk DbgPrint<BR>+#define
printk cl_dbg_out<BR> #define
KERN_ERR "err:"<BR> #define
KERN_WARNING "warn:"<BR> #define
KERN_DEBUG "dbg:"<BR>Index:
hw/mlx4/kernel/inc/l2w_memory.h<BR>===================================================================<BR>---
hw/mlx4/kernel/inc/l2w_memory.h (revision 1765)<BR>+++
hw/mlx4/kernel/inc/l2w_memory.h (working copy)<BR>@@ -1,6 +1,7
@@<BR> #pragma once<BR> <BR> #include "iobuf.h"<BR>+#include
"complib\cl_debug.h"<BR> <BR> ////////////////////////////////////////////////////////<BR> //<BR>@@
-94,7 +95,7 @@<BR> ptr = ExAllocatePoolWithTag(
NonPagedPool, bsize, MT_TAG_HIGH
);<BR> break;<BR> default:<BR>- DbgPrint("kmalloc:
unsupported flag %d\n", gfp_mask);<BR>+ cl_dbg_out("kmalloc:
unsupported flag %d\n", gfp_mask);<BR> ptr =
NULL;<BR> break;<BR> }<BR>Index:
hw/mlx4/kernel/inc/mlx4_debug.h<BR>===================================================================<BR>---
hw/mlx4/kernel/inc/mlx4_debug.h (revision 1765)<BR>+++
hw/mlx4/kernel/inc/mlx4_debug.h (working copy)<BR>@@ -165,9 +165,9
@@<BR> uint32_t __lvl = _level_; \<BR> if
(g_mlx4_dbg_level >= (uint32_t)(__lvl) &&
\<BR> (g_mlx4_dbg_flags & (_flag_))) {
\<BR>- DbgPrint ("~%d:[MLX4_BUS] %s() :",
KeGetCurrentProcessorNumber(), __FUNCTION__);
\<BR>- if(__lvl == TRACE_LEVEL_ERROR) DbgPrint
("***ERROR*** "); \<BR>- DbgPrint _msg_;
\<BR>+ cl_dbg_out ("~%d:[MLX4_BUS] %s() :",
KeGetCurrentProcessorNumber(), __FUNCTION__);
\<BR>+ if(__lvl == TRACE_LEVEL_ERROR) cl_dbg_out
("***ERROR*** "); \<BR>+ cl_dbg_out _msg_;
\<BR> } \<BR> }<BR> <BR>Index:
hw/mthca/kernel/hca_debug.h<BR>===================================================================<BR>---
hw/mthca/kernel/hca_debug.h (revision 1765)<BR>+++
hw/mthca/kernel/hca_debug.h (working copy)<BR>@@ -148,9 +148,9
@@<BR> int __lvl = _level_; \<BR> if
(g_mthca_dbg_level >= (_level_) &&
\<BR> (g_mthca_dbg_flags & (_flag_))) {
\<BR>- DbgPrint ("~%d:[MTHCA] %s() :",
KeGetCurrentProcessorNumber(), __FUNCTION__);
\<BR>- if(__lvl == TRACE_LEVEL_ERROR) DbgPrint
("***ERROR*** "); \<BR>- DbgPrint _msg_;
\<BR>+ cl_dbg_out ("~%d:[MTHCA] %s() :",
KeGetCurrentProcessorNumber(), __FUNCTION__);
\<BR>+ if(__lvl == TRACE_LEVEL_ERROR) cl_dbg_out
("***ERROR*** "); \<BR>+ cl_dbg_out _msg_;
\<BR> } \<BR> }<BR> <BR>Index:
hw/mthca/kernel/hca_pnp.c<BR>===================================================================<BR>---
hw/mthca/kernel/hca_pnp.c (revision 1765)<BR>+++
hw/mthca/kernel/hca_pnp.c (working copy)<BR>@@ -1181,7 +1181,7
@@<BR> {<BR> hca_dev_ext_t*p_ext =
(hca_dev_ext_t*)p_dev_obj->DeviceExtension;<BR> if
(atomic_read(&p_ext->usecnt)) {<BR>- DbgPrint( "MTHCA: Can't
get unloaded. %d applications are still in work\n",
p_ext->usecnt);<BR>+ cl_dbg_out( "MTHCA: Can't get unloaded. %d
applications are still in work\n",
p_ext->usecnt);<BR> p_irp->IoStatus.Status =
STATUS_UNSUCCESSFUL;<BR> return cl_irp_complete( p_dev_obj,
p_irp, p_action );<BR> }<BR>Index:
hw/mthca/kernel/mt_memory.h<BR>===================================================================<BR>---
hw/mthca/kernel/mt_memory.h (revision 1765)<BR>+++
hw/mthca/kernel/mt_memory.h (working copy)<BR>@@ -2,6 +2,7
@@<BR> #define MT_MEMORY_H<BR> <BR> #include
"iba/ib_types.h"<BR>+#include "complib\cl_debug.h"<BR> <BR> //
===========================================<BR> // CONSTANTS<BR>@@ -60,7
+61,7 @@<BR> ptr = ExAllocatePoolWithTag( NonPagedPool,
bsize, MT_TAG_HIGH
);<BR> break;<BR> default:<BR>- DbgPrint("kmalloc:
unsupported flag %d\n", gfp_mask);<BR>+ cl_dbg_out("kmalloc:
unsupported flag %d\n", gfp_mask);<BR> ptr =
NULL;<BR> break;<BR> }<BR>Index:
hw/mthca/kernel/mt_types.h<BR>===================================================================<BR>---
hw/mthca/kernel/mt_types.h (revision 1765)<BR>+++
hw/mthca/kernel/mt_types.h (working copy)<BR>@@ -52,7 +52,7
@@<BR> <BR> // assert<BR> #ifdef _DEBUG_<BR>-#define MT_ASSERT(
exp ) (void)(!(exp)?DbgPrint("Assertion Failed:" #exp
"\n"),DbgBreakPoint(),FALSE:TRUE)<BR>+#define MT_ASSERT( exp
) (void)(!(exp)?cl_dbg_out("Assertion Failed:" #exp
"\n"),DbgBreakPoint(),FALSE:TRUE)<BR> #else<BR> #define MT_ASSERT(
exp )<BR> #endif /* _DEBUG_ */<BR>Index:
inc/kernel/complib/cl_debug_osd.h<BR>===================================================================<BR>---
inc/kernel/complib/cl_debug_osd.h (revision 1765)<BR>+++
inc/kernel/complib/cl_debug_osd.h (working copy)<BR>@@ -59,7 +59,8
@@<BR> <BR> <BR> #if defined( _DEBUG_ )<BR>-#define
cl_dbg_out DbgPrint<BR>+//#define cl_dbg_out DbgPrintHelper<BR>+VOID
cl_dbg_out( IN PCCH Format, ...);<BR> #else<BR> #define
cl_dbg_out __noop<BR> #endif /* defined( _DEBUG_ ) */<BR>Index:
ulp/ipoib/kernel/ipoib_debug.h<BR>===================================================================<BR>---
ulp/ipoib/kernel/ipoib_debug.h (revision 1765)<BR>+++
ulp/ipoib/kernel/ipoib_debug.h (working copy)<BR>@@ -160,13 +160,13
@@<BR> size_t
_loop_; \<BR> for(
_loop_ = 0; _loop_ < (len); ++_loop_
) \<BR> { \<BR>- DbgPrint(
"0x%.2X ", ((uint8_t*)(ptr))[_loop_]
); \<BR>+ cl_dbg_out( "0x%.2X ",
((uint8_t*)(ptr))[_loop_]
); \<BR> if( (_loop_ + 1)% 16 ==
0
) \<BR>- DbgPrint("\n"); \<BR>+ cl_dbg_out("\n"); \<BR> else
if( (_loop_ % 4 + 1) == 0
) \<BR>- DbgPrint("
"); \<BR>+ cl_dbg_out("
"); \<BR> } \<BR>- DbgPrint("\n"); \<BR>+ cl_dbg_out("\n"); \<BR> } \<BR> }<BR> <BR></FONT></P></DIV></BLOCKQUOTE></BODY></HTML>