Skip to contentSkip to conversation

testsuite/gpiobench: Do calculate avg latency once when test is interrupted

PATCH Applied Hongzhan Chen 2 participants 3 messages Sep 2, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 testsuite/gpiobench: Do calculate avg latency once when test is interrupted

When test is interrupted, avg latency need to be calcuated once to avoid large latency showing even though it may not be quite accurate.

testsuite/gpiobench/gpiobench.c +12 -0
index 50afbd418..50dc7aef7 100644
@@ -482,6 +482,18 @@ static void print_hist(void)
 {
 	int i;
 
+	if (ti.total_cycles < (ti.max_cycles - 1)) {
+		/* test is interrupted and force to calculate
+		 * even though it is not accurate but to avoid
+		 * large latency surprising us.
+		 */
+		printf("test is interrupted and exit exceptionally\n");
+		printf("Please run again till it exit normally\n");
+
+		ti.ts.inner_avg /= (ti.total_cycles * 2);
+		ti.ts.outer_avg /= (ti.total_cycles * 2);
+
+	}
 	printf("\n");
 	printf("# Inner Loop Histogram\n");
 	printf("# Inner Loop latency is the latency in kernel space\n"
Signature · 1 line
2.17.1
Applied
#1 lore raw
Quoted 20 lines · Hongzhan Chen via Xenomai

When test is interrupted, avg latency need to be calcuated once to avoid large latency showing even though it may not be quite accurate.

testsuite/gpiobench/gpiobench.c +5 -0
index 50afbd418..50dc7aef7 100644
@@ -482,6 +482,18 @@ static void print_hist(void)
 {
 	int i;
 
+	if (ti.total_cycles < (ti.max_cycles - 1)) {
+		/* test is interrupted and force to calculate
+		 * even though it is not accurate but to avoid
+		 * large latency surprising us.
+		 */

testsuite/gpiobench/gpiobench.c static void print_hist(void) · line 499

Quoted 10 lines
testsuite/gpiobench/gpiobench.c +7 -0
+		printf("test is interrupted and exit exceptionally\n");
+		printf("Please run again till it exit normally\n");
+
+		ti.ts.inner_avg /= (ti.total_cycles * 2);
+		ti.ts.outer_avg /= (ti.total_cycles * 2);
+
+	}
 	printf("\n");
 	printf("# Inner Loop Histogram\n");
 	printf("# Inner Loop latency is the latency in kernel space\n"

Thanks, applied.

Jan

Signature · 2 lines
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux
#2 lore raw
Quoted 34 lines · Jan Kiszka
Quoted 20 lines · Hongzhan Chen via Xenomai

When test is interrupted, avg latency need to be calcuated once to avoid large latency showing even though it may not be quite accurate.

testsuite/gpiobench/gpiobench.c +5 -0
index 50afbd418..50dc7aef7 100644
@@ -482,6 +482,18 @@ static void print_hist(void)
 {
 	int i;
 
+	if (ti.total_cycles < (ti.max_cycles - 1)) {
+		/* test is interrupted and force to calculate
+		 * even though it is not accurate but to avoid
+		 * large latency surprising us.
+		 */

testsuite/gpiobench/gpiobench.c static void print_hist(void) · line 499

Quoted 10 lines
testsuite/gpiobench/gpiobench.c +7 -0
+		printf("test is interrupted and exit exceptionally\n");
+		printf("Please run again till it exit normally\n");
+
+		ti.ts.inner_avg /= (ti.total_cycles * 2);
+		ti.ts.outer_avg /= (ti.total_cycles * 2);
+
+	}
 	printf("\n");
 	printf("# Inner Loop Histogram\n");
 	printf("# Inner Loop latency is the latency in kernel space\n"

Thanks, applied.

Quoted 2 lines

Jan

...with some tuning of the wording and the newline. See next.

Jan

Signature · 2 lines
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux