Skip to content

Commit

Permalink
Merge branches 'tracing/branch-tracer', 'tracing/ftrace', 'tracing/fu…
Browse files Browse the repository at this point in the history
…nction-graph-tracer', 'tracing/markers', 'tracing/powerpc', 'tracing/stack-tracer' and 'tracing/tracepoints' into tracing/core
  • Loading branch information
Ingo Molnar committed Dec 2, 2008
8 parents 74bf3ca + 65c6dc6 + c072c24 + d51090b + a838c2e + f1eecf0 + 604094f + f08340c commit 222658e
Show file tree
Hide file tree
Showing 14 changed files with 380 additions and 190 deletions.
8 changes: 6 additions & 2 deletions Documentation/ftrace.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,11 @@ These are the only wild cards which are supported.

<match>*<match> will not work.

# echo hrtimer_* > /debug/tracing/set_ftrace_filter
Note: It is better to use quotes to enclose the wild cards, otherwise
the shell may expand the parameters into names of files in the local
directory.

# echo 'hrtimer_*' > /debug/tracing/set_ftrace_filter

Produces:

Expand Down Expand Up @@ -1306,7 +1310,7 @@ Again, now we want to append.
# echo sys_nanosleep > /debug/tracing/set_ftrace_filter
# cat /debug/tracing/set_ftrace_filter
sys_nanosleep
# echo hrtimer_* >> /debug/tracing/set_ftrace_filter
# echo 'hrtimer_*' >> /debug/tracing/set_ftrace_filter
# cat /debug/tracing/set_ftrace_filter
hrtimer_run_queues
hrtimer_run_pending
Expand Down
15 changes: 10 additions & 5 deletions Documentation/markers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,16 @@ to call) for the specific marker through marker_probe_register() and can be
activated by calling marker_arm(). Marker deactivation can be done by calling
marker_disarm() as many times as marker_arm() has been called. Removing a probe
is done through marker_probe_unregister(); it will disarm the probe.
marker_synchronize_unregister() must be called before the end of the module exit
function to make sure there is no caller left using the probe. This, and the
fact that preemption is disabled around the probe call, make sure that probe
removal and module unload are safe. See the "Probe example" section below for a
sample probe module.

marker_synchronize_unregister() must be called between probe unregistration and
the first occurrence of
- the end of module exit function,
to make sure there is no caller left using the probe;
- the free of any resource used by the probes,
to make sure the probes wont be accessing invalid data.
This, and the fact that preemption is disabled around the probe call, make sure
that probe removal and module unload are safe. See the "Probe example" section
below for a sample probe module.

The marker mechanism supports inserting multiple instances of the same marker.
Markers can be put in inline functions, inlined static functions, and
Expand Down
4 changes: 2 additions & 2 deletions Documentation/tracepoints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ In include/trace/subsys.h :
#include <linux/tracepoint.h>

DECLARE_TRACE(subsys_eventname,
TPPTOTO(int firstarg, struct task_struct *p),
TPPROTO(int firstarg, struct task_struct *p),
TPARGS(firstarg, p));

In subsys/file.c (where the tracing statement must be added) :
Expand All @@ -66,7 +66,7 @@ Where :
- subsys is the name of your subsystem.
- eventname is the name of the event to trace.

- TPPTOTO(int firstarg, struct task_struct *p) is the prototype of the
- TPPROTO(int firstarg, struct task_struct *p) is the prototype of the
function called by this tracepoint.

- TPARGS(firstarg, p) are the parameters names, same as found in the
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ ifdef CONFIG_FUNCTION_TRACER
CFLAGS_REMOVE_cputable.o = -pg -mno-sched-epilog
CFLAGS_REMOVE_prom_init.o = -pg -mno-sched-epilog
CFLAGS_REMOVE_btext.o = -pg -mno-sched-epilog
CFLAGS_REMOVE_prom.o = -pg -mno-sched-epilog

ifdef CONFIG_DYNAMIC_FTRACE
# dynamic ftrace setup.
Expand Down
40 changes: 9 additions & 31 deletions arch/powerpc/kernel/entry_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -1162,39 +1162,17 @@ machine_check_in_rtas:
#ifdef CONFIG_DYNAMIC_FTRACE
_GLOBAL(mcount)
_GLOBAL(_mcount)
stwu r1,-48(r1)
stw r3, 12(r1)
stw r4, 16(r1)
stw r5, 20(r1)
stw r6, 24(r1)
mflr r3
stw r7, 28(r1)
mfcr r5
stw r8, 32(r1)
stw r9, 36(r1)
stw r10,40(r1)
stw r3, 44(r1)
stw r5, 8(r1)
subi r3, r3, MCOUNT_INSN_SIZE
.globl mcount_call
mcount_call:
bl ftrace_stub
nop
lwz r6, 8(r1)
lwz r0, 44(r1)
lwz r3, 12(r1)
/*
* It is required that _mcount on PPC32 must preserve the
* link register. But we have r0 to play with. We use r0
* to push the return address back to the caller of mcount
* into the ctr register, restore the link register and
* then jump back using the ctr register.
*/
mflr r0
mtctr r0
lwz r4, 16(r1)
mtcr r6
lwz r5, 20(r1)
lwz r6, 24(r1)
lwz r0, 52(r1)
lwz r7, 28(r1)
lwz r8, 32(r1)
lwz r0, 4(r1)
mtlr r0
lwz r9, 36(r1)
lwz r10,40(r1)
addi r1, r1, 48
bctr

_GLOBAL(ftrace_caller)
Expand Down
12 changes: 0 additions & 12 deletions arch/powerpc/kernel/entry_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -888,18 +888,6 @@ _GLOBAL(enter_prom)
#ifdef CONFIG_DYNAMIC_FTRACE
_GLOBAL(mcount)
_GLOBAL(_mcount)
/* Taken from output of objdump from lib64/glibc */
mflr r3
stdu r1, -112(r1)
std r3, 128(r1)
subi r3, r3, MCOUNT_INSN_SIZE
.globl mcount_call
mcount_call:
bl ftrace_stub
nop
ld r0, 128(r1)
mtlr r0
addi r1, r1, 112
blr

_GLOBAL(ftrace_caller)
Expand Down
Loading

0 comments on commit 222658e

Please sign in to comment.