diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-03-07 12:37:28 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-03-07 12:37:28 -0500 |
commit | f26db9649af36b8eb76850108113d4056f494537 (patch) | |
tree | c465767c8112cf5ebc7eb30ba9f19a770906560c | |
parent | c1ae3cfa0e89fa1a7ecc4c99031f5e9ae99d9201 (diff) | |
parent | 65a50c656276b0846bea09dd011c0a3d35b77f3e (diff) |
Merge tag 'trace-v4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Pull tracing fixes from Steven Rostedt:
"There was some breakage with the changes for jump labels in the 4.11
merge window:
- powerpc broke as jump labels uses the two LSB bits as flags in
initialization.
A check was added to make sure that all jump label entries were 4
bytes aligned, but powerpc didn't work that way for modules. Adding
an alignment in the module linker script appeared to be the best
solution.
- Jump labels also added an anonymous union to access those LSB bits
as a normal long. But because this structure had static
initialization, it broke older compilers that could not statically
initialize anonymous unions without brackets.
- The command line parameter for setting function graph filter broke
the "EMPTY_HASH" descriptor by modifying it instead of creating a
new hash to hold the entries.
- The command line parameter ftrace_graph_max_depth was added to
allow its setting at boot time. It uses existing code and only the
command line hook was added.
This is not really a fix, but as it uses existing code without
affecting anything else, I added it to this release. It was ready
before the merge window closed, but I wanted to let it sit in
linux-next for a couple of days first"
* tag 'trace-v4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
ftrace/graph: Add ftrace_graph_max_depth kernel parameter
tracing: Add #undef to fix compile error
jump_label: Add comment about initialization order for anonymous unions
jump_label: Fix anonymous union initialization
module: set __jump_table alignment to 8
ftrace/graph: Do not modify the EMPTY_HASH for the function_graph filter
tracing: Fix code comment for ftrace_ops_get_func()
-rw-r--r-- | Documentation/admin-guide/kernel-parameters.txt | 6 | ||||
-rw-r--r-- | include/linux/jump_label.h | 11 | ||||
-rw-r--r-- | include/trace/events/syscalls.h | 1 | ||||
-rw-r--r-- | kernel/trace/ftrace.c | 23 | ||||
-rw-r--r-- | scripts/module-common.lds | 2 |
5 files changed, 36 insertions, 7 deletions
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 986e44387dad..9adcc803b9a5 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt | |||
@@ -1183,6 +1183,12 @@ | |||
1183 | functions that can be changed at run time by the | 1183 | functions that can be changed at run time by the |
1184 | set_graph_notrace file in the debugfs tracing directory. | 1184 | set_graph_notrace file in the debugfs tracing directory. |
1185 | 1185 | ||
1186 | ftrace_graph_max_depth=<uint> | ||
1187 | [FTRACE] Used with the function graph tracer. This is | ||
1188 | the max depth it will trace into a function. This value | ||
1189 | can be changed at run time by the max_graph_depth file | ||
1190 | in the tracefs tracing directory. default: 0 (no limit) | ||
1191 | |||
1186 | gamecon.map[2|3]= | 1192 | gamecon.map[2|3]= |
1187 | [HW,JOY] Multisystem joystick and NES/SNES/PSX pad | 1193 | [HW,JOY] Multisystem joystick and NES/SNES/PSX pad |
1188 | support via parallel port (up to 5 devices per port) | 1194 | support via parallel port (up to 5 devices per port) |
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h index 8e06d758ee48..2afd74b9d844 100644 --- a/include/linux/jump_label.h +++ b/include/linux/jump_label.h | |||
@@ -90,6 +90,13 @@ extern bool static_key_initialized; | |||
90 | struct static_key { | 90 | struct static_key { |
91 | atomic_t enabled; | 91 | atomic_t enabled; |
92 | /* | 92 | /* |
93 | * Note: | ||
94 | * To make anonymous unions work with old compilers, the static | ||
95 | * initialization of them requires brackets. This creates a dependency | ||
96 | * on the order of the struct with the initializers. If any fields | ||
97 | * are added, STATIC_KEY_INIT_TRUE and STATIC_KEY_INIT_FALSE may need | ||
98 | * to be modified. | ||
99 | * | ||
93 | * bit 0 => 1 if key is initially true | 100 | * bit 0 => 1 if key is initially true |
94 | * 0 if initially false | 101 | * 0 if initially false |
95 | * bit 1 => 1 if points to struct static_key_mod | 102 | * bit 1 => 1 if points to struct static_key_mod |
@@ -166,10 +173,10 @@ extern void static_key_disable(struct static_key *key); | |||
166 | */ | 173 | */ |
167 | #define STATIC_KEY_INIT_TRUE \ | 174 | #define STATIC_KEY_INIT_TRUE \ |
168 | { .enabled = { 1 }, \ | 175 | { .enabled = { 1 }, \ |
169 | .entries = (void *)JUMP_TYPE_TRUE } | 176 | { .entries = (void *)JUMP_TYPE_TRUE } } |
170 | #define STATIC_KEY_INIT_FALSE \ | 177 | #define STATIC_KEY_INIT_FALSE \ |
171 | { .enabled = { 0 }, \ | 178 | { .enabled = { 0 }, \ |
172 | .entries = (void *)JUMP_TYPE_FALSE } | 179 | { .entries = (void *)JUMP_TYPE_FALSE } } |
173 | 180 | ||
174 | #else /* !HAVE_JUMP_LABEL */ | 181 | #else /* !HAVE_JUMP_LABEL */ |
175 | 182 | ||
diff --git a/include/trace/events/syscalls.h b/include/trace/events/syscalls.h index 14e49c798135..b35533b94277 100644 --- a/include/trace/events/syscalls.h +++ b/include/trace/events/syscalls.h | |||
@@ -1,5 +1,6 @@ | |||
1 | #undef TRACE_SYSTEM | 1 | #undef TRACE_SYSTEM |
2 | #define TRACE_SYSTEM raw_syscalls | 2 | #define TRACE_SYSTEM raw_syscalls |
3 | #undef TRACE_INCLUDE_FILE | ||
3 | #define TRACE_INCLUDE_FILE syscalls | 4 | #define TRACE_INCLUDE_FILE syscalls |
4 | 5 | ||
5 | #if !defined(_TRACE_EVENTS_SYSCALLS_H) || defined(TRACE_HEADER_MULTI_READ) | 6 | #if !defined(_TRACE_EVENTS_SYSCALLS_H) || defined(TRACE_HEADER_MULTI_READ) |
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 0d1597c9ee30..b9691ee8f6c1 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -4416,16 +4416,24 @@ static int __init set_graph_notrace_function(char *str) | |||
4416 | } | 4416 | } |
4417 | __setup("ftrace_graph_notrace=", set_graph_notrace_function); | 4417 | __setup("ftrace_graph_notrace=", set_graph_notrace_function); |
4418 | 4418 | ||
4419 | static int __init set_graph_max_depth_function(char *str) | ||
4420 | { | ||
4421 | if (!str) | ||
4422 | return 0; | ||
4423 | fgraph_max_depth = simple_strtoul(str, NULL, 0); | ||
4424 | return 1; | ||
4425 | } | ||
4426 | __setup("ftrace_graph_max_depth=", set_graph_max_depth_function); | ||
4427 | |||
4419 | static void __init set_ftrace_early_graph(char *buf, int enable) | 4428 | static void __init set_ftrace_early_graph(char *buf, int enable) |
4420 | { | 4429 | { |
4421 | int ret; | 4430 | int ret; |
4422 | char *func; | 4431 | char *func; |
4423 | struct ftrace_hash *hash; | 4432 | struct ftrace_hash *hash; |
4424 | 4433 | ||
4425 | if (enable) | 4434 | hash = alloc_ftrace_hash(FTRACE_HASH_DEFAULT_BITS); |
4426 | hash = ftrace_graph_hash; | 4435 | if (WARN_ON(!hash)) |
4427 | else | 4436 | return; |
4428 | hash = ftrace_graph_notrace_hash; | ||
4429 | 4437 | ||
4430 | while (buf) { | 4438 | while (buf) { |
4431 | func = strsep(&buf, ","); | 4439 | func = strsep(&buf, ","); |
@@ -4435,6 +4443,11 @@ static void __init set_ftrace_early_graph(char *buf, int enable) | |||
4435 | printk(KERN_DEBUG "ftrace: function %s not " | 4443 | printk(KERN_DEBUG "ftrace: function %s not " |
4436 | "traceable\n", func); | 4444 | "traceable\n", func); |
4437 | } | 4445 | } |
4446 | |||
4447 | if (enable) | ||
4448 | ftrace_graph_hash = hash; | ||
4449 | else | ||
4450 | ftrace_graph_notrace_hash = hash; | ||
4438 | } | 4451 | } |
4439 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ | 4452 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ |
4440 | 4453 | ||
@@ -5488,7 +5501,7 @@ static void ftrace_ops_assist_func(unsigned long ip, unsigned long parent_ip, | |||
5488 | * Normally the mcount trampoline will call the ops->func, but there | 5501 | * Normally the mcount trampoline will call the ops->func, but there |
5489 | * are times that it should not. For example, if the ops does not | 5502 | * are times that it should not. For example, if the ops does not |
5490 | * have its own recursion protection, then it should call the | 5503 | * have its own recursion protection, then it should call the |
5491 | * ftrace_ops_recurs_func() instead. | 5504 | * ftrace_ops_assist_func() instead. |
5492 | * | 5505 | * |
5493 | * Returns the function that the trampoline should call for @ops. | 5506 | * Returns the function that the trampoline should call for @ops. |
5494 | */ | 5507 | */ |
diff --git a/scripts/module-common.lds b/scripts/module-common.lds index cf7e52e4781b..9b6e246a45d0 100644 --- a/scripts/module-common.lds +++ b/scripts/module-common.lds | |||
@@ -22,4 +22,6 @@ SECTIONS { | |||
22 | 22 | ||
23 | . = ALIGN(8); | 23 | . = ALIGN(8); |
24 | .init_array 0 : { *(SORT(.init_array.*)) *(.init_array) } | 24 | .init_array 0 : { *(SORT(.init_array.*)) *(.init_array) } |
25 | |||
26 | __jump_table 0 : ALIGN(8) { KEEP(*(__jump_table)) } | ||
25 | } | 27 | } |