Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
1ee76d7e
Commit
1ee76d7e
authored
Jun 10, 2009
by
Mike Frysinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Blackfin: initial support for ftrace grapher
Signed-off-by:
Mike Frysinger
<
vapier@gentoo.org
>
parent
1c873be7
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
115 additions
and
0 deletions
+115
-0
arch/blackfin/Kconfig
arch/blackfin/Kconfig
+1
-0
arch/blackfin/kernel/Makefile
arch/blackfin/kernel/Makefile
+3
-0
arch/blackfin/kernel/ftrace-entry.S
arch/blackfin/kernel/ftrace-entry.S
+68
-0
arch/blackfin/kernel/ftrace.c
arch/blackfin/kernel/ftrace.c
+42
-0
arch/blackfin/kernel/vmlinux.lds.S
arch/blackfin/kernel/vmlinux.lds.S
+1
-0
No files found.
arch/blackfin/Kconfig
View file @
1ee76d7e
...
@@ -19,6 +19,7 @@ config RWSEM_XCHGADD_ALGORITHM
...
@@ -19,6 +19,7 @@ config RWSEM_XCHGADD_ALGORITHM
config BLACKFIN
config BLACKFIN
def_bool y
def_bool y
select HAVE_FUNCTION_GRAPH_TRACER
select HAVE_FUNCTION_TRACER
select HAVE_FUNCTION_TRACER
select HAVE_IDE
select HAVE_IDE
select HAVE_KERNEL_GZIP
select HAVE_KERNEL_GZIP
...
...
arch/blackfin/kernel/Makefile
View file @
1ee76d7e
...
@@ -16,6 +16,9 @@ else
...
@@ -16,6 +16,9 @@ else
endif
endif
obj-$(CONFIG_FUNCTION_TRACER)
+=
ftrace-entry.o
obj-$(CONFIG_FUNCTION_TRACER)
+=
ftrace-entry.o
obj-$(CONFIG_FUNCTION_GRAPH_TRACER)
+=
ftrace.o
CFLAGS_REMOVE_ftrace.o
=
-pg
obj-$(CONFIG_IPIPE)
+=
ipipe.o
obj-$(CONFIG_IPIPE)
+=
ipipe.o
obj-$(CONFIG_IPIPE_TRACE_MCOUNT)
+=
mcount.o
obj-$(CONFIG_IPIPE_TRACE_MCOUNT)
+=
mcount.o
obj-$(CONFIG_BFIN_GPTIMERS)
+=
gptimers.o
obj-$(CONFIG_BFIN_GPTIMERS)
+=
gptimers.o
...
...
arch/blackfin/kernel/ftrace-entry.S
View file @
1ee76d7e
...
@@ -35,6 +35,28 @@ ENTRY(__mcount)
...
@@ -35,6 +35,28 @@ ENTRY(__mcount)
cc
=
r2
==
r3
;
cc
=
r2
==
r3
;
if
!
cc
jump
.
Ldo_trace
;
if
!
cc
jump
.
Ldo_trace
;
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
/
*
if
the
ftrace_graph_return
function
pointer
is
not
set
to
*
the
ftrace_stub
entry
,
call
prepare_ftrace_return
()
.
*/
p0.l
=
_ftrace_graph_return
;
p0.h
=
_ftrace_graph_return
;
r3
=
[
p0
]
;
cc
=
r2
==
r3
;
if
!
cc
jump
_ftrace_graph_caller
;
/
*
similarly
,
if
the
ftrace_graph_entry
function
pointer
is
not
*
set
to
the
ftrace_graph_entry_stub
entry
,
...
*/
p0.l
=
_ftrace_graph_entry
;
p0.h
=
_ftrace_graph_entry
;
r2.l
=
_ftrace_graph_entry_stub
;
r2.h
=
_ftrace_graph_entry_stub
;
r3
=
[
p0
]
;
cc
=
r2
==
r3
;
if
!
cc
jump
_ftrace_graph_caller
;
#endif
r2
=
[
sp
++]
;
r2
=
[
sp
++]
;
rts
;
rts
;
...
@@ -61,6 +83,7 @@ ENTRY(__mcount)
...
@@ -61,6 +83,7 @@ ENTRY(__mcount)
call
(
p0
)
;
call
(
p0
)
;
/
*
restore
state
and
get
out
of
dodge
*/
/
*
restore
state
and
get
out
of
dodge
*/
.
Lfinish_trace
:
rets
=
[
sp
++]
;
rets
=
[
sp
++]
;
r1
=
[
sp
++]
;
r1
=
[
sp
++]
;
r0
=
[
sp
++]
;
r0
=
[
sp
++]
;
...
@@ -70,3 +93,48 @@ ENTRY(__mcount)
...
@@ -70,3 +93,48 @@ ENTRY(__mcount)
_ftrace_stub
:
_ftrace_stub
:
rts
;
rts
;
ENDPROC
(
__mcount
)
ENDPROC
(
__mcount
)
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
/*
The
prepare_ftrace_return
()
function
is
similar
to
the
trace
function
*
except
it
takes
a
pointer
to
the
location
of
the
frompc
.
This
is
so
*
the
prepare_ftrace_return
()
can
hijack
it
temporarily
for
probing
*
purposes
.
*/
ENTRY
(
_ftrace_graph_caller
)
/
*
save
first
/
second
function
arg
and
the
return
register
*/
[--
sp
]
=
r0
;
[--
sp
]
=
r1
;
[--
sp
]
=
rets
;
r0
=
fp
;
r1
=
rets
;
r0
+=
4
;
r1
+=
-
MCOUNT_INSN_SIZE
;
call
_prepare_ftrace_return
;
jump
.
Lfinish_trace
;
ENDPROC
(
_ftrace_graph_caller
)
/*
Undo
the
rewrite
caused
by
ftrace_graph_caller
()
.
The
common
function
*
ftrace_return_to_handler
()
will
return
the
original
rets
so
we
can
*
restore
it
and
be
on
our
way
.
*/
ENTRY
(
_return_to_handler
)
/
*
make
sure
original
return
values
are
saved
*/
[--
sp
]
=
p0
;
[--
sp
]
=
r0
;
[--
sp
]
=
r1
;
/
*
get
original
return
address
*/
call
_ftrace_return_to_handler
;
rets
=
r0
;
/
*
anomaly
05000371
-
make
sure
we
have
at
least
three
instructions
*
between
rets
setting
and
the
return
*/
r1
=
[
sp
++]
;
r0
=
[
sp
++]
;
p0
=
[
sp
++]
;
rts
;
ENDPROC
(
_return_to_handler
)
#endif
arch/blackfin/kernel/ftrace.c
0 → 100644
View file @
1ee76d7e
/*
* 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
(
&
current
->
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
arch/blackfin/kernel/vmlinux.lds.S
View file @
1ee76d7e
...
@@ -54,6 +54,7 @@ SECTIONS
...
@@ -54,6 +54,7 @@ SECTIONS
SCHED_TEXT
SCHED_TEXT
#endif
#endif
LOCK_TEXT
LOCK_TEXT
IRQENTRY_TEXT
KPROBES_TEXT
KPROBES_TEXT
*(.
text
.*)
*(.
text
.*)
*(.
fixup
)
*(.
fixup
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment