Skip to contentSkip to conversation

app/test-eventdev: fix terminal colour after control-c exit

PATCH Applied Harry van Haaren 3 participants 3 messages Oct 14, 2021 – Oct 20, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 app/test-eventdev: fix terminal colour after control-c exit

Before this commit, a Control^C exit of the test-eventdev application would print the worker packet percentages, and leave the terminal with a green colour despite the colour reset being issued after the newline. By moving the colour reset command before the \n the issue is fixed.

Fixes 6b1a14a83a06 ("app/eventdev: add packet distribution logs")

---

Given this is an aesthetic only fix, I feel its not worth backporting.
Cc: [email protected]>

---
 app/test-eventdev/test_perf_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
app/test-eventdev/test_perf_common.c +1 -1
index e0d9f05ecd..a1b8dd72ee 100644
@@ -19,7 +19,7 @@ perf_test_result(struct evt_test *test, struct evt_options *opt)
 		total += t->worker[i].processed_pkts;
 	for (i = 0; i < t->nb_workers; i++)
 		printf("Worker %d packets: "CLGRN"%"PRIx64" "CLNRM"percentage:"
-				CLGRN" %3.2f\n"CLNRM, i,
+				CLGRN" %3.2f"CLNRM"\n", i,
 				t->worker[i].processed_pkts,
 				(((double)t->worker[i].processed_pkts)/total)
 				* 100);
Signature · 1 line
2.30.2
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines

Before this commit, a Control^C exit of the test-eventdev application would print the worker packet percentages, and leave the terminal with a green colour despite the colour reset being issued after the newline. By moving the colour reset command before the \n the issue is fixed.

Fixes 6b1a14a83a06 ("app/eventdev: add packet distribution logs")
Quoted 28 lines

---

Given this is an aesthetic only fix, I feel its not worth backporting.
Cc: [email protected]>

---
app/test-eventdev/test_perf_common.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
app/test- renamed from app/test-eventdev/test_perf_common.c +0 -0

eventdev/test_perf_common.c
index e0d9f05ecd..a1b8dd72ee 100644

app/test-eventdev/test_perf_common.c +0 -0
@@ -19,7 +19,7 @@ perf_test_result(struct evt_test *test, struct
 evt_options *opt)
 		total += t->worker[i].processed_pkts;
 	for (i = 0; i < t->nb_workers; i++)
 		printf("Worker %d packets: "CLGRN"%"PRIx64"

"CLNRM"percentage:"

app/test-eventdev/test_perf_common.c +1 -1
-				CLGRN" %3.2f\n"CLNRM, i,
+				CLGRN" %3.2f"CLNRM"\n", i,
				t->worker[i].processed_pkts,
				(((double)t-
Quoted 1 line

worker[i].processed_pkts)/total)

* 100);
--
2.30.2

Applied
#2 lore raw
Quoted 6 lines · Pavan Nikhilesh Bhagavatula
Quoted 6 lines

Before this commit, a Control^C exit of the test-eventdev application would print the worker packet percentages, and leave the terminal with a green colour despite the colour reset being issued after the newline. By moving the colour reset command before the \n the issue is fixed.

Quoted 6 lines
Quoted 4 lines
Fixes 6b1a14a83a06 ("app/eventdev: add packet distribution logs")

Applied to dpdk-next-eventdev/for-main. Thanks.

Quoted 30 lines
Quoted 29 lines

---

Given this is an aesthetic only fix, I feel its not worth backporting.
Cc: [email protected]>

---
app/test-eventdev/test_perf_common.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
app/test- renamed from app/test-eventdev/test_perf_common.c +0 -0

eventdev/test_perf_common.c
index e0d9f05ecd..a1b8dd72ee 100644

app/test-eventdev/test_perf_common.c +0 -0
@@ -19,7 +19,7 @@ perf_test_result(struct evt_test *test, struct
 evt_options *opt)
              total += t->worker[i].processed_pkts;
      for (i = 0; i < t->nb_workers; i++)
              printf("Worker %d packets: "CLGRN"%"PRIx64"

"CLNRM"percentage:"

app/test-eventdev/test_perf_common.c +1 -1
-                              CLGRN" %3.2f\n"CLNRM, i,
+                              CLGRN" %3.2f"CLNRM"\n", i,
                              t->worker[i].processed_pkts,
                              (((double)t-
Quoted 1 line

worker[i].processed_pkts)/total)

* 100);
--
2.30.2