Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1695210
| From | "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH tip/core/rcu 08/13] rcutorture: Place event-traced strings into trace buffer |
| Date | 2017-07-25 00:30 +0200 |
| Message-ID | <u6U1t-2LB-55@gated-at.bofh.it> (permalink) |
| References | <u6U1r-2LB-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
include/trace/events/rcu.h | 7 +++++--
kernel/rcu/rcutorture.c | 2 +-
tools/testing/selftests/rcutorture/configs/rcu/BUSTED.boot | 2 +-
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/include/trace/events/rcu.h b/include/trace/events/rcu.h
index 91dc089d65b7..e91ae1f2290d 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;
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index 8d59c82bec0b..b48d2107f176 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -496,7 +496,7 @@ static struct rcu_torture_ops rcu_busted_ops = {
.fqs = NULL,
.stats = NULL,
.irq_capable = 1,
- .name = "rcu_busted"
+ .name = "busted"
};
/*
diff --git a/tools/testing/selftests/rcutorture/configs/rcu/BUSTED.boot b/tools/testing/selftests/rcutorture/configs/rcu/BUSTED.boot
index 6804f9dcfc1b..be7728db42fd 100644
--- a/tools/testing/selftests/rcutorture/configs/rcu/BUSTED.boot
+++ b/tools/testing/selftests/rcutorture/configs/rcu/BUSTED.boot
@@ -1 +1 @@
-rcutorture.torture_type=rcu_busted
+rcutorture.torture_type=busted
--
2.5.2
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH tip/core/rcu 0/13] Torture-test updates "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-07-25 00:30 +0200 [PATCH tip/core/rcu 09/13] rcutorture: Use nr_cpus rather than maxcpus to limit test size "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-07-25 00:30 +0200 [PATCH tip/core/rcu 11/13] rcutorture: Eliminate unused ts_rem local from rcu_trace_clock_local() "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-07-25 00:30 +0200 [PATCH tip/core/rcu 12/13] rcu: Add last-CPU to GP-kthread starvation messages "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-07-25 00:30 +0200 [PATCH tip/core/rcu 13/13] rcutorture: Invoke call_rcu() from timer handler "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-07-25 00:30 +0200 [PATCH tip/core/rcu 06/13] rcutorture: Don't wait for kernel when all builds fail "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-07-25 00:30 +0200 [PATCH tip/core/rcu 05/13] torture: Add --kconfig argument to kvm.sh "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-07-25 00:30 +0200 [PATCH tip/core/rcu 07/13] rcutorture: Enable SRCU readers from timer handler "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-07-25 00:30 +0200 [PATCH tip/core/rcu 01/13] rcutorture: Move SRCU status printing to SRCU implementations "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-07-25 00:30 +0200 [PATCH tip/core/rcu 08/13] rcutorture: Place event-traced strings into trace buffer "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-07-25 00:30 +0200 [PATCH tip/core/rcu 02/13] rcutorture: Print SRCU lock/unlock totals "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2017-07-25 00:30 +0200
csiph-web