Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1592015 > unrolled thread

[for-next][PATCH 0/7] tracing: Fixes for 4.11

Started bySteven Rostedt <rostedt@goodmis.org>
First post2017-03-03 15:50 +0100
Last post2017-03-03 15:50 +0100
Articles 6 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [for-next][PATCH 0/7] tracing: Fixes for 4.11 Steven Rostedt <rostedt@goodmis.org> - 2017-03-03 15:50 +0100
    [for-next][PATCH 5/7] jump_label: Add comment about initialization order for anonymous  unions Steven Rostedt <rostedt@goodmis.org> - 2017-03-03 15:50 +0100
    [for-next][PATCH 2/7] ftrace/graph: Do not modify the EMPTY_HASH for the function_graph  filter Steven Rostedt <rostedt@goodmis.org> - 2017-03-03 15:50 +0100
    [for-next][PATCH 7/7] ftrace/graph: Add ftrace_graph_max_depth kernel parameter Steven Rostedt <rostedt@goodmis.org> - 2017-03-03 15:50 +0100
    [for-next][PATCH 1/7] tracing: Fix code comment for ftrace_ops_get_func() Steven Rostedt <rostedt@goodmis.org> - 2017-03-03 15:50 +0100
    [for-next][PATCH 3/7] module: set __jump_table alignment to 8 Steven Rostedt <rostedt@goodmis.org> - 2017-03-03 15:50 +0100

#1592015 — [for-next][PATCH 0/7] tracing: Fixes for 4.11

FromSteven Rostedt <rostedt@goodmis.org>
Date2017-03-03 15:50 +0100
Subject[for-next][PATCH 0/7] tracing: Fixes for 4.11
Message-ID<tgWGR-2zu-5@gated-at.bofh.it>
  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
for-next

Head SHA1: 65a50c656276b0846bea09dd011c0a3d35b77f3e


Boris Ostrovsky (1):
      jump_label: Fix anonymous union initialization

Chunyu Hu (1):
      tracing: Fix code comment for ftrace_ops_get_func()

David Daney (1):
      module: set __jump_table alignment to 8

Rik van Riel (1):
      tracing: Add #undef to fix compile error

Steven Rostedt (VMware) (2):
      ftrace/graph: Do not modify the EMPTY_HASH for the function_graph filter
      jump_label: Add comment about initialization order for anonymous unions

Todd Brandt (1):
      ftrace/graph: Add ftrace_graph_max_depth kernel parameter

----
 Documentation/admin-guide/kernel-parameters.txt |  6 ++++++
 include/linux/jump_label.h                      | 11 +++++++++--
 include/trace/events/syscalls.h                 |  1 +
 kernel/trace/ftrace.c                           | 23 ++++++++++++++++++-----
 scripts/module-common.lds                       |  2 ++
 5 files changed, 36 insertions(+), 7 deletions(-)

[toc] | [next] | [standalone]


#1592017 — [for-next][PATCH 5/7] jump_label: Add comment about initialization order for anonymous unions

FromSteven Rostedt <rostedt@goodmis.org>
Date2017-03-03 15:50 +0100
Subject[for-next][PATCH 5/7] jump_label: Add comment about initialization order for anonymous unions
Message-ID<tgWGS-2zu-15@gated-at.bofh.it>
In reply to#1592015
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

Commit 3821fd35b58d ("jump_label: Reduce the size of struct static_key")
broke old compilers that could not handle static initialization of anonymous
unions. Boris fixed it with a patch that added brackets around the static
initializer. But this creates a dependency between those initializers and
the structure's order of its fields. Document this dependency in case new
fields are added to struct static_key in the future.

