summaryrefslogtreecommitdiffstats
path: root/include/trace
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2017-06-06 16:39:00 -0700
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2017-07-24 16:04:12 -0700
commitb3c983142d4584c9d506b1ed31b65f4292b4aea8 (patch)
tree55b6642d8844a87d245034ed219f44c17b69ea0a /include/trace
parent5e741fa9e9698f4010bb85eff252186f7a4071f4 (diff)
downloadop-kernel-dev-b3c983142d4584c9d506b1ed31b65f4292b4aea8.zip
op-kernel-dev-b3c983142d4584c9d506b1ed31b65f4292b4aea8.tar.gz
rcutorture: Place event-traced strings into trace buffer
Strings used in event tracing need to be specially handled, for example, being copied to the trace buffer instead of being pointed to by the trace buffer. Although the TPS() macro can be used to "launder" pointed-to strings, this might not be all that effective within a loadable module. This commit therefore copies rcutorture's strings to the trace buffer. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/events/rcu.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/trace/events/rcu.h b/include/trace/events/rcu.h
index 91dc089..e91ae1f 100644
--- a/include/trace/events/rcu.h
+++ b/include/trace/events/rcu.h
@@ -703,6 +703,7 @@ TRACE_EVENT(rcu_batch_end,
* at the beginning and end of the read, respectively. Note that the
* callback address can be NULL.
*/
+#define RCUTORTURENAME_LEN 8
TRACE_EVENT(rcu_torture_read,
TP_PROTO(const char *rcutorturename, struct rcu_head *rhp,
@@ -711,7 +712,7 @@ TRACE_EVENT(rcu_torture_read,
TP_ARGS(rcutorturename, rhp, secs, c_old, c),
TP_STRUCT__entry(
- __field(const char *, rcutorturename)
+ __field(char, rcutorturename[RCUTORTURENAME_LEN])
__field(struct rcu_head *, rhp)
__field(unsigned long, secs)
__field(unsigned long, c_old)
@@ -719,7 +720,9 @@ TRACE_EVENT(rcu_torture_read,
),
TP_fast_assign(
- __entry->rcutorturename = rcutorturename;
+ strncpy(__entry->rcutorturename, rcutorturename,
+ RCUTORTURENAME_LEN);
+ __entry->rcutorturename[RCUTORTURENAME_LEN - 1] = 0;
__entry->rhp = rhp;
__entry->secs = secs;
__entry->c_old = c_old;
OpenPOWER on IntegriCloud