summaryrefslogtreecommitdiffstats
path: root/sys/net/vnet.h
diff options
context:
space:
mode:
authorzec <zec@FreeBSD.org>2010-02-04 07:55:42 +0000
committerzec <zec@FreeBSD.org>2010-02-04 07:55:42 +0000
commit393450ca7b6226ab2ec1b9837777e0651d534a4e (patch)
tree7764b989a82fe6fe95e035ec04067054114e99ad /sys/net/vnet.h
parent6db2453429c4a733846d86797a80dc47edc2aba9 (diff)
downloadFreeBSD-src-393450ca7b6226ab2ec1b9837777e0651d534a4e.zip
FreeBSD-src-393450ca7b6226ab2ec1b9837777e0651d534a4e.tar.gz
Instead of spamming the console on each curvnet recursion event, print
out each such call graph only once, along with a stack backtrace. This should make kernels built with VNET_DEBUG reasonably usable again in busy / production environments. Introduce a new DDB command "show vnetrcrs" which dumps the whole log of distinctive curvnet recursion events. This might be useful when recursion reports get burried / lost too deep in the message buffer. In the later case stack backtraces are not available. Reviewed by: bz MFC after: 3 days
Diffstat (limited to 'sys/net/vnet.h')
-rw-r--r--sys/net/vnet.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/net/vnet.h b/sys/net/vnet.h
index 116d7af..d9a1ee0 100644
--- a/sys/net/vnet.h
+++ b/sys/net/vnet.h
@@ -108,6 +108,8 @@ void vnet_destroy(struct vnet *vnet);
* assertions.
*/
#ifdef VNET_DEBUG
+void vnet_log_recursion(struct vnet *, const char *, int);
+
#define VNET_ASSERT(condition) \
if (!(condition)) { \
printf("VNET_ASSERT @ %s:%d %s():\n", \
@@ -125,9 +127,7 @@ void vnet_destroy(struct vnet *vnet);
#define CURVNET_SET_VERBOSE(arg) \
CURVNET_SET_QUIET(arg) \
if (saved_vnet) \
- printf("CURVNET_SET(%p) in %s() on cpu %d, prev %p in %s()\n", \
- curvnet, curthread->td_vnet_lpush, curcpu, \
- saved_vnet, saved_vnet_lpush);
+ vnet_log_recursion(saved_vnet, saved_vnet_lpush, __LINE__);
#define CURVNET_SET(arg) CURVNET_SET_VERBOSE(arg)
OpenPOWER on IntegriCloud