]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
rcu: Ensure kernel/rcu/rcu.h can be sourced/used stand-alone
authorPaul Gortmaker <paul.gortmaker@windriver.com>
Wed, 19 Feb 2014 19:33:27 +0000 (14:33 -0500)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Wed, 26 Feb 2014 14:35:18 +0000 (06:35 -0800)
The kbuild test bot uncovered an implicit dependence on the
trace header being present before rcu.h in ia64 allmodconfig
that looks like this:

In file included from kernel/ksysfs.c:22:0:
kernel/rcu/rcu.h: In function '__rcu_reclaim':
kernel/rcu/rcu.h:107:3: error: implicit declaration of function 'trace_rcu_invoke_kfree_callback' [-Werror=implicit-function-declaration]
kernel/rcu/rcu.h:112:3: error: implicit declaration of function 'trace_rcu_invoke_callback' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors

Looking at other rcu.h users, we can find that they all
were sourcing the trace header in advance of rcu.h itself,
as seen in the context of this diff.  There were also some
inconsistencies as to whether it was or wasn't sourced based
on the parent tracing Kconfig.

Rather than "fix" it at each use site, and have inconsistent
use based on whether "#ifdef CONFIG_RCU_TRACE" was used or not,
lets just source the trace header just once, in the actual consumer
of it, which is rcu.h itself.  We include it unconditionally, as
build testing shows us that is a hard requirement for some files.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
kernel/rcu/rcu.h
kernel/rcu/srcu.c
kernel/rcu/tiny.c
kernel/rcu/tree.c
kernel/rcu/update.c

index af2e60a8425d1553d717ec93c69a7840eb05b3f4..bfda2726ca454112569433a85a9467a20f5d7a45 100644 (file)
@@ -23,6 +23,7 @@
 #ifndef __LINUX_RCU_H
 #define __LINUX_RCU_H
 
+#include <trace/events/rcu.h>
 #ifdef CONFIG_RCU_TRACE
 #define RCU_TRACE(stmt) stmt
 #else /* #ifdef CONFIG_RCU_TRACE */
index 2359779e1daac508ce21a09b6c01e85e32283952..c639556f3fa06234dcc34517826fbf0420641e56 100644 (file)
@@ -36,8 +36,6 @@
 #include <linux/delay.h>
 #include <linux/srcu.h>
 
-#include <trace/events/rcu.h>
-
 #include "rcu.h"
 
 /*
index 53b95bbf4abb8bb76759438a2081d16d5cf46f6c..d9efcc13008c00201c130f87135348c7238118ff 100644 (file)
 #include <linux/prefetch.h>
 #include <linux/ftrace_event.h>
 
-#ifdef CONFIG_RCU_TRACE
-#include <trace/events/rcu.h>
-#endif /* #else #ifdef CONFIG_RCU_TRACE */
-
 #include "rcu.h"
 
 /* Forward declarations for tiny_plugin.h. */
index 73c3cd2b87ac5fefd498eead7e981d4739029df5..c7ed5db2dd79fe9de34b44bb0e70f19a4a4fa615 100644 (file)
@@ -58,8 +58,6 @@
 #include <linux/suspend.h>
 
 #include "tree.h"
-#include <trace/events/rcu.h>
-
 #include "rcu.h"
 
 MODULE_ALIAS("rcutree");
index fd0d5b5b8e7cd00025304bf54eb785f7e2210f18..4c0a9b0af469a1f5fa3242d594653fee0f004505 100644 (file)
@@ -49,7 +49,6 @@
 #include <linux/module.h>
 
 #define CREATE_TRACE_POINTS
-#include <trace/events/rcu.h>
 
 #include "rcu.h"