Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5cb5c6e1 authored by Paul Gortmaker's avatar Paul Gortmaker Committed by Paul E. McKenney
Browse files

rcu: Ensure kernel/rcu/rcu.h can be sourced/used stand-alone



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: default avatarkbuild test robot <fengguang.wu@intel.com>
Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
parent 7a754743
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -23,6 +23,7 @@
#ifndef __LINUX_RCU_H
#ifndef __LINUX_RCU_H
#define __LINUX_RCU_H
#define __LINUX_RCU_H


#include <trace/events/rcu.h>
#ifdef CONFIG_RCU_TRACE
#ifdef CONFIG_RCU_TRACE
#define RCU_TRACE(stmt) stmt
#define RCU_TRACE(stmt) stmt
#else /* #ifdef CONFIG_RCU_TRACE */
#else /* #ifdef CONFIG_RCU_TRACE */
+0 −2
Original line number Original line Diff line number Diff line
@@ -36,8 +36,6 @@
#include <linux/delay.h>
#include <linux/delay.h>
#include <linux/srcu.h>
#include <linux/srcu.h>


#include <trace/events/rcu.h>

#include "rcu.h"
#include "rcu.h"


/*
/*
+0 −4
Original line number Original line Diff line number Diff line
@@ -37,10 +37,6 @@
#include <linux/prefetch.h>
#include <linux/prefetch.h>
#include <linux/ftrace_event.h>
#include <linux/ftrace_event.h>


#ifdef CONFIG_RCU_TRACE
#include <trace/events/rcu.h>
#endif /* #else #ifdef CONFIG_RCU_TRACE */

#include "rcu.h"
#include "rcu.h"


/* Forward declarations for tiny_plugin.h. */
/* Forward declarations for tiny_plugin.h. */
+0 −2
Original line number Original line Diff line number Diff line
@@ -58,8 +58,6 @@
#include <linux/suspend.h>
#include <linux/suspend.h>


#include "tree.h"
#include "tree.h"
#include <trace/events/rcu.h>

#include "rcu.h"
#include "rcu.h"


MODULE_ALIAS("rcutree");
MODULE_ALIAS("rcutree");
+0 −1
Original line number Original line Diff line number Diff line
@@ -49,7 +49,6 @@
#include <linux/module.h>
#include <linux/module.h>


#define CREATE_TRACE_POINTS
#define CREATE_TRACE_POINTS
#include <trace/events/rcu.h>


#include "rcu.h"
#include "rcu.h"