All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Yang Shi <yang.shi@linaro.org>
Cc: linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org
Subject: Re: [PATCH] locktorture: make verbose writable and control stats print
Date: Fri, 15 Apr 2016 16:26:13 -0700	[thread overview]
Message-ID: <20160415232613.GC3687@linux.vnet.ibm.com> (raw)
In-Reply-To: <1460752091-28023-1-git-send-email-yang.shi@linaro.org>

On Fri, Apr 15, 2016 at 01:28:11PM -0700, Yang Shi wrote:
> When building locktorture test into kernel image, it keeps printing out
> stats information even though there is no lock type specified.
> 
> There is already verbose parameter to control print, but it is read-only,
> so it can't be changed at runtime. Make verbose read-write and control
> stats print.
> 
> Signed-off-by: Yang Shi <yang.shi@linaro.org>

Interesting change!

But just out of curiosity, when you boot with locktorture built in,
do you specify the shutdown_secs boot parameter?  If so, another
approach would be to shutdown immediately upon detecting an error
during initialization.

If not, I would like to know more about your use case.

							Thanx, Paul

> ---
>  include/linux/torture.h      |  2 ++
>  kernel/locking/locktorture.c | 11 +++++++----
>  2 files changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/include/linux/torture.h b/include/linux/torture.h
> index 7759fc3..86d6e54 100644
> --- a/include/linux/torture.h
> +++ b/include/linux/torture.h
> @@ -48,6 +48,8 @@
>  	do { if (verbose) pr_alert("%s" TORTURE_FLAG " %s\n", torture_type, s); } while (0)
>  #define VERBOSE_TOROUT_ERRSTRING(s) \
>  	do { if (verbose) pr_alert("%s" TORTURE_FLAG "!!! %s\n", torture_type, s); } while (0)
> +#define VERBOSE_STRING(s) \
> +	do { if (verbose) pr_alert("%s", s); } while (0)
> 
>  /* Definitions for online/offline exerciser. */
>  int torture_onoff_init(long ooholdoff, long oointerval);
> diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c
> index 8ef1919..d9838a3 100644
> --- a/kernel/locking/locktorture.c
> +++ b/kernel/locking/locktorture.c
> @@ -55,8 +55,11 @@ torture_param(int, shutdown_secs, 0, "Shutdown time (j), <= zero to disable.");
>  torture_param(int, stat_interval, 60,
>  	     "Number of seconds between stats printk()s");
>  torture_param(int, stutter, 5, "Number of jiffies to run/halt test, 0=disable");
> -torture_param(bool, verbose, true,
> -	     "Enable verbose debugging printk()s");
> +
> +static bool verbose = true;
> +module_param(verbose, bool, 0644);
> +MODULE_PARM_DESC(verbose,
> +		 "Enable verbose debugging printk()s");
> 
>  static char *torture_type = "spin_lock";
>  module_param(torture_type, charp, 0444);
> @@ -693,7 +696,7 @@ static void lock_torture_stats_print(void)
>  	}
> 
>  	__torture_print_stats(buf, cxt.lwsa, true);
> -	pr_alert("%s", buf);
> +	VERBOSE_STRING(buf);
>  	kfree(buf);
> 
>  	if (cxt.cur_ops->readlock) {
> @@ -705,7 +708,7 @@ static void lock_torture_stats_print(void)
>  		}
> 
>  		__torture_print_stats(buf, cxt.lrsa, false);
> -		pr_alert("%s", buf);
> +		VERBOSE_STRING(buf);
>  		kfree(buf);
>  	}
>  }
> -- 
> 2.0.2
> 

  reply	other threads:[~2016-04-15 23:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-15 20:28 [PATCH] locktorture: make verbose writable and control stats print Yang Shi
2016-04-15 23:26 ` Paul E. McKenney [this message]
2016-04-15 23:45   ` Shi, Yang
2016-04-16  0:09     ` Paul E. McKenney
2016-04-16  0:19       ` Shi, Yang
2016-04-16  0:31         ` Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160415232613.GC3687@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yang.shi@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.