diff options
author | Steven Rostedt (Red Hat) <rostedt@goodmis.org> | 2013-07-12 16:50:28 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2013-07-29 17:07:49 -0400 |
commit | e66c33d579ea566d10e8c8695a7168aae3e02992 (patch) | |
tree | b316d091004d823319afb6995539d4ad09386296 /include | |
parent | 102c9323c35a83789ad5ebd3c45fa8fb389add88 (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 'include')
-rw-r--r-- | include/linux/rcupdate.h | 4 | ||||
-rw-r--r-- | include/trace/events/rcu.h | 82 |
2 files changed, 43 insertions, 43 deletions
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 4b14bdc911d7..0c38abbe6e35 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -52,7 +52,7 @@ extern int rcutorture_runnable; /* for sysctl */ | |||
52 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) | 52 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) |
53 | extern void rcutorture_record_test_transition(void); | 53 | extern void rcutorture_record_test_transition(void); |
54 | extern void rcutorture_record_progress(unsigned long vernum); | 54 | extern void rcutorture_record_progress(unsigned long vernum); |
55 | extern void do_trace_rcu_torture_read(char *rcutorturename, | 55 | extern void do_trace_rcu_torture_read(const char *rcutorturename, |
56 | struct rcu_head *rhp, | 56 | struct rcu_head *rhp, |
57 | unsigned long secs, | 57 | unsigned long secs, |
58 | unsigned long c_old, | 58 | unsigned long c_old, |
@@ -65,7 +65,7 @@ static inline void rcutorture_record_progress(unsigned long vernum) | |||
65 | { | 65 | { |
66 | } | 66 | } |
67 | #ifdef CONFIG_RCU_TRACE | 67 | #ifdef CONFIG_RCU_TRACE |
68 | extern void do_trace_rcu_torture_read(char *rcutorturename, | 68 | extern void do_trace_rcu_torture_read(const char *rcutorturename, |
69 | struct rcu_head *rhp, | 69 | struct rcu_head *rhp, |
70 | unsigned long secs, | 70 | unsigned long secs, |
71 | unsigned long c_old, | 71 | unsigned long c_old, |
diff --git a/include/trace/events/rcu.h b/include/trace/events/rcu.h index 59ebcc89f148..ee2376cfaab3 100644 --- a/include/trace/events/rcu.h +++ b/include/trace/events/rcu.h | |||
@@ -19,12 +19,12 @@ | |||
19 | */ | 19 | */ |
20 | TRACE_EVENT(rcu_utilization, | 20 | TRACE_EVENT(rcu_utilization, |
21 | 21 | ||
22 | TP_PROTO(char *s), | 22 | TP_PROTO(const char *s), |
23 | 23 | ||
24 | TP_ARGS(s), | 24 | TP_ARGS(s), |
25 | 25 | ||
26 | TP_STRUCT__entry( | 26 | TP_STRUCT__entry( |
27 | __field(char *, s) | 27 | __field(const char *, s) |
28 | ), | 28 | ), |
29 | 29 | ||
30 | TP_fast_assign( | 30 | TP_fast_assign( |
@@ -51,14 +51,14 @@ TRACE_EVENT(rcu_utilization, | |||
51 | */ | 51 | */ |
52 | TRACE_EVENT(rcu_grace_period, | 52 | TRACE_EVENT(rcu_grace_period, |
53 | 53 | ||
54 | TP_PROTO(char *rcuname, unsigned long gpnum, char *gpevent), | 54 | TP_PROTO(const char *rcuname, unsigned long gpnum, const char *gpevent), |
55 | 55 | ||
56 | TP_ARGS(rcuname, gpnum, gpevent), | 56 | TP_ARGS(rcuname, gpnum, gpevent), |
57 | 57 | ||
58 | TP_STRUCT__entry( | 58 | TP_STRUCT__entry( |
59 | __field(char *, rcuname) | 59 | __field(const char *, rcuname) |
60 | __field(unsigned long, gpnum) | 60 | __field(unsigned long, gpnum) |
61 | __field(char *, gpevent) | 61 | __field(const char *, gpevent) |
62 | ), | 62 | ), |
63 | 63 | ||
64 | TP_fast_assign( | 64 | TP_fast_assign( |
@@ -89,21 +89,21 @@ TRACE_EVENT(rcu_grace_period, | |||
89 | */ | 89 | */ |
90 | TRACE_EVENT(rcu_future_grace_period, | 90 | TRACE_EVENT(rcu_future_grace_period, |
91 | 91 | ||
92 | TP_PROTO(char *rcuname, unsigned long gpnum, unsigned long completed, | 92 | TP_PROTO(const char *rcuname, unsigned long gpnum, unsigned long completed, |
93 | unsigned long c, u8 level, int grplo, int grphi, | 93 | unsigned long c, u8 level, int grplo, int grphi, |
94 | char *gpevent), | 94 | const char *gpevent), |
95 | 95 | ||
96 | TP_ARGS(rcuname, gpnum, completed, c, level, grplo, grphi, gpevent), | 96 | TP_ARGS(rcuname, gpnum, completed, c, level, grplo, grphi, gpevent), |
97 | 97 | ||
98 | TP_STRUCT__entry( | 98 | TP_STRUCT__entry( |
99 | __field(char *, rcuname) | 99 | __field(const char *, rcuname) |
100 | __field(unsigned long, gpnum) | 100 | __field(unsigned long, gpnum) |
101 | __field(unsigned long, completed) | 101 | __field(unsigned long, completed) |
102 | __field(unsigned long, c) | 102 | __field(unsigned long, c) |
103 | __field(u8, level) | 103 | __field(u8, level) |
104 | __field(int, grplo) | 104 | __field(int, grplo) |
105 | __field(int, grphi) | 105 | __field(int, grphi) |
106 | __field(char *, gpevent) | 106 | __field(const char *, gpevent) |
107 | ), | 107 | ), |
108 | 108 | ||
109 | TP_fast_assign( | 109 | TP_fast_assign( |
@@ -132,13 +132,13 @@ TRACE_EVENT(rcu_future_grace_period, | |||
132 | */ | 132 | */ |
133 | TRACE_EVENT(rcu_grace_period_init, | 133 | TRACE_EVENT(rcu_grace_period_init, |
134 | 134 | ||
135 | TP_PROTO(char *rcuname, unsigned long gpnum, u8 level, | 135 | TP_PROTO(const char *rcuname, unsigned long gpnum, u8 level, |
136 | int grplo, int grphi, unsigned long qsmask), | 136 | int grplo, int grphi, unsigned long qsmask), |
137 | 137 | ||
138 | TP_ARGS(rcuname, gpnum, level, grplo, grphi, qsmask), | 138 | TP_ARGS(rcuname, gpnum, level, grplo, grphi, qsmask), |
139 | 139 | ||
140 | TP_STRUCT__entry( | 140 | TP_STRUCT__entry( |
141 | __field(char *, rcuname) | 141 | __field(const char *, rcuname) |
142 | __field(unsigned long, gpnum) | 142 | __field(unsigned long, gpnum) |
143 | __field(u8, level) | 143 | __field(u8, level) |
144 | __field(int, grplo) | 144 | __field(int, grplo) |
@@ -168,12 +168,12 @@ TRACE_EVENT(rcu_grace_period_init, | |||
168 | */ | 168 | */ |
169 | TRACE_EVENT(rcu_preempt_task, | 169 | TRACE_EVENT(rcu_preempt_task, |
170 | 170 | ||
171 | TP_PROTO(char *rcuname, int pid, unsigned long gpnum), | 171 | TP_PROTO(const char *rcuname, int pid, unsigned long gpnum), |
172 | 172 | ||
173 | TP_ARGS(rcuname, pid, gpnum), | 173 | TP_ARGS(rcuname, pid, gpnum), |
174 | 174 | ||
175 | TP_STRUCT__entry( | 175 | TP_STRUCT__entry( |
176 | __field(char *, rcuname) | 176 | __field(const char *, rcuname) |
177 | __field(unsigned long, gpnum) | 177 | __field(unsigned long, gpnum) |
178 | __field(int, pid) | 178 | __field(int, pid) |
179 | ), | 179 | ), |
@@ -195,12 +195,12 @@ TRACE_EVENT(rcu_preempt_task, | |||
195 | */ | 195 | */ |
196 | TRACE_EVENT(rcu_unlock_preempted_task, | 196 | TRACE_EVENT(rcu_unlock_preempted_task, |
197 | 197 | ||
198 | TP_PROTO(char *rcuname, unsigned long gpnum, int pid), | 198 | TP_PROTO(const char *rcuname, unsigned long gpnum, int pid), |
199 | 199 | ||
200 | TP_ARGS(rcuname, gpnum, pid), | 200 | TP_ARGS(rcuname, gpnum, pid), |
201 | 201 | ||
202 | TP_STRUCT__entry( | 202 | TP_STRUCT__entry( |
203 | __field(char *, rcuname) | 203 | __field(const char *, rcuname) |
204 | __field(unsigned long, gpnum) | 204 | __field(unsigned long, gpnum) |
205 | __field(int, pid) | 205 | __field(int, pid) |
206 | ), | 206 | ), |
@@ -224,14 +224,14 @@ TRACE_EVENT(rcu_unlock_preempted_task, | |||
224 | */ | 224 | */ |
225 | TRACE_EVENT(rcu_quiescent_state_report, | 225 | TRACE_EVENT(rcu_quiescent_state_report, |
226 | 226 | ||
227 | TP_PROTO(char *rcuname, unsigned long gpnum, | 227 | TP_PROTO(const char *rcuname, unsigned long gpnum, |
228 | unsigned long mask, unsigned long qsmask, | 228 | unsigned long mask, unsigned long qsmask, |
229 | u8 level, int grplo, int grphi, int gp_tasks), | 229 | u8 level, int grplo, int grphi, int gp_tasks), |
230 | 230 | ||
231 | TP_ARGS(rcuname, gpnum, mask, qsmask, level, grplo, grphi, gp_tasks), | 231 | TP_ARGS(rcuname, gpnum, mask, qsmask, level, grplo, grphi, gp_tasks), |
232 | 232 | ||
233 | TP_STRUCT__entry( | 233 | TP_STRUCT__entry( |
234 | __field(char *, rcuname) | 234 | __field(const char *, rcuname) |
235 | __field(unsigned long, gpnum) | 235 | __field(unsigned long, gpnum) |
236 | __field(unsigned long, mask) | 236 | __field(unsigned long, mask) |
237 | __field(unsigned long, qsmask) | 237 | __field(unsigned long, qsmask) |
@@ -268,15 +268,15 @@ TRACE_EVENT(rcu_quiescent_state_report, | |||
268 | */ | 268 | */ |
269 | TRACE_EVENT(rcu_fqs, | 269 | TRACE_EVENT(rcu_fqs, |
270 | 270 | ||
271 | TP_PROTO(char *rcuname, unsigned long gpnum, int cpu, char *qsevent), | 271 | TP_PROTO(const char *rcuname, unsigned long gpnum, int cpu, const char *qsevent), |
272 | 272 | ||
273 | TP_ARGS(rcuname, gpnum, cpu, qsevent), | 273 | TP_ARGS(rcuname, gpnum, cpu, qsevent), |
274 | 274 | ||
275 | TP_STRUCT__entry( | 275 | TP_STRUCT__entry( |
276 | __field(char *, rcuname) | 276 | __field(const char *, rcuname) |
277 | __field(unsigned long, gpnum) | 277 | __field(unsigned long, gpnum) |
278 | __field(int, cpu) | 278 | __field(int, cpu) |
279 | __field(char *, qsevent) | 279 | __field(const char *, qsevent) |
280 | ), | 280 | ), |
281 | 281 | ||
282 | TP_fast_assign( | 282 | TP_fast_assign( |
@@ -308,12 +308,12 @@ TRACE_EVENT(rcu_fqs, | |||
308 | */ | 308 | */ |
309 | TRACE_EVENT(rcu_dyntick, | 309 | TRACE_EVENT(rcu_dyntick, |
310 | 310 | ||
311 | TP_PROTO(char *polarity, long long oldnesting, long long newnesting), | 311 | TP_PROTO(const char *polarity, long long oldnesting, long long newnesting), |
312 | 312 | ||
313 | TP_ARGS(polarity, oldnesting, newnesting), | 313 | TP_ARGS(polarity, oldnesting, newnesting), |
314 | 314 | ||
315 | TP_STRUCT__entry( | 315 | TP_STRUCT__entry( |
316 | __field(char *, polarity) | 316 | __field(const char *, polarity) |
317 | __field(long long, oldnesting) | 317 | __field(long long, oldnesting) |
318 | __field(long long, newnesting) | 318 | __field(long long, newnesting) |
319 | ), | 319 | ), |
@@ -352,12 +352,12 @@ TRACE_EVENT(rcu_dyntick, | |||
352 | */ | 352 | */ |
353 | TRACE_EVENT(rcu_prep_idle, | 353 | TRACE_EVENT(rcu_prep_idle, |
354 | 354 | ||
355 | TP_PROTO(char *reason), | 355 | TP_PROTO(const char *reason), |
356 | 356 | ||
357 | TP_ARGS(reason), | 357 | TP_ARGS(reason), |
358 | 358 | ||
359 | TP_STRUCT__entry( | 359 | TP_STRUCT__entry( |
360 | __field(char *, reason) | 360 | __field(const char *, reason) |
361 | ), | 361 | ), |
362 | 362 | ||
363 | TP_fast_assign( | 363 | TP_fast_assign( |
@@ -376,13 +376,13 @@ TRACE_EVENT(rcu_prep_idle, | |||
376 | */ | 376 | */ |
377 | TRACE_EVENT(rcu_callback, | 377 | TRACE_EVENT(rcu_callback, |
378 | 378 | ||
379 | TP_PROTO(char *rcuname, struct rcu_head *rhp, long qlen_lazy, | 379 | TP_PROTO(const char *rcuname, struct rcu_head *rhp, long qlen_lazy, |
380 | long qlen), | 380 | long qlen), |
381 | 381 | ||
382 | TP_ARGS(rcuname, rhp, qlen_lazy, qlen), | 382 | TP_ARGS(rcuname, rhp, qlen_lazy, qlen), |
383 | 383 | ||
384 | TP_STRUCT__entry( | 384 | TP_STRUCT__entry( |
385 | __field(char *, rcuname) | 385 | __field(const char *, rcuname) |
386 | __field(void *, rhp) | 386 | __field(void *, rhp) |
387 | __field(void *, func) | 387 | __field(void *, func) |
388 | __field(long, qlen_lazy) | 388 | __field(long, qlen_lazy) |
@@ -412,13 +412,13 @@ TRACE_EVENT(rcu_callback, | |||
412 | */ | 412 | */ |
413 | TRACE_EVENT(rcu_kfree_callback, | 413 | TRACE_EVENT(rcu_kfree_callback, |
414 | 414 | ||
415 | TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset, | 415 | TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset, |
416 | long qlen_lazy, long qlen), | 416 | long qlen_lazy, long qlen), |
417 | 417 | ||
418 | TP_ARGS(rcuname, rhp, offset, qlen_lazy, qlen), | 418 | TP_ARGS(rcuname, rhp, offset, qlen_lazy, qlen), |
419 | 419 | ||
420 | TP_STRUCT__entry( | 420 | TP_STRUCT__entry( |
421 | __field(char *, rcuname) | 421 | __field(const char *, rcuname) |
422 | __field(void *, rhp) | 422 | __field(void *, rhp) |
423 | __field(unsigned long, offset) | 423 | __field(unsigned long, offset) |
424 | __field(long, qlen_lazy) | 424 | __field(long, qlen_lazy) |
@@ -447,12 +447,12 @@ TRACE_EVENT(rcu_kfree_callback, | |||
447 | */ | 447 | */ |
448 | TRACE_EVENT(rcu_batch_start, | 448 | TRACE_EVENT(rcu_batch_start, |
449 | 449 | ||
450 | TP_PROTO(char *rcuname, long qlen_lazy, long qlen, long blimit), | 450 | TP_PROTO(const char *rcuname, long qlen_lazy, long qlen, long blimit), |
451 | 451 | ||
452 | TP_ARGS(rcuname, qlen_lazy, qlen, blimit), | 452 | TP_ARGS(rcuname, qlen_lazy, qlen, blimit), |
453 | 453 | ||
454 | TP_STRUCT__entry( | 454 | TP_STRUCT__entry( |
455 | __field(char *, rcuname) | 455 | __field(const char *, rcuname) |
456 | __field(long, qlen_lazy) | 456 | __field(long, qlen_lazy) |
457 | __field(long, qlen) | 457 | __field(long, qlen) |
458 | __field(long, blimit) | 458 | __field(long, blimit) |
@@ -477,12 +477,12 @@ TRACE_EVENT(rcu_batch_start, | |||
477 | */ | 477 | */ |
478 | TRACE_EVENT(rcu_invoke_callback, | 478 | TRACE_EVENT(rcu_invoke_callback, |
479 | 479 | ||
480 | TP_PROTO(char *rcuname, struct rcu_head *rhp), | 480 | TP_PROTO(const char *rcuname, struct rcu_head *rhp), |
481 | 481 | ||
482 | TP_ARGS(rcuname, rhp), | 482 | TP_ARGS(rcuname, rhp), |
483 | 483 | ||
484 | TP_STRUCT__entry( | 484 | TP_STRUCT__entry( |
485 | __field(char *, rcuname) | 485 | __field(const char *, rcuname) |
486 | __field(void *, rhp) | 486 | __field(void *, rhp) |
487 | __field(void *, func) | 487 | __field(void *, func) |
488 | ), | 488 | ), |
@@ -506,12 +506,12 @@ TRACE_EVENT(rcu_invoke_callback, | |||
506 | */ | 506 | */ |
507 | TRACE_EVENT(rcu_invoke_kfree_callback, | 507 | TRACE_EVENT(rcu_invoke_kfree_callback, |
508 | 508 | ||
509 | TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset), | 509 | TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset), |
510 | 510 | ||
511 | TP_ARGS(rcuname, rhp, offset), | 511 | TP_ARGS(rcuname, rhp, offset), |
512 | 512 | ||
513 | TP_STRUCT__entry( | 513 | TP_STRUCT__entry( |
514 | __field(char *, rcuname) | 514 | __field(const char *, rcuname) |
515 | __field(void *, rhp) | 515 | __field(void *, rhp) |
516 | __field(unsigned long, offset) | 516 | __field(unsigned long, offset) |
517 | ), | 517 | ), |
@@ -539,13 +539,13 @@ TRACE_EVENT(rcu_invoke_kfree_callback, | |||
539 | */ | 539 | */ |
540 | TRACE_EVENT(rcu_batch_end, | 540 | TRACE_EVENT(rcu_batch_end, |
541 | 541 | ||
542 | TP_PROTO(char *rcuname, int callbacks_invoked, | 542 | TP_PROTO(const char *rcuname, int callbacks_invoked, |
543 | bool cb, bool nr, bool iit, bool risk), | 543 | bool cb, bool nr, bool iit, bool risk), |
544 | 544 | ||
545 | TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk), | 545 | TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk), |
546 | 546 | ||
547 | TP_STRUCT__entry( | 547 | TP_STRUCT__entry( |
548 | __field(char *, rcuname) | 548 | __field(const char *, rcuname) |
549 | __field(int, callbacks_invoked) | 549 | __field(int, callbacks_invoked) |
550 | __field(bool, cb) | 550 | __field(bool, cb) |
551 | __field(bool, nr) | 551 | __field(bool, nr) |
@@ -577,13 +577,13 @@ TRACE_EVENT(rcu_batch_end, | |||
577 | */ | 577 | */ |
578 | TRACE_EVENT(rcu_torture_read, | 578 | TRACE_EVENT(rcu_torture_read, |
579 | 579 | ||
580 | TP_PROTO(char *rcutorturename, struct rcu_head *rhp, | 580 | TP_PROTO(const char *rcutorturename, struct rcu_head *rhp, |
581 | unsigned long secs, unsigned long c_old, unsigned long c), | 581 | unsigned long secs, unsigned long c_old, unsigned long c), |
582 | 582 | ||
583 | TP_ARGS(rcutorturename, rhp, secs, c_old, c), | 583 | TP_ARGS(rcutorturename, rhp, secs, c_old, c), |
584 | 584 | ||
585 | TP_STRUCT__entry( | 585 | TP_STRUCT__entry( |
586 | __field(char *, rcutorturename) | 586 | __field(const char *, rcutorturename) |
587 | __field(struct rcu_head *, rhp) | 587 | __field(struct rcu_head *, rhp) |
588 | __field(unsigned long, secs) | 588 | __field(unsigned long, secs) |
589 | __field(unsigned long, c_old) | 589 | __field(unsigned long, c_old) |
@@ -623,13 +623,13 @@ TRACE_EVENT(rcu_torture_read, | |||
623 | */ | 623 | */ |
624 | TRACE_EVENT(rcu_barrier, | 624 | TRACE_EVENT(rcu_barrier, |
625 | 625 | ||
626 | TP_PROTO(char *rcuname, char *s, int cpu, int cnt, unsigned long done), | 626 | TP_PROTO(const char *rcuname, const char *s, int cpu, int cnt, unsigned long done), |
627 | 627 | ||
628 | TP_ARGS(rcuname, s, cpu, cnt, done), | 628 | TP_ARGS(rcuname, s, cpu, cnt, done), |
629 | 629 | ||
630 | TP_STRUCT__entry( | 630 | TP_STRUCT__entry( |
631 | __field(char *, rcuname) | 631 | __field(const char *, rcuname) |
632 | __field(char *, s) | 632 | __field(const char *, s) |
633 | __field(int, cpu) | 633 | __field(int, cpu) |
634 | __field(int, cnt) | 634 | __field(int, cnt) |
635 | __field(unsigned long, done) | 635 | __field(unsigned long, done) |