lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon,  1 Jun 2009 19:17:17 +0200
From:	Frederic Weisbecker <fweisbec@...il.com>
To:	Ingo Molnar <mingo@...e.hu>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Zhaolei <zhaolei@...fujitsu.com>,
	Oleg Nesterov <oleg@...hat.com>,
	Anton Blanchard <anton@...ba.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Frederic Weisbecker <fweisbec@...il.com>
Subject: [PATCH 5/5] tracing/workqueue: cleanup for trace_workqueue.c

From: Zhaolei <zhaolei@...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

[ Impact: reorganize code, cleanup ]

Signed-off-by: Zhao Lei <zhaolei@...fujitsu.com>
Signed-off-by: Frederic Weisbecker <fweisbec@...il.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 cb6429e..ae98be4 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;
@@ -415,6 +415,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.
@@ -436,42 +457,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");
@@ -486,7 +485,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.6.2.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