All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tang Yizhou <tangyizhou@huawei.com>
To: <bristot@redhat.com>, <rostedt@goodmis.org>
Cc: <mingo@redhat.com>, <linux-kernel@vger.kernel.org>,
	<tangyizhou@huawei.com>
Subject: [PATCH] trace: Do some cleanups for osnoise tracer
Date: Mon, 13 Sep 2021 11:32:06 +0800	[thread overview]
Message-ID: <20210913033206.23682-1-tangyizhou@huawei.com> (raw)

1. Add 'static' and 'const' qualifier when necessary.
2. Use DEFINE_MUTEX() to define a mutex.

Signed-off-by: Tang Yizhou <tangyizhou@huawei.com>
---
 kernel/trace/trace_osnoise.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c
index ce053619f289..c1a8dc6a154e 100644
--- a/kernel/trace/trace_osnoise.c
+++ b/kernel/trace/trace_osnoise.c
@@ -105,7 +105,7 @@ struct osnoise_variables {
 /*
  * Per-cpu runtime information.
  */
-DEFINE_PER_CPU(struct osnoise_variables, per_cpu_osnoise_var);
+static DEFINE_PER_CPU(struct osnoise_variables, per_cpu_osnoise_var);
 
 /*
  * this_cpu_osn_var - Return the per-cpu osnoise_variables on its relative CPU
@@ -128,7 +128,7 @@ struct timerlat_variables {
 	u64			count;
 };
 
-DEFINE_PER_CPU(struct timerlat_variables, per_cpu_timerlat_var);
+static DEFINE_PER_CPU(struct timerlat_variables, per_cpu_timerlat_var);
 
 /*
  * this_cpu_tmr_var - Return the per-cpu timerlat_variables on its relative CPU
@@ -220,7 +220,7 @@ struct timerlat_sample {
 /*
  * Protect the interface.
  */
-struct mutex interface_lock;
+static DEFINE_MUTEX(interface_lock);
 
 /*
  * Tracer data.
@@ -1818,8 +1818,8 @@ static struct trace_min_max_param osnoise_print_stack = {
 /*
  * osnoise/timerlat_period: min 100 us, max 1 s
  */
-u64 timerlat_min_period = 100;
-u64 timerlat_max_period = 1000000;
+static const u64 timerlat_min_period = 100;
+static const u64 timerlat_max_period = 1000000;
 static struct trace_min_max_param timerlat_period = {
 	.lock	= &interface_lock,
 	.val	= &osnoise_data.timerlat_period,
@@ -2087,8 +2087,6 @@ __init static int init_osnoise_tracer(void)
 {
 	int ret;
 
-	mutex_init(&interface_lock);
-
 	cpumask_copy(&osnoise_cpumask, cpu_all_mask);
 
 	ret = register_tracer(&osnoise_tracer);
-- 
2.17.1


             reply	other threads:[~2021-09-13  3:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-13  3:32 Tang Yizhou [this message]
2021-09-13  7:59 ` [PATCH] trace: Do some cleanups for osnoise tracer kernel test robot
2021-09-13  7:59   ` kernel test robot
2021-09-13  8:53 ` kernel test robot
2021-09-13  8:53   ` kernel test robot
2021-09-13 10:05 ` kernel test robot
2021-09-13 10:05   ` kernel test robot
2021-09-13 14:58 ` Steven Rostedt

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=20210913033206.23682-1-tangyizhou@huawei.com \
    --to=tangyizhou@huawei.com \
    --cc=bristot@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.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.