Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 350046
b: refs/heads/master
c: d840f71
h: refs/heads/master
v: v3
  • Loading branch information
Steven Rostedt (Red Hat) committed Feb 1, 2013
1 parent d9cd7d4 commit 6571b7a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 19 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: c1043fcda1b9e8e5144cfdaee7be262c50dbdead
refs/heads/master: d840f718d28715a9833c1a8f46c2493ff3fd219b
30 changes: 12 additions & 18 deletions trunk/kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ static unsigned long trace_buf_size = TRACE_BUF_SIZE_DEFAULT;
static struct tracer *trace_types __read_mostly;

/* current_trace points to the tracer that is currently active */
static struct tracer *current_trace __read_mostly;
static struct tracer *current_trace __read_mostly = &nop_trace;

/*
* trace_types_lock is used to protect the trace_types list.
Expand Down Expand Up @@ -2100,8 +2100,7 @@ print_trace_header(struct seq_file *m, struct trace_iterator *iter)
unsigned long total;
const char *name = "preemption";

if (type)
name = type->name;
name = type->name;

get_total_entries(tr, &total, &entries);

Expand Down Expand Up @@ -2477,13 +2476,12 @@ __tracing_open(struct inode *inode, struct file *file, bool snapshot)
if (!iter->trace)
goto fail;

if (current_trace)
*iter->trace = *current_trace;
*iter->trace = *current_trace;

if (!zalloc_cpumask_var(&iter->started, GFP_KERNEL))
goto fail;

if ((current_trace && current_trace->print_max) || snapshot)
if (current_trace->print_max || snapshot)
iter->tr = &max_tr;
else
iter->tr = &global_trace;
Expand Down Expand Up @@ -3037,10 +3035,7 @@ tracing_set_trace_read(struct file *filp, char __user *ubuf,
int r;

mutex_lock(&trace_types_lock);
if (current_trace)
r = sprintf(buf, "%s\n", current_trace->name);
else
r = sprintf(buf, "\n");
r = sprintf(buf, "%s\n", current_trace->name);
mutex_unlock(&trace_types_lock);

return simple_read_from_buffer(ubuf, cnt, ppos, buf, r);
Expand Down Expand Up @@ -3231,10 +3226,10 @@ static int tracing_set_tracer(const char *buf)
goto out;

trace_branch_disable();
if (current_trace && current_trace->reset)
if (current_trace->reset)
current_trace->reset(tr);

had_max_tr = current_trace && current_trace->allocated_snapshot;
had_max_tr = current_trace->allocated_snapshot;
current_trace = &nop_trace;

if (had_max_tr && !t->use_max_tr) {
Expand Down Expand Up @@ -3373,8 +3368,7 @@ static int tracing_open_pipe(struct inode *inode, struct file *filp)
ret = -ENOMEM;
goto fail;
}
if (current_trace)
*iter->trace = *current_trace;
*iter->trace = *current_trace;

if (!alloc_cpumask_var(&iter->started, GFP_KERNEL)) {
ret = -ENOMEM;
Expand Down Expand Up @@ -3525,7 +3519,7 @@ tracing_read_pipe(struct file *filp, char __user *ubuf,

/* copy the tracer to avoid using a global lock all around */
mutex_lock(&trace_types_lock);
if (unlikely(current_trace && iter->trace->name != current_trace->name))
if (unlikely(iter->trace->name != current_trace->name))
*iter->trace = *current_trace;
mutex_unlock(&trace_types_lock);

Expand Down Expand Up @@ -3691,7 +3685,7 @@ static ssize_t tracing_splice_read_pipe(struct file *filp,

/* copy the tracer to avoid using a global lock all around */
mutex_lock(&trace_types_lock);
if (unlikely(current_trace && iter->trace->name != current_trace->name))
if (unlikely(iter->trace->name != current_trace->name))
*iter->trace = *current_trace;
mutex_unlock(&trace_types_lock);

Expand Down Expand Up @@ -4115,7 +4109,7 @@ tracing_snapshot_write(struct file *filp, const char __user *ubuf, size_t cnt,

mutex_lock(&trace_types_lock);

if (current_trace && current_trace->use_max_tr) {
if (current_trace->use_max_tr) {
ret = -EBUSY;
goto out;
}
Expand Down Expand Up @@ -5299,7 +5293,7 @@ __init static int tracer_alloc_buffers(void)
init_irq_work(&trace_work_wakeup, trace_wake_up);

register_tracer(&nop_trace);
current_trace = &nop_trace;

/* All seems OK, enable tracing */
tracing_disabled = 0;

Expand Down

0 comments on commit 6571b7a

Please sign in to comment.