Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 100534
b: refs/heads/master
c: 2bb6f8d
h: refs/heads/master
v: v3
  • Loading branch information
Steven Rostedt authored and Thomas Gleixner committed May 23, 2008
1 parent 40dc98a commit 54ad1db
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 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: a4feb8348b62fe76a63cdb5569f5c920f5283c06
refs/heads/master: 2bb6f8d6389cbfadd657e7dc069f6986abf35e4f
15 changes: 11 additions & 4 deletions trunk/kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,16 +267,23 @@ ftrace_record_ip(unsigned long ip)
unsigned long key;
int resched;
int atomic;
int cpu;

if (!ftrace_enabled || ftrace_disabled)
return;

resched = need_resched();
preempt_disable_notrace();

/* We simply need to protect against recursion */
__get_cpu_var(ftrace_shutdown_disable_cpu)++;
if (__get_cpu_var(ftrace_shutdown_disable_cpu) != 1)
/*
* We simply need to protect against recursion.
* Use the the raw version of smp_processor_id and not
* __get_cpu_var which can call debug hooks that can
* cause a recursive crash here.
*/
cpu = raw_smp_processor_id();
per_cpu(ftrace_shutdown_disable_cpu, cpu)++;
if (per_cpu(ftrace_shutdown_disable_cpu, cpu) != 1)
goto out;

if (unlikely(ftrace_record_suspend))
Expand Down Expand Up @@ -317,7 +324,7 @@ ftrace_record_ip(unsigned long ip)
out_unlock:
spin_unlock_irqrestore(&ftrace_shutdown_lock, flags);
out:
__get_cpu_var(ftrace_shutdown_disable_cpu)--;
per_cpu(ftrace_shutdown_disable_cpu, cpu)--;

/* prevent recursion with scheduler */
if (resched)
Expand Down

0 comments on commit 54ad1db

Please sign in to comment.