aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.c
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-03-02 14:04:40 -0500
committerSteven Rostedt <srostedt@redhat.com>2009-03-02 14:08:51 -0500
commitf9520750c4c9924c14325cd951efae5fae58104c (patch)
treeb6958c13894816db9388f856f101e9f67b3bf1a4 /kernel/trace/trace.c
parent11a241a3302277db05561e01477528629d806c4e (diff)
tracing: make trace_seq_reset global and rename to trace_seq_init
Impact: clean up The trace_seq functions may be used separately outside of the ftrace iterator. The trace_seq_reset is needed for these operations. This patch also renames trace_seq_reset to the more appropriate trace_seq_init. Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r--kernel/trace/trace.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index c5e39cd7310d..ea055aa21cd9 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -342,13 +342,6 @@ __update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu)
342 tracing_record_cmdline(tsk); 342 tracing_record_cmdline(tsk);
343} 343}
344 344
345static void
346trace_seq_reset(struct trace_seq *s)
347{
348 s->len = 0;
349 s->readpos = 0;
350}
351
352ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf, size_t cnt) 345ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf, size_t cnt)
353{ 346{
354 int len; 347 int len;
@@ -395,7 +388,7 @@ trace_print_seq(struct seq_file *m, struct trace_seq *s)
395 s->buffer[len] = 0; 388 s->buffer[len] = 0;
396 seq_puts(m, s->buffer); 389 seq_puts(m, s->buffer);
397 390
398 trace_seq_reset(s); 391 trace_seq_init(s);
399} 392}
400 393
401/** 394/**
@@ -2620,7 +2613,7 @@ tracing_read_pipe(struct file *filp, char __user *ubuf,
2620 if (sret != -EBUSY) 2613 if (sret != -EBUSY)
2621 return sret; 2614 return sret;
2622 2615
2623 trace_seq_reset(&iter->seq); 2616 trace_seq_init(&iter->seq);
2624 2617
2625 /* copy the tracer to avoid using a global lock all around */ 2618 /* copy the tracer to avoid using a global lock all around */
2626 mutex_lock(&trace_types_lock); 2619 mutex_lock(&trace_types_lock);
@@ -2682,7 +2675,7 @@ waitagain:
2682 /* Now copy what we have to the user */ 2675 /* Now copy what we have to the user */
2683 sret = trace_seq_to_user(&iter->seq, ubuf, cnt); 2676 sret = trace_seq_to_user(&iter->seq, ubuf, cnt);
2684 if (iter->seq.readpos >= iter->seq.len) 2677 if (iter->seq.readpos >= iter->seq.len)
2685 trace_seq_reset(&iter->seq); 2678 trace_seq_init(&iter->seq);
2686 2679
2687 /* 2680 /*
2688 * If there was nothing to send to user, inspite of consuming trace 2681 * If there was nothing to send to user, inspite of consuming trace
@@ -2819,7 +2812,7 @@ static ssize_t tracing_splice_read_pipe(struct file *filp,
2819 partial[i].offset = 0; 2812 partial[i].offset = 0;
2820 partial[i].len = iter->seq.len; 2813 partial[i].len = iter->seq.len;
2821 2814
2822 trace_seq_reset(&iter->seq); 2815 trace_seq_init(&iter->seq);
2823 } 2816 }
2824 2817
2825 mutex_unlock(&iter->mutex); 2818 mutex_unlock(&iter->mutex);
@@ -3631,7 +3624,7 @@ trace_printk_seq(struct trace_seq *s)
3631 3624
3632 printk(KERN_TRACE "%s", s->buffer); 3625 printk(KERN_TRACE "%s", s->buffer);
3633 3626
3634 trace_seq_reset(s); 3627 trace_seq_init(s);
3635} 3628}
3636 3629
3637void ftrace_dump(void) 3630void ftrace_dump(void)