aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>2013-07-12 16:50:28 -0400
committerSteven Rostedt <rostedt@goodmis.org>2013-07-29 17:07:49 -0400
commite66c33d579ea566d10e8c8695a7168aae3e02992 (patch)
treeb316d091004d823319afb6995539d4ad09386296 /kernel
parent102c9323c35a83789ad5ebd3c45fa8fb389add88 (diff)
rcu: Add const annotation to char * for RCU tracepoints and functions
All the RCU tracepoints and functions that reference char pointers do so with just 'char *' even though they do not modify the contents of the string itself. This will cause warnings if a const char * is used in one of these functions. The RCU tracepoints store the pointer to the string to refer back to them when the trace output is displayed. As this can be minutes, hours or even days later, those strings had better be constant. This change also opens the door to allow the RCU tracepoint strings and their addresses to be exported so that userspace tracing tools can translate the contents of the pointers of the RCU tracepoints. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/rcu.h2
-rw-r--r--kernel/rcupdate.c2
-rw-r--r--kernel/rcutiny.c2
-rw-r--r--kernel/rcutiny_plugin.h2
-rw-r--r--kernel/rcutorture.c8
-rw-r--r--kernel/rcutree.c4
-rw-r--r--kernel/rcutree.h2
7 files changed, 11 insertions, 11 deletions
diff --git a/kernel/rcu.h b/kernel/rcu.h
index 7f8e7590e3e5..0a90ccc65bfb 100644
--- a/kernel/rcu.h
+++ b/kernel/rcu.h
@@ -94,7 +94,7 @@ static inline void debug_rcu_head_unqueue(struct rcu_head *head)
94 94
95extern void kfree(const void *); 95extern void kfree(const void *);
96 96
97static inline bool __rcu_reclaim(char *rn, struct rcu_head *head) 97static inline bool __rcu_reclaim(const char *rn, struct rcu_head *head)
98{ 98{
99 unsigned long offset = (unsigned long)head->func; 99 unsigned long offset = (unsigned long)head->func;
100 100
diff --git a/kernel/rcupdate.c b/kernel/rcupdate.c
index cce6ba8bbace..14994d4e1a54 100644
--- a/kernel/rcupdate.c
+++ b/kernel/rcupdate.c
@@ -377,7 +377,7 @@ EXPORT_SYMBOL_GPL(rcuhead_debug_descr);
377#endif /* #ifdef CONFIG_DEBUG_OBJECTS_RCU_HEAD */ 377#endif /* #ifdef CONFIG_DEBUG_OBJECTS_RCU_HEAD */
378 378
379#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) || defined(CONFIG_RCU_TRACE) 379#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) || defined(CONFIG_RCU_TRACE)
380void do_trace_rcu_torture_read(char *rcutorturename, struct rcu_head *rhp, 380void do_trace_rcu_torture_read(const char *rcutorturename, struct rcu_head *rhp,
381 unsigned long secs, 381 unsigned long secs,
382 unsigned long c_old, unsigned long c) 382 unsigned long c_old, unsigned long c)
383{ 383{
diff --git a/kernel/rcutiny.c b/kernel/rcutiny.c
index aa344111de3e..9ed6075dc562 100644
--- a/kernel/rcutiny.c
+++ b/kernel/rcutiny.c
@@ -264,7 +264,7 @@ void rcu_check_callbacks(int cpu, int user)
264 */ 264 */
265static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp) 265static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp)
266{ 266{
267 char *rn = NULL; 267 const char *rn = NULL;
268 struct rcu_head *next, *list; 268 struct rcu_head *next, *list;
269 unsigned long flags; 269 unsigned long flags;
270 RCU_TRACE(int cb_count = 0); 270 RCU_TRACE(int cb_count = 0);
diff --git a/kernel/rcutiny_plugin.h b/kernel/rcutiny_plugin.h
index 0cd385acccfa..280d06cae352 100644
--- a/kernel/rcutiny_plugin.h
+++ b/kernel/rcutiny_plugin.h
@@ -36,7 +36,7 @@ struct rcu_ctrlblk {
36 RCU_TRACE(unsigned long gp_start); /* Start time for stalls. */ 36 RCU_TRACE(unsigned long gp_start); /* Start time for stalls. */
37 RCU_TRACE(unsigned long ticks_this_gp); /* Statistic for stalls. */ 37 RCU_TRACE(unsigned long ticks_this_gp); /* Statistic for stalls. */
38 RCU_TRACE(unsigned long jiffies_stall); /* Jiffies at next stall. */ 38 RCU_TRACE(unsigned long jiffies_stall); /* Jiffies at next stall. */
39 RCU_TRACE(char *name); /* Name of RCU type. */ 39 RCU_TRACE(const char *name); /* Name of RCU type. */
40}; 40};
41 41
42/* Definition for rcupdate control block. */ 42/* Definition for rcupdate control block. */
diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c
index f4871e52c546..3d936f0fbcd8 100644
--- a/kernel/rcutorture.c
+++ b/kernel/rcutorture.c
@@ -267,7 +267,7 @@ rcutorture_shutdown_notify(struct notifier_block *unused1,
267 * Absorb kthreads into a kernel function that won't return, so that 267 * Absorb kthreads into a kernel function that won't return, so that
268 * they won't ever access module text or data again. 268 * they won't ever access module text or data again.
269 */ 269 */
270static void rcutorture_shutdown_absorb(char *title) 270static void rcutorture_shutdown_absorb(const char *title)
271{ 271{
272 if (ACCESS_ONCE(fullstop) == FULLSTOP_SHUTDOWN) { 272 if (ACCESS_ONCE(fullstop) == FULLSTOP_SHUTDOWN) {
273 pr_notice( 273 pr_notice(
@@ -337,7 +337,7 @@ rcu_random(struct rcu_random_state *rrsp)
337} 337}
338 338
339static void 339static void
340rcu_stutter_wait(char *title) 340rcu_stutter_wait(const char *title)
341{ 341{
342 while (stutter_pause_test || !rcutorture_runnable) { 342 while (stutter_pause_test || !rcutorture_runnable) {
343 if (rcutorture_runnable) 343 if (rcutorture_runnable)
@@ -366,7 +366,7 @@ struct rcu_torture_ops {
366 int (*stats)(char *page); 366 int (*stats)(char *page);
367 int irq_capable; 367 int irq_capable;
368 int can_boost; 368 int can_boost;
369 char *name; 369 const char *name;
370}; 370};
371 371
372static struct rcu_torture_ops *cur_ops; 372static struct rcu_torture_ops *cur_ops;
@@ -1364,7 +1364,7 @@ rcu_torture_stutter(void *arg)
1364} 1364}
1365 1365
1366static inline void 1366static inline void
1367rcu_torture_print_module_parms(struct rcu_torture_ops *cur_ops, char *tag) 1367rcu_torture_print_module_parms(struct rcu_torture_ops *cur_ops, const char *tag)
1368{ 1368{
1369 pr_alert("%s" TORTURE_FLAG 1369 pr_alert("%s" TORTURE_FLAG
1370 "--- %s: nreaders=%d nfakewriters=%d " 1370 "--- %s: nreaders=%d nfakewriters=%d "
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 068de3a93606..30201494560b 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -1032,7 +1032,7 @@ static unsigned long rcu_cbs_completed(struct rcu_state *rsp,
1032 * rcu_nocb_wait_gp(). 1032 * rcu_nocb_wait_gp().
1033 */ 1033 */
1034static void trace_rcu_future_gp(struct rcu_node *rnp, struct rcu_data *rdp, 1034static void trace_rcu_future_gp(struct rcu_node *rnp, struct rcu_data *rdp,
1035 unsigned long c, char *s) 1035 unsigned long c, const char *s)
1036{ 1036{
1037 trace_rcu_future_grace_period(rdp->rsp->name, rnp->gpnum, 1037 trace_rcu_future_grace_period(rdp->rsp->name, rnp->gpnum,
1038 rnp->completed, c, rnp->level, 1038 rnp->completed, c, rnp->level,
@@ -2720,7 +2720,7 @@ static int rcu_cpu_has_callbacks(int cpu, bool *all_lazy)
2720 * Helper function for _rcu_barrier() tracing. If tracing is disabled, 2720 * Helper function for _rcu_barrier() tracing. If tracing is disabled,
2721 * the compiler is expected to optimize this away. 2721 * the compiler is expected to optimize this away.
2722 */ 2722 */
2723static void _rcu_barrier_trace(struct rcu_state *rsp, char *s, 2723static void _rcu_barrier_trace(struct rcu_state *rsp, const char *s,
2724 int cpu, unsigned long done) 2724 int cpu, unsigned long done)
2725{ 2725{
2726 trace_rcu_barrier(rsp->name, s, cpu, 2726 trace_rcu_barrier(rsp->name, s, cpu,
diff --git a/kernel/rcutree.h b/kernel/rcutree.h
index b3832581043c..cbdeac6cea9e 100644
--- a/kernel/rcutree.h
+++ b/kernel/rcutree.h
@@ -445,7 +445,7 @@ struct rcu_state {
445 /* for CPU stalls. */ 445 /* for CPU stalls. */
446 unsigned long gp_max; /* Maximum GP duration in */ 446 unsigned long gp_max; /* Maximum GP duration in */
447 /* jiffies. */ 447 /* jiffies. */
448 char *name; /* Name of structure. */ 448 const char *name; /* Name of structure. */
449 char abbr; /* Abbreviated name. */ 449 char abbr; /* Abbreviated name. */
450 struct list_head flavors; /* List of RCU flavors. */ 450 struct list_head flavors; /* List of RCU flavors. */
451 struct irq_work wakeup_work; /* Postponed wakeups */ 451 struct irq_work wakeup_work; /* Postponed wakeups */