Skip to content

Commit 222658e

Browse files
author
Ingo Molnar
committed
Merge branches 'tracing/branch-tracer', 'tracing/ftrace', 'tracing/function-graph-tracer', 'tracing/markers', 'tracing/powerpc', 'tracing/stack-tracer' and 'tracing/tracepoints' into tracing/core
8 parents 74bf3ca + 65c6dc6 + c072c24 + d51090b + a838c2e + f1eecf0 + 604094f + f08340c commit 222658e

File tree

14 files changed

+380
-190
lines changed

14 files changed

+380
-190
lines changed

Documentation/ftrace.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,7 +1251,11 @@ These are the only wild cards which are supported.
12511251

12521252
<match>*<match> will not work.
12531253

1254-
# echo hrtimer_* > /debug/tracing/set_ftrace_filter
1254+
Note: It is better to use quotes to enclose the wild cards, otherwise
1255+
the shell may expand the parameters into names of files in the local
1256+
directory.
1257+
1258+
# echo 'hrtimer_*' > /debug/tracing/set_ftrace_filter
12551259

12561260
Produces:
12571261

@@ -1306,7 +1310,7 @@ Again, now we want to append.
13061310
# echo sys_nanosleep > /debug/tracing/set_ftrace_filter
13071311
# cat /debug/tracing/set_ftrace_filter
13081312
sys_nanosleep
1309-
# echo hrtimer_* >> /debug/tracing/set_ftrace_filter
1313+
# echo 'hrtimer_*' >> /debug/tracing/set_ftrace_filter
13101314
# cat /debug/tracing/set_ftrace_filter
13111315
hrtimer_run_queues
13121316
hrtimer_run_pending

Documentation/markers.txt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,16 @@ to call) for the specific marker through marker_probe_register() and can be
5151
activated by calling marker_arm(). Marker deactivation can be done by calling
5252
marker_disarm() as many times as marker_arm() has been called. Removing a probe
5353
is done through marker_probe_unregister(); it will disarm the probe.
54-
marker_synchronize_unregister() must be called before the end of the module exit
55-
function to make sure there is no caller left using the probe. This, and the
56-
fact that preemption is disabled around the probe call, make sure that probe
57-
removal and module unload are safe. See the "Probe example" section below for a
58-
sample probe module.
54+
55+
marker_synchronize_unregister() must be called between probe unregistration and
56+
the first occurrence of
57+
- the end of module exit function,
58+
to make sure there is no caller left using the probe;
59+
- the free of any resource used by the probes,
60+
to make sure the probes wont be accessing invalid data.
61+
This, and the fact that preemption is disabled around the probe call, make sure
62+
that probe removal and module unload are safe. See the "Probe example" section
63+
below for a sample probe module.
5964

6065
The marker mechanism supports inserting multiple instances of the same marker.
6166
Markers can be put in inline functions, inlined static functions, and

Documentation/tracepoints.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ In include/trace/subsys.h :
4545
#include <linux/tracepoint.h>
4646

4747
DECLARE_TRACE(subsys_eventname,
48-
TPPTOTO(int firstarg, struct task_struct *p),
48+
TPPROTO(int firstarg, struct task_struct *p),
4949
TPARGS(firstarg, p));
5050

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

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

7272
- TPARGS(firstarg, p) are the parameters names, same as found in the

arch/powerpc/kernel/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ ifdef CONFIG_FUNCTION_TRACER
1717
CFLAGS_REMOVE_cputable.o = -pg -mno-sched-epilog
1818
CFLAGS_REMOVE_prom_init.o = -pg -mno-sched-epilog
1919
CFLAGS_REMOVE_btext.o = -pg -mno-sched-epilog
20+
CFLAGS_REMOVE_prom.o = -pg -mno-sched-epilog
2021

2122
ifdef CONFIG_DYNAMIC_FTRACE
2223
# dynamic ftrace setup.

arch/powerpc/kernel/entry_32.S

Lines changed: 9 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,39 +1162,17 @@ machine_check_in_rtas:
11621162
#ifdef CONFIG_DYNAMIC_FTRACE
11631163
_GLOBAL(mcount)
11641164
_GLOBAL(_mcount)
1165-
stwu r1,-48(r1)
1166-
stw r3, 12(r1)
1167-
stw r4, 16(r1)
1168-
stw r5, 20(r1)
1169-
stw r6, 24(r1)
1170-
mflr r3
1171-
stw r7, 28(r1)
1172-
mfcr r5
1173-
stw r8, 32(r1)
1174-
stw r9, 36(r1)
1175-
stw r10,40(r1)
1176-
stw r3, 44(r1)
1177-
stw r5, 8(r1)
1178-
subi r3, r3, MCOUNT_INSN_SIZE
1179-
.globl mcount_call
1180-
mcount_call:
1181-
bl ftrace_stub
1182-
nop
1183-
lwz r6, 8(r1)
1184-
lwz r0, 44(r1)
1185-
lwz r3, 12(r1)
1165+
/*
1166+
* It is required that _mcount on PPC32 must preserve the
1167+
* link register. But we have r0 to play with. We use r0
1168+
* to push the return address back to the caller of mcount
1169+
* into the ctr register, restore the link register and
1170+
* then jump back using the ctr register.
1171+
*/
1172+
mflr r0
11861173
mtctr r0
1187-
lwz r4, 16(r1)
1188-
mtcr r6
1189-
lwz r5, 20(r1)
1190-
lwz r6, 24(r1)
1191-
lwz r0, 52(r1)
1192-
lwz r7, 28(r1)
1193-
lwz r8, 32(r1)
1174+
lwz r0, 4(r1)
11941175
mtlr r0
1195-
lwz r9, 36(r1)
1196-
lwz r10,40(r1)
1197-
addi r1, r1, 48
11981176
bctr
11991177

12001178
_GLOBAL(ftrace_caller)

arch/powerpc/kernel/entry_64.S

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -888,18 +888,6 @@ _GLOBAL(enter_prom)
888888
#ifdef CONFIG_DYNAMIC_FTRACE
889889
_GLOBAL(mcount)
890890
_GLOBAL(_mcount)
891-
/* Taken from output of objdump from lib64/glibc */
892-
mflr r3
893-
stdu r1, -112(r1)
894-
std r3, 128(r1)
895-
subi r3, r3, MCOUNT_INSN_SIZE
896-
.globl mcount_call
897-
mcount_call:
898-
bl ftrace_stub
899-
nop
900-
ld r0, 128(r1)
901-
mtlr r0
902-
addi r1, r1, 112
903891
blr
904892

905893
_GLOBAL(ftrace_caller)

0 commit comments

Comments
 (0)