Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 141020
b: refs/heads/master
c: 1618536
h: refs/heads/master
v: v3
  • Loading branch information
Frederic Weisbecker authored and Ingo Molnar committed Mar 23, 2009
1 parent 459e7cd commit 51ab0d8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 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: c4cff064be678f1e8344d907499f2a81282edc19
refs/heads/master: 1618536961d31f9b3f55767b22d4a897f4204c26
16 changes: 11 additions & 5 deletions trunk/kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ trace_function(struct trace_array *tr,
}

#ifdef CONFIG_FUNCTION_GRAPH_TRACER
static void __trace_graph_entry(struct trace_array *tr,
static int __trace_graph_entry(struct trace_array *tr,
struct ftrace_graph_ent *trace,
unsigned long flags,
int pc)
Expand All @@ -933,15 +933,17 @@ static void __trace_graph_entry(struct trace_array *tr,
struct ftrace_graph_ent_entry *entry;

if (unlikely(local_read(&__get_cpu_var(ftrace_cpu_disabled))))
return;
return 0;

event = trace_buffer_lock_reserve(&global_trace, TRACE_GRAPH_ENT,
sizeof(*entry), flags, pc);
if (!event)
return;
return 0;
entry = ring_buffer_event_data(event);
entry->graph_ent = *trace;
ring_buffer_unlock_commit(global_trace.buffer, event);

return 1;
}

static void __trace_graph_return(struct trace_array *tr,
Expand Down Expand Up @@ -1162,6 +1164,7 @@ int trace_graph_entry(struct ftrace_graph_ent *trace)
struct trace_array_cpu *data;
unsigned long flags;
long disabled;
int ret;
int cpu;
int pc;

Expand All @@ -1177,15 +1180,18 @@ int trace_graph_entry(struct ftrace_graph_ent *trace)
disabled = atomic_inc_return(&data->disabled);
if (likely(disabled == 1)) {
pc = preempt_count();
__trace_graph_entry(tr, trace, flags, pc);
ret = __trace_graph_entry(tr, trace, flags, pc);
} else {
ret = 0;
}
/* Only do the atomic if it is not already set */
if (!test_tsk_trace_graph(current))
set_tsk_trace_graph(current);

atomic_dec(&data->disabled);
local_irq_restore(flags);

return 1;
return ret;
}

void trace_graph_return(struct ftrace_graph_ret *trace)
Expand Down

0 comments on commit 51ab0d8

Please sign in to comment.