Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 116611
b: refs/heads/master
c: f09ce57
h: refs/heads/master
i:
  116609: 891c15b
  116607: f2c63ae
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Oct 14, 2008
1 parent 7502c90 commit 92ab7ee
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 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: 5a90f577e5369a84b720ead42e621fcb1b8a8b21
refs/heads/master: f09ce573f57ddc35c67b39e51f34545877b30031
8 changes: 5 additions & 3 deletions trunk/kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ static const char *trace_options[] = {
"block",
"stacktrace",
"sched-tree",
"ftrace_printk",
NULL
};

Expand Down Expand Up @@ -3091,25 +3092,26 @@ static __init void tracer_init_debugfs(void)

int __ftrace_printk(unsigned long ip, const char *fmt, ...)
{
struct trace_array *tr = &global_trace;
static DEFINE_SPINLOCK(trace_buf_lock);
static char trace_buf[TRACE_BUF_SIZE];

struct trace_array *tr = &global_trace;
struct trace_array_cpu *data;
struct trace_entry *entry;
unsigned long flags;
long disabled;
va_list ap;
int cpu, len = 0, write, written = 0;

if (likely(!ftrace_function_enabled))
if (!(trace_flags & TRACE_ITER_PRINTK) || !tr->ctrl || tracing_disabled)
return 0;

local_irq_save(flags);
cpu = raw_smp_processor_id();
data = tr->data[cpu];
disabled = atomic_inc_return(&data->disabled);

if (unlikely(disabled != 1 || !ftrace_function_enabled))
if (unlikely(disabled != 1))
goto out;

spin_lock(&trace_buf_lock);
Expand Down
1 change: 1 addition & 0 deletions trunk/kernel/trace/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ enum trace_iterator_flags {
TRACE_ITER_BLOCK = 0x80,
TRACE_ITER_STACKTRACE = 0x100,
TRACE_ITER_SCHED_TREE = 0x200,
TRACE_ITER_PRINTK = 0x400,
};

#endif /* _LINUX_KERNEL_TRACE_H */

0 comments on commit 92ab7ee

Please sign in to comment.