Skip to content

Commit b8c0aa4

Browse files
committed
Merge tag 'trace-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Pull tracing updates from Steven Rostedt: "This pull request has a lot of work done. The main thing is the changes to the ftrace function callback infrastructure. It's introducing a way to allow different functions to call directly different trampolines instead of all calling the same "mcount" one. The only user of this for now is the function graph tracer, which always had a different trampoline, but the function tracer trampoline was called and did basically nothing, and then the function graph tracer trampoline was called. The difference now, is that the function graph tracer trampoline can be called directly if a function is only being traced by the function graph trampoline. If function tracing is also happening on the same function, the old way is still done. The accounting for this takes up more memory when function graph tracing is activated, as it needs to keep track of which functions it uses. I have a new way that wont take as much memory, but it's not ready yet for this merge window, and will have to wait for the next one. Another big change was the removal of the ftrace_start/stop() calls that were used by the suspend/resume code that stopped function tracing when entering into suspend and resume paths. The stop of ftrace was done because there was some function that would crash the system if one called smp_processor_id()! The stop/start was a big hammer to solve the issue at the time, which was when ftrace was first introduced into Linux. Now ftrace has better infrastructure to debug such issues, and I found the problem function and labeled it with "notrace" and function tracing can now safely be activated all the way down into the guts of suspend and resume Other changes include clean ups of uprobe code, clean up of the trace_seq() code, and other various small fixes and clean ups to ftrace and tracing" * tag 'trace-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (57 commits) ftrace: Add warning if tramp hash does not match nr_trampolines ftrace: Fix trampoline hash update check on rec->flags ring-buffer: Use rb_page_size() instead of open coded head_page size ftrace: Rename ftrace_ops field from trampolines to nr_trampolines tracing: Convert local function_graph functions to static ftrace: Do not copy old hash when resetting tracing: let user specify tracing_thresh after selecting function_graph ring-buffer: Always run per-cpu ring buffer resize with schedule_work_on() tracing: Remove function_trace_stop and HAVE_FUNCTION_TRACE_MCOUNT_TEST s390/ftrace: remove check of obsolete variable function_trace_stop arm64, ftrace: Remove check of obsolete variable function_trace_stop Blackfin: ftrace: Remove check of obsolete variable function_trace_stop metag: ftrace: Remove check of obsolete variable function_trace_stop microblaze: ftrace: Remove check of obsolete variable function_trace_stop MIPS: ftrace: Remove check of obsolete variable function_trace_stop parisc: ftrace: Remove check of obsolete variable function_trace_stop sh: ftrace: Remove check of obsolete variable function_trace_stop sparc64,ftrace: Remove check of obsolete variable function_trace_stop tile: ftrace: Remove check of obsolete variable function_trace_stop ftrace: x86: Remove check of obsolete variable function_trace_stop ...
2 parents c7ed326 + dc6f03f commit b8c0aa4

50 files changed

Lines changed: 1032 additions & 693 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Documentation/kernel-parameters.txt‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,6 +1097,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
10971097
that can be changed at run time by the
10981098
set_graph_function file in the debugfs tracing directory.
10991099

1100+
ftrace_graph_notrace=[function-list]
1101+
[FTRACE] Do not trace from the functions specified in
1102+
function-list. This list is a comma separated list of
1103+
functions that can be changed at run time by the
1104+
set_graph_notrace file in the debugfs tracing directory.
1105+
11001106
gamecon.map[2|3]=
11011107
[HW,JOY] Multisystem joystick and NES/SNES/PSX pad
11021108
support via parallel port (up to 5 devices per port)

‎Documentation/trace/ftrace-design.txt‎

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -102,30 +102,6 @@ extern void mcount(void);
102102
EXPORT_SYMBOL(mcount);
103103

104104