Noted-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Suggested-by: Chris Mason <clm@fb.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 include/linux/jump_label.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
index a7f90117cf7d..28e04a33535a 100644
--- a/include/linux/jump_label.h
+++ b/include/linux/jump_label.h
@@ -90,6 +90,13 @@ extern bool static_key_initialized;
 struct static_key {
 	atomic_t enabled;
 /*
+ * Note:
+ *   To make anonymous unions work with old compilers, the static
+ *   initialization of them requires brackets. This creates a dependency
+ *   on the order of the struct with the initializers. If any fields
+ *   are added, STATIC_KEY_INIT_TRUE and STATIC_KEY_INIT_FALSE may need
+ *   to be modified.
+ *
  * bit 0 => 1 if key is initially true
  *	    0 if initially false
  * bit 1 => 1 if points to struct static_key_mod
-- 
2.10.2

[toc] | [prev] | [next] | [standalone]


#1592018 — [for-next][PATCH 2/7] ftrace/graph: Do not modify the EMPTY_HASH for the function_graph filter

FromSteven Rostedt <rostedt@goodmis.org>
Date2017-03-03 15:50 +0100
Subject[for-next][PATCH 2/7] ftrace/graph: Do not modify the EMPTY_HASH for the function_graph filter
Message-ID<tgWGS-2zu-17@gated-at.bofh.it>
In reply to#1592015
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

On boot up, if the kernel command line sets a graph funtion with the kernel
command line options "ftrace_graph_filter" or "ftrace_graph_notrace" then it
updates the corresponding function graph hash, ftrace_graph_hash or
ftrace_graph_notrace_hash respectively. Unfortunately, at boot up, these
variables are pointers to the "EMPTY_HASH" which is a constant used as a
placeholder when a hash has no entities. The problem was that the comand
line version to set the hashes updated the actual EMPTY_HASH instead of
creating a new hash for the function graph. This broke the EMPTY_HASH
because not only did it modify a constant (not sure how that was allowed to
happen, except maybe because it was done at early boot, const variables were
still mutable), but it made the filters have functions listed in them when
they were actually empty.

The kernel command line function needs to allocate a new hash for the
function graph filters and assign the necessary variables to that new hash
instead.

Link: http://lkml.kernel.org/r/1488420091.7212.17.camel@linux.intel.com

Cc: Namhyung Kim <namhyung@kernel.org>
Fixes: b9b0c831bed2 ("ftrace: Convert graph filter to use hash tables")
Reported-by: Todd Brandt <todd.e.brandt@linux.intel.com>
Tested-by: Todd Brandt <todd.e.brandt@linux.intel.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 kernel/trace/ftrace.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index fd84f2e30b6d..44122e7a6418 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -4421,10 +4421,9 @@ static void __init set_ftrace_early_graph(char *buf, int enable)
 	char *func;
 	struct ftrace_hash *hash;
 
-	if (enable)
-		hash = ftrace_graph_hash;
-	else
-		hash = ftrace_graph_notrace_hash;
+	hash = alloc_ftrace_hash(FTRACE_HASH_DEFAULT_BITS);
+	if (WARN_ON(!hash))
+		return;
 
 	while (buf) {
 		func = strsep(&buf, ",");
@@ -4434,6 +4433,11 @@ static void __init set_ftrace_early_graph(char *buf, int enable)
 			printk(KERN_DEBUG "ftrace: function %s not "
 					  "traceable\n", func);
 	}
+
+	if (enable)
+		ftrace_graph_hash = hash;
+	else
+		ftrace_graph_notrace_hash = hash;
 }
 #endif /* CONFIG_FUNCTION_GRAPH_TRACER */
 
-- 
2.10.2

[toc] | [prev] | [next] | [standalone]


#1592019 — [for-next][PATCH 7/7] ftrace/graph: Add ftrace_graph_max_depth kernel parameter

FromSteven Rostedt <rostedt@goodmis.org>
Date2017-03-03 15:50 +0100
Subject[for-next][PATCH 7/7] ftrace/graph: Add ftrace_graph_max_depth kernel parameter
Message-ID<tgWGS-2zu-21@gated-at.bofh.it>
In reply to#1592015
From: Todd Brandt <todd.e.brandt@linux.intel.com>

Early trace callgraphs can be extremely large on systems with
several seconds of boot time. The max_depth parameter limits how
deep the graph trace goes and reduces the output size. This
parameter is the same as the max_graph_depth file in tracefs.

Link: http://lkml.kernel.org/r/1488499935-23216-1-git-send-email-todd.e.brandt@linux.intel.com

Signed-off-by: Todd Brandt <todd.e.brandt@linux.intel.com>
[ changed comments about debugfs to tracefs ]
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 Documentation/admin-guide/kernel-parameters.txt | 6 ++++++
 kernel/trace/ftrace.c                           | 9 +++++++++
 2 files changed, 15 insertions(+)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 21e2d8863705..1c9016b27ee9 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -1173,6 +1173,12 @@
 			functions that can be changed at run time by the
 			set_graph_notrace file in the debugfs tracing directory.
 
+	ftrace_graph_max_depth=<uint>
+			[FTRACE] Used with the function graph tracer. This is
+			the max depth it will trace into a function. This value
+			can be changed at run time by the max_graph_depth file
+			in the tracefs tracing directory. default: 0 (no limit)
+
 	gamecon.map[2|3]=
 			[HW,JOY] Multisystem joystick and NES/SNES/PSX pad
 			support via parallel port (up to 5 devices per port)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 44122e7a6418..d129ae51329a 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -4415,6 +4415,15 @@ static int __init set_graph_notrace_function(char *str)
 }
 __setup("ftrace_graph_notrace=", set_graph_notrace_function);
 
