public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Zhaolei <zhaolei@cn.fujitsu.com>
To: Ingo Molnar <mingo@elte.hu>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 2/3] tracing/workqueue: cleanup for trace_workqueue.c
Date: Tue, 26 May 2009 16:21:03 +0800	[thread overview]
Message-ID: <4A1BA66F.6060503@cn.fujitsu.com> (raw)
In-Reply-To: <4A1BA322.9060505@cn.fujitsu.com>

1: Make function's order in source same with definition in struct tracer_stat
2: Remove ";" after workqueue_stat_file_release()
3: Remove redundant blank in struct tracer_stat workqueue_stats
4: add "static" prefix for some function and struct

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
---
 kernel/trace/trace_workqueue.c |   65 +++++++++++++++++++--------------------
 1 files changed, 32 insertions(+), 33 deletions(-)

diff --git a/kernel/trace/trace_workqueue.c b/kernel/trace/trace_workqueue.c
index 6cee4a8..53fe43e 100644
--- a/kernel/trace/trace_workqueue.c
+++ b/kernel/trace/trace_workqueue.c
@@ -81,7 +81,7 @@ static int wq_file_ref;
  * Update record when insert a work into workqueue
  * Caller need to hold cpu_workqueue_stats spin_lock
  */
-int do_worklet_enqueue(struct cpu_workqueue_stats *cws,
+static int do_worklet_enqueue(struct cpu_workqueue_stats *cws,
 			 struct work_struct *work)
 {
 	struct workfunc_stats *wfstat;
@@ -422,6 +422,27 @@ static int workqueue_stat_show(struct seq_file *s, void *p)
 	return 0;
 }
 
+static int workqueue_stat_headers(struct seq_file *s)
+{
+	seq_printf(s,
+		"# CPU INSERTED EXECUTED   MAX us   AVG us   TASKNAME:PID\n");
+	seq_printf(s,
+		"#  |     |        |         |        |      `-WORKFUNC\n");
+	seq_printf(s,
+		"#  |     |        |         |        |           |\n");
+
+	return 0;
+}
+
+static void workqueue_stat_file_open(void)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&free_wq_lock, flags);
+	wq_file_ref++;
+	spin_unlock_irqrestore(&free_wq_lock, flags);
+}
+
 /*
  * Here we are sure that we have no more readers on our stat file
  * and that further readers will block until we return from this function.
@@ -443,42 +464,20 @@ static void workqueue_stat_file_release(void)
 	}
 
 	spin_unlock_irqrestore(&free_wq_lock, flags);
-};
-
-static void workqueue_stat_file_open(void)
-{
-	unsigned long flags;
-
-	spin_lock_irqsave(&free_wq_lock, flags);
-	wq_file_ref++;
-	spin_unlock_irqrestore(&free_wq_lock, flags);
-}
-
-		/**/
-static int workqueue_stat_headers(struct seq_file *s)
-{
-	seq_printf(s,
-		"# CPU INSERTED EXECUTED   MAX us   AVG us   TASKNAME:PID\n");
-	seq_printf(s,
-		"#  |     |        |         |        |      `-WORKFUNC\n");
-	seq_printf(s,
-		"#  |     |        |         |        |           |\n");
-
-	return 0;
 }
 
-struct tracer_stat workqueue_stats __read_mostly = {
-	.name		 = "workqueues",
-	.stat_start	 = workqueue_stat_start,
-	.stat_next	 = workqueue_stat_next,
-	.stat_show	 = workqueue_stat_show,
-	.stat_headers	 = workqueue_stat_headers,
-	.file_open	 = workqueue_stat_file_open,
-	.file_open	 = workqueue_stat_file_release,
+static struct tracer_stat workqueue_stats __read_mostly = {
+	.name		= "workqueues",
+	.stat_start	= workqueue_stat_start,
+	.stat_next	= workqueue_stat_next,
+	.stat_show	= workqueue_stat_show,
+	.stat_headers	= workqueue_stat_headers,
+	.file_open	= workqueue_stat_file_open,
+	.file_open	= workqueue_stat_file_release,
 };
 
 
-int __init stat_workqueue_init(void)
+static int __init stat_workqueue_init(void)
 {
 	if (register_stat_tracer(&workqueue_stats)) {
 		pr_warning("Unable to register workqueue stat tracer\n");
@@ -493,7 +492,7 @@ fs_initcall(stat_workqueue_init);
  * Workqueues are created very early, just after pre-smp initcalls.
  * So we must register our tracepoints at this stage.
  */
-int __init trace_workqueue_early_init(void)
+static int __init trace_workqueue_early_init(void)
 {
 	int ret, cpu;
 
-- 
1.5.5.3


  reply	other threads:[~2009-05-26  8:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-26  8:06 [PATCH 1/3] tracing/workqueue: fix list header and function name format Zhaolei
2009-05-26  8:21 ` Zhaolei [this message]
2009-05-26  8:21 ` [PATCH 3/3] tracing/workqueue: make events sort in ascending order Zhaolei
2009-05-26 21:01   ` Frederic Weisbecker

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=4A1BA66F.6060503@cn.fujitsu.com \
    --to=zhaolei@cn.fujitsu.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox