-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Blackfin: initial support for ftrace grapher
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
- Loading branch information
Mike Frysinger
committed
Jun 13, 2009
1 parent
1c873be
commit 1ee76d7
Showing
5 changed files
with
115 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* ftrace graph code | ||
* | ||
* Copyright (C) 2009 Analog Devices Inc. | ||
* Licensed under the GPL-2 or later. | ||
*/ | ||
|
||
#include <linux/ftrace.h> | ||
#include <linux/kernel.h> | ||
#include <linux/sched.h> | ||
#include <asm/atomic.h> | ||
|
||
#ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
|
||
/* | ||
* Hook the return address and push it in the stack of return addrs | ||
* in current thread info. | ||
*/ | ||
void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr) | ||
{ | ||
struct ftrace_graph_ent trace; | ||
unsigned long return_hooker = (unsigned long)&return_to_handler; | ||
|
||
if (unlikely(atomic_read(¤t->tracing_graph_pause))) | ||
return; | ||
|
||
if (ftrace_push_return_trace(*parent, self_addr, &trace.depth) == -EBUSY) | ||
return; | ||
|
||
trace.func = self_addr; | ||
|
||
/* Only trace if the calling function expects to */ | ||
if (!ftrace_graph_entry(&trace)) { | ||
current->curr_ret_stack--; | ||
return; | ||
} | ||
|
||
/* all is well in the world ! hijack RETS ... */ | ||
*parent = return_hooker; | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,7 @@ SECTIONS | |
SCHED_TEXT | ||
#endif | ||
LOCK_TEXT | ||
IRQENTRY_TEXT | ||
KPROBES_TEXT | ||
*(.text.*) | ||
*(.fixup) | ||
|