+static int __init set_graph_max_depth_function(char *str)
+{
+	if (!str)
+		return 0;
+	fgraph_max_depth = simple_strtoul(str, NULL, 0);
+	return 1;
+}
+__setup("ftrace_graph_max_depth=", set_graph_max_depth_function);
+
 static void __init set_ftrace_early_graph(char *buf, int enable)
 {
 	int ret;
-- 
2.10.2

[toc] | [prev] | [next] | [standalone]


#1592020 — [for-next][PATCH 1/7] tracing: Fix code comment for ftrace_ops_get_func()

FromSteven Rostedt <rostedt@goodmis.org>
Date2017-03-03 15:50 +0100
Subject[for-next][PATCH 1/7] tracing: Fix code comment for ftrace_ops_get_func()
Message-ID<tgWGS-2zu-27@gated-at.bofh.it>
In reply to#1592015
From: Chunyu Hu <chuhu@redhat.com>

There is no function 'ftrace_ops_recurs_func' existing in the current code,
it was renamed to ftrace_ops_assist_func() in commit c68c0fa29341
("ftrace: Have ftrace_ops_get_func() handle RCU and PER_CPU flags too").
Update the comment to the correct function name.

Link: http://lkml.kernel.org/r/1487723366-14463-1-git-send-email-chuhu@redhat.com

Signed-off-by: Chunyu Hu <chuhu@redhat.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 kernel/trace/ftrace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 0c0609326391..fd84f2e30b6d 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -5487,7 +5487,7 @@ static void ftrace_ops_assist_func(unsigned long ip, unsigned long parent_ip,
  * Normally the mcount trampoline will call the ops->func, but there
  * are times that it should not. For example, if the ops does not
  * have its own recursion protection, then it should call the
- * ftrace_ops_recurs_func() instead.
+ * ftrace_ops_assist_func() instead.
  *
  * Returns the function that the trampoline should call for @ops.
  */
-- 
2.10.2

[toc] | [prev] | [next] | [standalone]


#1592021 — [for-next][PATCH 3/7] module: set __jump_table alignment to 8

FromSteven Rostedt <rostedt@goodmis.org>
Date2017-03-03 15:50 +0100
Subject[for-next][PATCH 3/7] module: set __jump_table alignment to 8
Message-ID<tgWGS-2zu-29@gated-at.bofh.it>
In reply to#1592015
From: David Daney <david.daney@cavium.com>

For powerpc the __jump_table section in modules is not aligned, this
causes a WARN_ON() splat when loading a module containing a __jump_table.

Strict alignment became necessary with commit 3821fd35b58d
("jump_label: Reduce the size of struct static_key"), currently in
linux-next, which uses the two least significant bits of pointers to
__jump_table elements.

Fix by forcing __jump_table to 8, which is the same alignment used for
this section in the kernel proper.

Link: http://lkml.kernel.org/r/20170301220453.4756-1-david.daney@cavium.com

Reviewed-by: Jason Baron <jbaron@akamai.com>
Acked-by: Jessica Yu <jeyu@redhat.com>
Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
Tested-by: Sachin Sant <sachinp@linux.vnet.ibm.com>
Signed-off-by: David Daney <david.daney@cavium.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 scripts/module-common.lds | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/module-common.lds b/scripts/module-common.lds
index 73a2c7da0e55..53234e85192a 100644
--- a/scripts/module-common.lds
+++ b/scripts/module-common.lds
@@ -19,4 +19,6 @@ SECTIONS {
 
 	. = ALIGN(8);
 	.init_array		0 : { *(SORT(.init_array.*)) *(.init_array) }
+
+	__jump_table		0 : ALIGN(8) { KEEP(*(__jump_table)) }
 }
-- 
2.10.2

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web