Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 121154
b: refs/heads/master
c: 86fa2f6
h: refs/heads/master
v: v3
  • Loading branch information
Ingo Molnar committed Nov 19, 2008
1 parent f698120 commit 5fc5bcb
Show file tree
Hide file tree
Showing 2 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: a22506347d038a66506c6f57e9b97104128e280d
refs/heads/master: 86fa2f60674540df0b34f5c547ed0c1cf3a8f212
25 changes: 13 additions & 12 deletions trunk/kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,15 @@ int register_tracer(struct tracer *type)
return -1;
}

/*
* When this gets called we hold the BKL which means that
* preemption is disabled. Various trace selftests however
* need to disable and enable preemption for successful tests.
* So we drop the BKL here and grab it after the tests again.
*/
unlock_kernel();
mutex_lock(&trace_types_lock);

for (t = trace_types; t; t = t->next) {
if (strcmp(type->name, t->name) == 0) {
/* already found */
Expand All @@ -532,13 +540,6 @@ int register_tracer(struct tracer *type)
}

#ifdef CONFIG_FTRACE_STARTUP_TEST
/*
* When this gets called we hold the BKL which means that preemption
* is disabled. Various trace selftests however need to disable
* and enable preemption for successful tests. So we drop the BKL here
* and grab it after the tests again.
*/
unlock_kernel();
if (type->selftest) {
struct tracer *saved_tracer = current_trace;
struct trace_array *tr = &global_trace;
Expand All @@ -550,9 +551,9 @@ int register_tracer(struct tracer *type)
* internal tracing to verify that everything is in order.
* If we fail, we do not register this tracer.
*/
for_each_tracing_cpu(i) {
for_each_tracing_cpu(i)
tracing_reset(tr, i);
}

current_trace = type;
/* the test is responsible for initializing and enabling */
pr_info("Testing tracer %s: ", type->name);
Expand All @@ -564,12 +565,11 @@ int register_tracer(struct tracer *type)
goto out;
}
/* Only reset on passing, to avoid touching corrupted buffers */
for_each_tracing_cpu(i) {
for_each_tracing_cpu(i)
tracing_reset(tr, i);
}

printk(KERN_CONT "PASSED\n");
}
lock_kernel();
#endif

type->next = trace_types;
Expand All @@ -580,6 +580,7 @@ int register_tracer(struct tracer *type)

out:
mutex_unlock(&trace_types_lock);
lock_kernel();

return ret;
}
Expand Down

0 comments on commit 5fc5bcb

Please sign in to comment.