diff options
| author | Lai Jiangshan <laijs@cn.fujitsu.com> | 2009-03-25 04:27:17 -0400 | 
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2009-03-25 13:32:34 -0400 | 
| commit | e6f489013b985b58d096a3091ece0ed579367232 (patch) | |
| tree | 598baf56ceb47c256338ae4934937d2e6e111181 | |
| parent | ee000b7f9fe429d2470c674ccec8d344f6789e0d (diff) | |
trace_stat: don't call seq_printf() in seq_operation->start()
Impact: Fix incorrect way using seq_file's API
Use SEQ_START_TOKEN instead of calling ->stat_headers()
int seq_operation->start().
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Acked-by: Steven Rostedt <srostedt@redhat.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
LKML-Reference: <49C9EAE5.5070202@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
| -rw-r--r-- | kernel/trace/trace_stat.c | 8 | 
1 files changed, 7 insertions, 1 deletions
| diff --git a/kernel/trace/trace_stat.c b/kernel/trace/trace_stat.c index f71b85b22cfe..8c129dd480ad 100644 --- a/kernel/trace/trace_stat.c +++ b/kernel/trace/trace_stat.c | |||
| @@ -163,7 +163,7 @@ static void *stat_seq_start(struct seq_file *s, loff_t *pos) | |||
| 163 | 163 | ||
| 164 | /* If we are in the beginning of the file, print the headers */ | 164 | /* If we are in the beginning of the file, print the headers */ | 
| 165 | if (!*pos && session->ts->stat_headers) | 165 | if (!*pos && session->ts->stat_headers) | 
| 166 | session->ts->stat_headers(s); | 166 | return SEQ_START_TOKEN; | 
| 167 | 167 | ||
| 168 | return seq_list_start(&session->stat_list, *pos); | 168 | return seq_list_start(&session->stat_list, *pos); | 
| 169 | } | 169 | } | 
| @@ -172,6 +172,9 @@ static void *stat_seq_next(struct seq_file *s, void *p, loff_t *pos) | |||
| 172 | { | 172 | { | 
| 173 | struct tracer_stat_session *session = s->private; | 173 | struct tracer_stat_session *session = s->private; | 
| 174 | 174 | ||
| 175 | if (p == SEQ_START_TOKEN) | ||
| 176 | return seq_list_start(&session->stat_list, *pos); | ||
| 177 | |||
| 175 | return seq_list_next(p, &session->stat_list, pos); | 178 | return seq_list_next(p, &session->stat_list, pos); | 
| 176 | } | 179 | } | 
| 177 | 180 | ||
| @@ -186,6 +189,9 @@ static int stat_seq_show(struct seq_file *s, void *v) | |||
| 186 | struct tracer_stat_session *session = s->private; | 189 | struct tracer_stat_session *session = s->private; | 
| 187 | struct trace_stat_list *l = list_entry(v, struct trace_stat_list, list); | 190 | struct trace_stat_list *l = list_entry(v, struct trace_stat_list, list); | 
| 188 | 191 | ||
| 192 | if (v == SEQ_START_TOKEN) | ||
| 193 | return session->ts->stat_headers(s); | ||
| 194 | |||
| 189 | return session->ts->stat_show(s, l->stat); | 195 | return session->ts->stat_show(s, l->stat); | 
| 190 | } | 196 | } | 
| 191 | 197 | ||
