From 3a2a9c5fe935c1676d169590c001e90a3d47d19f Mon Sep 17 00:00:00 2001 From: isaac Date: Thu, 15 Oct 2009 04:14:37 +0000 Subject: [PATCH] b=20818,i=rread,i=liang: - user options libcfs_console_(max|min)_delay ignored by libcfs. --- libcfs/libcfs/debug.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libcfs/libcfs/debug.c b/libcfs/libcfs/debug.c index 035b619..5813e68 100644 --- a/libcfs/libcfs/debug.c +++ b/libcfs/libcfs/debug.c @@ -386,8 +386,14 @@ int libcfs_debug_init(unsigned long bufsize) int max = libcfs_debug_mb; cfs_waitq_init(&debug_ctlwq); - libcfs_console_max_delay = CDEBUG_DEFAULT_MAX_DELAY; - libcfs_console_min_delay = CDEBUG_DEFAULT_MIN_DELAY; + + if (libcfs_console_max_delay <= 0 || /* not set by user or */ + libcfs_console_min_delay <= 0 || /* set to invalid values */ + libcfs_console_min_delay >= libcfs_console_max_delay) { + libcfs_console_max_delay = CDEBUG_DEFAULT_MAX_DELAY; + libcfs_console_min_delay = CDEBUG_DEFAULT_MIN_DELAY; + } + /* If libcfs_debug_mb is set to an invalid value or uninitialized * then just make the total buffers smp_num_cpus * TCD_MAX_PAGES */ if (max > trace_max_debug_mb() || max < num_possible_cpus()) { -- 1.8.3.1