105-
HAVE_FUNCTION_TRACE_MCOUNT_TEST
106-
-------------------------------
107-
108-
This is an optional optimization for the normal case when tracing is turned off
109-
in the system. If you do not enable this Kconfig option, the common ftrace
110-
code will take care of doing the checking for you.
111-
112-
To support this feature, you only need to check the function_trace_stop
113-
variable in the mcount function. If it is non-zero, there is no tracing to be
114-
done at all, so you can return.
115-
116-
This additional pseudo code would simply be:
117-
void mcount(void)
118-
{
119-
/* save any bare state needed in order to do initial checking */
120-
121-
+ if (function_trace_stop)
122-
+ return;
123-
124-
extern void (*ftrace_trace_function)(unsigned long, unsigned long);
125-
if (ftrace_trace_function != ftrace_stub)
126-
...
127-
128-
129105
HAVE_FUNCTION_GRAPH_TRACER
130106
--------------------------
131107

@@ -328,8 +304,6 @@ void mcount(void)
328304

329305
void ftrace_caller(void)
330306
{
331-
/* implement HAVE_FUNCTION_TRACE_MCOUNT_TEST if you desire */
332-
333307
/* save all state needed by the ABI (see paragraph above) */
334308

335309
unsigned long frompc = ...;

‎arch/arm64/kernel/entry-ftrace.S‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,6 @@
9696
* - ftrace_graph_caller to set up an exit hook
9797
*/
9898
ENTRY(_mcount)
99-
#ifdef CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST
100-
ldr x0, =ftrace_trace_stop
101-
ldr x0, [x0] // if ftrace_trace_stop
102-
ret // return;
103-
#endif
10499
mcount_enter
105100

106101
ldr x0, =ftrace_trace_function

‎arch/blackfin/Kconfig‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ config BLACKFIN
1818
select HAVE_FTRACE_MCOUNT_RECORD
1919
select HAVE_FUNCTION_GRAPH_TRACER
2020
select HAVE_FUNCTION_TRACER
21-
select HAVE_FUNCTION_TRACE_MCOUNT_TEST
2221
select HAVE_IDE
2322
select HAVE_KERNEL_GZIP if RAMKERNEL
2423
select HAVE_KERNEL_BZIP2 if RAMKERNEL

‎arch/blackfin/kernel/ftrace-entry.S‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,6 @@ ENDPROC(__mcount)
3333
* function will be waiting there. mmmm pie.
3434
*/
3535
ENTRY(_ftrace_caller)
36-
# ifdef CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST
37-
/* optional micro optimization: return if stopped */
38-
p1.l = _function_trace_stop;
39-
p1.h = _function_trace_stop;
40-
r3 = [p1];
41-
cc = r3 == 0;
42-
if ! cc jump _ftrace_stub (bp);
43-
# endif
44-
4536
/* save first/second/third function arg and the return register */
4637
[--sp] = r2;
4738
[--sp] = r0;
@@ -83,15 +74,6 @@ ENDPROC(_ftrace_caller)
8374

8475
/* See documentation for _ftrace_caller */
8576
ENTRY(__mcount)
86-
# ifdef CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST
87-
/* optional micro optimization: return if stopped */
88-
p1.l = _function_trace_stop;
89-
p1.h = _function_trace_stop;
90-
r3 = [p1];
91-
cc = r3 == 0;
92-
if ! cc jump _ftrace_stub (bp);
93-
# endif
94-
9577
/* save third function arg early so we can do testing below */
9678
[--sp] = r2;
9779

‎arch/metag/Kconfig‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ config METAG
1313
select HAVE_DYNAMIC_FTRACE
1414
select HAVE_FTRACE_MCOUNT_RECORD
1515
select HAVE_FUNCTION_TRACER
16-
select HAVE_FUNCTION_TRACE_MCOUNT_TEST
1716
select HAVE_KERNEL_BZIP2
1817
select HAVE_KERNEL_GZIP
1918
select HAVE_KERNEL_LZO

‎arch/metag/kernel/ftrace_stub.S‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,6 @@ _mcount_wrapper:
1616
.global _ftrace_caller
1717
.type _ftrace_caller,function
1818
_ftrace_caller:
19-
MOVT D0Re0,#HI(_function_trace_stop)
20-
ADD D0Re0,D0Re0,#LO(_function_trace_stop)
21-
GETD D0Re0,[D0Re0]
22-
CMP D0Re0,#0
23-
BEQ $Lcall_stub
24-
MOV PC,D0.4
25-
$Lcall_stub:
2619
MSETL [A0StP], D0Ar6, D0Ar4, D0Ar2, D0.4
2720
MOV D1Ar1, D0.4
2821
MOV D0Ar2, D1RtP
@@ -42,13 +35,6 @@ _ftrace_call:
4235
.global _mcount_wrapper
4336
.type _mcount_wrapper,function
4437
_mcount_wrapper:
45-
MOVT D0Re0,#HI(_function_trace_stop)
46-
ADD D0Re0,D0Re0,#LO(_function_trace_stop)
47-
GETD D0Re0,[D0Re0]
48-
CMP D0Re0,#0
49-
BEQ $Lcall_mcount
50-
MOV PC,D0.4
51-
$Lcall_mcount:
5238
MSETL [A0StP], D0Ar6, D0Ar4, D0Ar2, D0.4
5339
MOV D1Ar1, D0.4
5440
MOV D0Ar2, D1RtP

‎arch/microblaze/Kconfig‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ config MICROBLAZE
2222
select HAVE_DYNAMIC_FTRACE
2323
select HAVE_FTRACE_MCOUNT_RECORD
2424
select HAVE_FUNCTION_GRAPH_TRACER
25-
select HAVE_FUNCTION_TRACE_MCOUNT_TEST
2625
select HAVE_FUNCTION_TRACER
2726
select HAVE_MEMBLOCK
2827
select HAVE_MEMBLOCK_NODE_MAP

‎arch/microblaze/kernel/ftrace.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr)
2727
unsigned long return_hooker = (unsigned long)
2828
&return_to_handler;
2929

30+
if (unlikely(ftrace_graph_is_dead()))
31+
return;
32+
3033
if (unlikely(atomic_read(&current->tracing_graph_pause)))
3134
return;
3235

‎arch/microblaze/kernel/mcount.S‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,6 @@ ENTRY(ftrace_caller)
9191
#endif /* CONFIG_DYNAMIC_FTRACE */
9292
SAVE_REGS
9393
swi r15, r1, 0;
94-
/* MS: HAVE_FUNCTION_TRACE_MCOUNT_TEST begin of checking */
95-
lwi r5, r0, function_trace_stop;
96-
bneid r5, end;
97-
nop;
98-
/* MS: HAVE_FUNCTION_TRACE_MCOUNT_TEST end of checking */
9994
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
10095
#ifndef CONFIG_DYNAMIC_FTRACE
10196
lwi r5, r0, ftrace_graph_return;

0 commit comments

Comments
 (0)