linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] refscale: simplify the errexit checkpoint
@ 2021-10-22 10:51 Li Zhijian
  2021-10-22 10:51 ` [PATCH 2/2] refscale: prevent buffer to pr_alert() being too long Li Zhijian
  2021-10-22 23:10 ` [PATCH 1/2] refscale: simplify the errexit checkpoint Paul E. McKenney
  0 siblings, 2 replies; 8+ messages in thread
From: Li Zhijian @ 2021-10-22 10:51 UTC (permalink / raw)
  To: dave, paulmck, josh, rostedt, mathieu.desnoyers, jiangshanlai, joel, rcu
  Cc: linux-kernel, Li Zhijian

Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
---
 kernel/rcu/refscale.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/kernel/rcu/refscale.c b/kernel/rcu/refscale.c
index 66dc14cf5687..2cbe2a2ba387 100644
--- a/kernel/rcu/refscale.c
+++ b/kernel/rcu/refscale.c
@@ -698,26 +698,25 @@ static int main_func(void *arg)
 	// Print the average of all experiments
 	SCALEOUT("END OF TEST. Calculating average duration per loop (nanoseconds)...\n");
 
-	if (!errexit) {
-		buf[0] = 0;
-		strcat(buf, "\n");
-		strcat(buf, "Runs\tTime(ns)\n");
-	}
+	if (errexit)
+		goto err;
+
+	buf[0] = 0;
+	strcat(buf, "\n");
+	strcat(buf, "Runs\tTime(ns)\n");
 
 	for (exp = 0; exp < nruns; exp++) {
 		u64 avg;
 		u32 rem;
 
-		if (errexit)
-			break;
 		avg = div_u64_rem(result_avg[exp], 1000, &rem);
 		sprintf(buf1, "%d\t%llu.%03u\n", exp + 1, avg, rem);
 		strcat(buf, buf1);
 	}
 
-	if (!errexit)
-		SCALEOUT("%s", buf);
+	SCALEOUT("%s", buf);
 
+err:
 	// This will shutdown everything including us.
 	if (shutdown) {
 		shutdown_start = 1;
-- 
2.33.0




^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-10-25  3:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-22 10:51 [PATCH 1/2] refscale: simplify the errexit checkpoint Li Zhijian
2021-10-22 10:51 ` [PATCH 2/2] refscale: prevent buffer to pr_alert() being too long Li Zhijian
2021-10-22 23:15   ` Paul E. McKenney
2021-10-24 14:46     ` Li, Zhijian
2021-10-24 22:56       ` Paul E. McKenney
2021-10-25  3:15         ` lizhijian
2021-10-22 23:10 ` [PATCH 1/2] refscale: simplify the errexit checkpoint Paul E. McKenney
2021-10-24 13:34   ` Li, Zhijian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).