[openib-general] [PATCH] remove ts_kernel_trace from client_query*

Tom Duffy tduffy at sun.com
Mon Aug 16 10:52:09 PDT 2004


On Mon, 2004-08-16 at 09:29 -0700, Roland Dreier wrote:
>     Tom> How about I put all VERBOSE and above in a dbg() function
>     Tom> only defined when DEBUG is set?  This is how USB does it.
> 
> Actually <linux/kernel.h> defines pr_debug() now, so we could use
> that.  Somewhere down the road I'd like to get settable print levels,
> though (it's been pretty useful in the past to be able to turn on
> debug prints on the fly when a system gets in a bad state).

OK, here is a patch against client_query to get an idea of how this
conversion will look.  Let me know if this is a good thing and I will go
through the rest.

Signed-by: Tom Duffy <tduffy at sun.com> with permission from Sun legal.

Index: client_query.c
===================================================================
--- client_query.c	(revision 654)
+++ client_query.c	(working copy)
@@ -28,7 +28,6 @@
 #include "ts_ib_client_query.h"
 #include "ts_ib_rmpp_mad_types.h"
 
-#include "ts_kernel_trace.h"
 #include "ts_kernel_hash.h"
 #include "ts_kernel_timer.h"
 
@@ -212,8 +211,8 @@
 	if (query) {
 		if (!query->rmpp_rcv) {
 			/* ERROR */
-			TS_REPORT_WARN(MOD_KERNEL_IB,
-				       "RMPP timeout for non-RMPP query");
+			printk(KERN_WARNING "RMPP timeout for non-RMPP"
+			       " query\n");
 			ib_client_query_put(query);
 		} else {
 			/*
@@ -274,8 +273,7 @@
 		goto mem_err_query;
 	
 
-	TS_TRACE(MOD_KERNEL_IB, T_VERBOSE, TRACE_KERNEL_IB_GEN,
-		 "ib_client_rmpp_query_new()\n");
+	pr_debug("ib_client_rmpp_query_new()\n");
 
 	query->callback_running = 0;
 	query->transaction_id = packet->transaction_id;
@@ -329,8 +327,7 @@
 	kfree(query);
 
 mem_err_query:
-	TS_TRACE(MOD_KERNEL_IB, T_TERSE, TRACE_KERNEL_IB_GEN,
-		 "Error: Failed to allocate query structure\n");
+	printk(KERN_WARNING "Error: Failed to allocate query structure\n");
 	return NULL;
 }
 
@@ -351,8 +348,7 @@
 	attribute_modifier = be32_to_cpu(mad->attribute_modifier);
 	flag = rmpp_mad->resp_time__flags & 0x0F;
 
-	TS_TRACE(MOD_KERNEL_IB, T_VERBOSE, TRACE_KERNEL_IB_GEN,
-		 "ib_client_query_rmpp_rcv_mad(flag= 0x%x)\n", flag);
+	pr_debug("ib_client_query_rmpp_rcv_mad(flag= 0x%x)\n", flag);
 
 	/* Basic checking */
 	if ((flag & TS_IB_CLIENT_RMPP_FLAG_ACTIVE) == 0)
@@ -366,18 +362,15 @@
 		u32 payload_length =
 			be32_to_cpu(rmpp_mad->specific.data.payload_length);
 
-		TS_TRACE(MOD_KERNEL_IB, T_VERBOSE, TRACE_KERNEL_IB_GEN,
-			 "Data - segment_number= %d, payload_length= %d\n",
-			 segment_number, payload_length);
+		pr_debug("Data - segment_number= %d, payload_length= %d\n",
+		    segment_number, payload_length);
 
 		/* if first - allocate data */
 		if (flag & TS_IB_CLIENT_RMPP_FLAG_DATA_FIRST) {
 			if (query->rmpp_rcv->data) {
 				/* WARNING */
 			} else {
-				TS_TRACE(MOD_KERNEL_IB, T_VERBOSE,
-					 TRACE_KERNEL_IB_GEN,
-					 "Allocate data on first segment\n");
+				pr_debug("Allocate data on first segment\n");
 				query->rmpp_rcv->data_length = payload_length;
 				query->rmpp_rcv->data =
 					kmalloc(payload_length, GFP_ATOMIC);
@@ -434,8 +427,7 @@
 		}
 
 		/* send back ack with sliding window of 1 */
-		TS_TRACE(MOD_KERNEL_IB, T_VERBOSE, TRACE_KERNEL_IB_GEN,
-			 "Send back ack, dlid= %d\n", mad->slid);
+		pr_debug("Send back ack, dlid= %d\n", mad->slid);
 		mad->dlid = mad->slid;
 		mad->completion_func = NULL;
 		mad->has_grh = 0;
@@ -448,9 +440,7 @@
 
 		/* if last - call user supplied completion */
 		if (flag & TS_IB_CLIENT_RMPP_FLAG_DATA_LAST) {
-			TS_TRACE(MOD_KERNEL_IB, T_VERBOSE,
-				 TRACE_KERNEL_IB_GEN,
-				 "get last segment of transaction\n");
+			pr_debug("get last segment of transaction\n");
 
 			ib_client_query_rmpp_callback(query,
 						     TS_IB_CLIENT_RESPONSE_OK,
@@ -492,9 +482,8 @@
 	tTS_IB_CLIENT_RESPONSE_STATUS resp_status;
 
 	if (!query) {
-		TS_TRACE(MOD_KERNEL_IB, T_VERBOSE, TRACE_KERNEL_IB_GEN,
-			 "packet received for unknown TID 0x%016" TS_U64_FMT
-			 "x", mad->transaction_id);
+		pr_debug("packet received for unknown TID 0x%016" TS_U64_FMT
+			 "x\n", mad->transaction_id);
 		return;
 	}
 
@@ -534,8 +523,7 @@
 	if (0) {
 		int i;
 
-		TS_TRACE(MOD_KERNEL_IB, T_VERY_VERBOSE, TRACE_KERNEL_IB_GEN,
-			 "Sending query packet:");
+		pr_debug("Sending query packet:\n");
 
 		for (i = 0; i < 256; ++i) {
 			if (i % 8 == 0) {
@@ -584,8 +572,7 @@
 
 void ib_client_mad_handler(struct ib_mad *mad, void *arg)
 {
-	TS_TRACE(MOD_KERNEL_IB, T_VERY_VERBOSE, TRACE_KERNEL_IB_GEN,
-		 "query packet received, TID 0x%016" TS_U64_FMT "x",
+	pr_debug("query packet received, TID 0x%016" TS_U64_FMT "x\n",
 		 mad->transaction_id);
 	if (0) {
 		int i;
@@ -689,8 +676,7 @@
 {
 	struct ib_client_query *query;
 
-	TS_TRACE(MOD_KERNEL_IB, T_VERBOSE, TRACE_KERNEL_IB_GEN,
-		 "tsIbRmppClientQuery()\n");
+	pr_debug("tsIbRmppClientQuery()\n");
 
 	query = ib_client_rmpp_query_new(packet, timeout_jiffies,
 					header_length, function, arg);
Index: client_query_main.c
===================================================================
--- client_query_main.c	(revision 654)
+++ client_query_main.c	(working copy)
@@ -23,7 +23,6 @@
 
 #include "client_query.h"
 #include "ts_ib_mad.h"
-#include "ts_kernel_trace.h"
 
 #include <linux/version.h>
 #include <linux/module.h>
@@ -71,8 +70,7 @@
 					     &async_mad_table[mgmt_class].
 					     filter);
 		if (ret) {
-			TS_REPORT_WARN(MOD_KERNEL_IB,
-				       "Failed to register MAD filter");
+			printk(KERN_WARNING "Failed to register MAD filter\n");
 			return ret;
 		}
 	} else {

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20040816/263fa909/attachment.sig>


More information about the general mailing list