* [PATCH 2/2] trace_workqueues: fix empty line's output
@ 2009-03-25 8:59 Lai Jiangshan
2009-03-25 13:34 ` Frederic Weisbecker
2009-03-25 17:33 ` [tip:tracing/ftrace] " Lai Jiangshan
0 siblings, 2 replies; 3+ messages in thread
From: Lai Jiangshan @ 2009-03-25 8:59 UTC (permalink / raw)
To: Ingo Molnar; +Cc: Steven Rostedt, Frederic Weisbecker, LKML
Empty lines separate cpus stat. After previous
fix(trace_stat: keep original order) applied, the empty lines
are displayed at incorrect position.
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
diff --git a/kernel/trace/trace_workqueue.c b/kernel/trace/trace_workqueue.c
index 9ab035b..797201e 100644
--- a/kernel/trace/trace_workqueue.c
+++ b/kernel/trace/trace_workqueue.c
@@ -196,6 +196,11 @@ static int workqueue_stat_show(struct seq_file *s, void *p)
struct pid *pid;
struct task_struct *tsk;
+ spin_lock_irqsave(&workqueue_cpu_stat(cpu)->lock, flags);
+ if (&cws->list == workqueue_cpu_stat(cpu)->list.next)
+ seq_printf(s, "\n");
+ spin_unlock_irqrestore(&workqueue_cpu_stat(cpu)->lock, flags);
+
pid = find_get_pid(cws->pid);
if (pid) {
tsk = get_pid_task(pid, PIDTYPE_PID);
@@ -208,18 +213,13 @@ static int workqueue_stat_show(struct seq_file *s, void *p)
put_pid(pid);
}
- spin_lock_irqsave(&workqueue_cpu_stat(cpu)->lock, flags);
- if (&cws->list == workqueue_cpu_stat(cpu)->list.next)
- seq_printf(s, "\n");
- spin_unlock_irqrestore(&workqueue_cpu_stat(cpu)->lock, flags);
-
return 0;
}
static int workqueue_stat_headers(struct seq_file *s)
{
seq_printf(s, "# CPU INSERTED EXECUTED NAME\n");
- seq_printf(s, "# | | | |\n\n");
+ seq_printf(s, "# | | | |\n");
return 0;
}
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH 2/2] trace_workqueues: fix empty line's output
2009-03-25 8:59 [PATCH 2/2] trace_workqueues: fix empty line's output Lai Jiangshan
@ 2009-03-25 13:34 ` Frederic Weisbecker
2009-03-25 17:33 ` [tip:tracing/ftrace] " Lai Jiangshan
1 sibling, 0 replies; 3+ messages in thread
From: Frederic Weisbecker @ 2009-03-25 13:34 UTC (permalink / raw)
To: Lai Jiangshan; +Cc: Ingo Molnar, Steven Rostedt, LKML
On Wed, Mar 25, 2009 at 04:59:18PM +0800, Lai Jiangshan wrote:
>
> Empty lines separate cpus stat. After previous
> fix(trace_stat: keep original order) applied, the empty lines
> are displayed at incorrect position.
>
> Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
> ---
> diff --git a/kernel/trace/trace_workqueue.c b/kernel/trace/trace_workqueue.c
> index 9ab035b..797201e 100644
> --- a/kernel/trace/trace_workqueue.c
> +++ b/kernel/trace/trace_workqueue.c
> @@ -196,6 +196,11 @@ static int workqueue_stat_show(struct seq_file *s, void *p)
> struct pid *pid;
> struct task_struct *tsk;
>
> + spin_lock_irqsave(&workqueue_cpu_stat(cpu)->lock, flags);
> + if (&cws->list == workqueue_cpu_stat(cpu)->list.next)
> + seq_printf(s, "\n");
> + spin_unlock_irqrestore(&workqueue_cpu_stat(cpu)->lock, flags);
> +
> pid = find_get_pid(cws->pid);
> if (pid) {
> tsk = get_pid_task(pid, PIDTYPE_PID);
> @@ -208,18 +213,13 @@ static int workqueue_stat_show(struct seq_file *s, void *p)
> put_pid(pid);
> }
>
> - spin_lock_irqsave(&workqueue_cpu_stat(cpu)->lock, flags);
> - if (&cws->list == workqueue_cpu_stat(cpu)->list.next)
> - seq_printf(s, "\n");
> - spin_unlock_irqrestore(&workqueue_cpu_stat(cpu)->lock, flags);
> -
> return 0;
> }
>
> static int workqueue_stat_headers(struct seq_file *s)
> {
> seq_printf(s, "# CPU INSERTED EXECUTED NAME\n");
> - seq_printf(s, "# | | | |\n\n");
> + seq_printf(s, "# | | | |\n");
> return 0;
> }
>
>
>
Looks good.
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
^ permalink raw reply [flat|nested] 3+ messages in thread* [tip:tracing/ftrace] trace_workqueues: fix empty line's output
2009-03-25 8:59 [PATCH 2/2] trace_workqueues: fix empty line's output Lai Jiangshan
2009-03-25 13:34 ` Frederic Weisbecker
@ 2009-03-25 17:33 ` Lai Jiangshan
1 sibling, 0 replies; 3+ messages in thread
From: Lai Jiangshan @ 2009-03-25 17:33 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, hpa, mingo, fweisbec, srostedt, tglx, laijs, mingo
Commit-ID: 2f63b840bc8a816ac879ee773b035cf3e433fae4
Gitweb: http://git.kernel.org/tip/2f63b840bc8a816ac879ee773b035cf3e433fae4
Author: Lai Jiangshan <laijs@cn.fujitsu.com>
AuthorDate: Wed, 25 Mar 2009 16:59:18 +0800
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 25 Mar 2009 18:32:35 +0100
trace_workqueues: fix empty line's output
Empty lines separate cpus stat. After previous
fix(trace_stat: keep original order) applied, the empty lines
are displayed at incorrect position.
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Acked-by: Steven Rostedt <srostedt@redhat.com>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <49C9F266.2060706@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
kernel/trace/trace_workqueue.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/kernel/trace/trace_workqueue.c b/kernel/trace/trace_workqueue.c
index 9ab035b..797201e 100644
--- a/kernel/trace/trace_workqueue.c
+++ b/kernel/trace/trace_workqueue.c
@@ -196,6 +196,11 @@ static int workqueue_stat_show(struct seq_file *s, void *p)
struct pid *pid;
struct task_struct *tsk;
+ spin_lock_irqsave(&workqueue_cpu_stat(cpu)->lock, flags);
+ if (&cws->list == workqueue_cpu_stat(cpu)->list.next)
+ seq_printf(s, "\n");
+ spin_unlock_irqrestore(&workqueue_cpu_stat(cpu)->lock, flags);
+
pid = find_get_pid(cws->pid);
if (pid) {
tsk = get_pid_task(pid, PIDTYPE_PID);
@@ -208,18 +213,13 @@ static int workqueue_stat_show(struct seq_file *s, void *p)
put_pid(pid);
}
- spin_lock_irqsave(&workqueue_cpu_stat(cpu)->lock, flags);
- if (&cws->list == workqueue_cpu_stat(cpu)->list.next)
- seq_printf(s, "\n");
- spin_unlock_irqrestore(&workqueue_cpu_stat(cpu)->lock, flags);
-
return 0;
}
static int workqueue_stat_headers(struct seq_file *s)
{
seq_printf(s, "# CPU INSERTED EXECUTED NAME\n");
- seq_printf(s, "# | | | |\n\n");
+ seq_printf(s, "# | | | |\n");
return 0;
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-03-25 17:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-25 8:59 [PATCH 2/2] trace_workqueues: fix empty line's output Lai Jiangshan
2009-03-25 13:34 ` Frederic Weisbecker
2009-03-25 17:33 ` [tip:tracing/ftrace] " Lai Jiangshan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox