Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/iscsi avoid namespace pollution when debugging
details: https://anonhg.NetBSD.org/src/rev/15c4c1e5f0b4
branches: trunk
changeset: 779546:15c4c1e5f0b4
user: mlelstv <mlelstv%NetBSD.org@localhost>
date: Sat Jun 02 16:52:11 2012 +0000
description:
avoid namespace pollution when debugging
don't panic when printing data for a dead (NULL) connection
diffstat:
sys/dev/iscsi/iscsi_globals.h | 20 +++++++++++---------
sys/dev/iscsi/iscsi_main.c | 4 ++--
2 files changed, 13 insertions(+), 11 deletions(-)
diffs (62 lines):
diff -r 61ea570eda8d -r 15c4c1e5f0b4 sys/dev/iscsi/iscsi_globals.h
--- a/sys/dev/iscsi/iscsi_globals.h Sat Jun 02 16:48:13 2012 +0000
+++ b/sys/dev/iscsi/iscsi_globals.h Sat Jun 02 16:52:11 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: iscsi_globals.h,v 1.2 2011/11/29 03:50:31 tls Exp $ */
+/* $NetBSD: iscsi_globals.h,v 1.3 2012/06/02 16:52:11 mlelstv Exp $ */
/*-
* Copyright (c) 2004,2005,2006,2011 The NetBSD Foundation, Inc.
@@ -564,12 +564,13 @@
#if defined(ISCSI_PERFTEST)
-int perf_level; /* How much info to display */
+int iscsi_perf_level; /* How much info to display */
#define PDEBOUT(x) printf x
-#define PDEB(lev,x) { if (perf_level >= lev) printf x ;}
-#define PDEBC(conn,lev,x) { { if (perf_level >= lev) printf("S%dC%d: ", \
- conn->session->id, conn->id); printf x ;}}
+#define PDEB(lev,x) { if (iscsi_perf_level >= lev) printf x ;}
+#define PDEBC(conn,lev,x) { if (iscsi_perf_level >= lev) { printf("S%dC%d: ", \
+ conn ? conn->session->id : -1, \
+ conn ? conn->id : -1); printf x ;}}
#else
#define PDEBOUT(x)
#define PDEB(lev,x)
@@ -578,12 +579,13 @@
#ifdef ISCSI_DEBUG
-int debug_level; /* How much debug info to display */
+int iscsi_debug_level; /* How much debug info to display */
#define DEBOUT(x) printf x
-#define DEB(lev,x) { if (debug_level >= lev) printf x ;}
-#define DEBC(conn,lev,x) { if (debug_level >= lev) { printf("S%dC%d: ", \
- conn->session->id, conn->id); printf x ;}}
+#define DEB(lev,x) { if (iscsi_debug_level >= lev) printf x ;}
+#define DEBC(conn,lev,x) { if (iscsi_debug_level >= lev) { printf("S%dC%d: ", \
+ conn ? conn->session->id : -1, \
+ conn ? conn->id : -1); printf x ;}}
void dump(void *buf, int len);
#define STATIC static
diff -r 61ea570eda8d -r 15c4c1e5f0b4 sys/dev/iscsi/iscsi_main.c
--- a/sys/dev/iscsi/iscsi_main.c Sat Jun 02 16:48:13 2012 +0000
+++ b/sys/dev/iscsi/iscsi_main.c Sat Jun 02 16:52:11 2012 +0000
@@ -41,11 +41,11 @@
extern struct cfdriver iscsi_cd;
#if defined(ISCSI_DEBUG)
-int debug_level = ISCSI_DEBUG;
+int iscsi_debug_level = ISCSI_DEBUG;
#endif
#if defined(ISCSI_PERFTEST)
-int perf_level = 0;
+int iscsi_perf_level = 0;
#endif
/* Device Structure */
Home |
Main Index |
Thread Index |
Old Index