Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 140834
b: refs/heads/master
c: f952075
h: refs/heads/master
v: v3
  • Loading branch information
Steven Rostedt committed Mar 2, 2009
1 parent 34208dd commit 1e1dc34
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 11a241a3302277db05561e01477528629d806c4e
refs/heads/master: f9520750c4c9924c14325cd951efae5fae58104c
17 changes: 5 additions & 12 deletions trunk/kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,13 +342,6 @@ __update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu)
tracing_record_cmdline(tsk);
}

static void
trace_seq_reset(struct trace_seq *s)
{
s->len = 0;
s->readpos = 0;
}

ssize_t trace_seq_to_user(struct trace_seq *s, char __user *ubuf, size_t cnt)
{
int len;
Expand Down Expand Up @@ -395,7 +388,7 @@ trace_print_seq(struct seq_file *m, struct trace_seq *s)
s->buffer[len] = 0;
seq_puts(m, s->buffer);

trace_seq_reset(s);
trace_seq_init(s);
}

/**
Expand Down Expand Up @@ -2620,7 +2613,7 @@ tracing_read_pipe(struct file *filp, char __user *ubuf,
if (sret != -EBUSY)
return sret;

trace_seq_reset(&iter->seq);
trace_seq_init(&iter->seq);

/* copy the tracer to avoid using a global lock all around */
mutex_lock(&trace_types_lock);
Expand Down Expand Up @@ -2682,7 +2675,7 @@ tracing_read_pipe(struct file *filp, char __user *ubuf,
/* Now copy what we have to the user */
sret = trace_seq_to_user(&iter->seq, ubuf, cnt);
if (iter->seq.readpos >= iter->seq.len)
trace_seq_reset(&iter->seq);
trace_seq_init(&iter->seq);

/*
* If there was nothing to send to user, inspite of consuming trace
Expand Down Expand Up @@ -2819,7 +2812,7 @@ static ssize_t tracing_splice_read_pipe(struct file *filp,
partial[i].offset = 0;
partial[i].len = iter->seq.len;

trace_seq_reset(&iter->seq);
trace_seq_init(&iter->seq);
}

mutex_unlock(&iter->mutex);
Expand Down Expand Up @@ -3631,7 +3624,7 @@ trace_printk_seq(struct trace_seq *s)

printk(KERN_TRACE "%s", s->buffer);

trace_seq_reset(s);
trace_seq_init(s);
}

void ftrace_dump(void)
Expand Down
8 changes: 8 additions & 0 deletions trunk/kernel/trace/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,14 @@ struct trace_seq {
unsigned int readpos;
};

static inline void
trace_seq_init(struct trace_seq *s)
{
s->len = 0;
s->readpos = 0;
}


#define TRACE_PIPE_ALL_CPU -1

/*
Expand Down

0 comments on commit 1e1dc34

Please sign in to comment.