Skip to content

Commit 65e6ff0

Browse files
paulmckrcufbq
authored andcommitted
rcutorture: Add ftrace-compatible timestamp to GP# failure/close-call output
This commit adds an ftrace-compatible microsecond-scale timestamp to the failure/close-call output, but only in kernels built with CONFIG_RCU_TORTURE_TEST_LOG_GP=y. Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
1 parent a8f7c9c commit 65e6ff0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

kernel/rcu/rcutorture.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ struct rt_read_seg {
275275
int rt_end_cpu;
276276
unsigned long long rt_gp_seq;
277277
unsigned long long rt_gp_seq_end;
278+
u64 rt_ts;
278279
};
279280
static int err_segs_recorded;
280281
static struct rt_read_seg err_segs[RCUTORTURE_RDR_MAX_SEGS];
@@ -1989,6 +1990,7 @@ static void rcutorture_one_extend(int *readstate, int newstate, bool insoftirq,
19891990
// Sample grace-period sequence number, as good a place as any.
19901991
if (IS_ENABLED(CONFIG_RCU_TORTURE_TEST_LOG_GP) && cur_ops->gather_gp_seqs) {
19911992
rtrsp->rt_gp_seq = cur_ops->gather_gp_seqs();
1993+
rtrsp->rt_ts = ktime_get_mono_fast_ns();
19921994
if (!first)
19931995
rtrsp[-1].rt_gp_seq_end = rtrsp->rt_gp_seq;
19941996
}
@@ -3663,7 +3665,11 @@ rcu_torture_cleanup(void)
36633665
pr_alert("\t: No segments recorded!!!\n");
36643666
firsttime = 1;
36653667
for (i = 0; i < rt_read_nsegs; i++) {
3666-
pr_alert("\t%d: %#4x", i, err_segs[i].rt_readstate);
3668+
if (IS_ENABLED(CONFIG_RCU_TORTURE_TEST_LOG_GP))
3669+
pr_alert("\t%lluus ", div64_u64(err_segs[i].rt_ts, 1000ULL));
3670+
else
3671+
pr_alert("\t");
3672+
pr_cont("%d: %#4x", i, err_segs[i].rt_readstate);
36673673
if (err_segs[i].rt_delay_jiffies != 0) {
36683674
pr_cont("%s%ldjiffies", firsttime ? "" : "+",
36693675
err_segs[i].rt_delay_jiffies);

0 commit comments

Comments
 (0)