aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-kernel/cryptodev/sdk_patches/0052-add-flag-to-report-in-a-machine-friendly-format.patch
blob: c2b88a5961d98fc1ab08635a8bdaf5e73b441318 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
From 6d2e0927c2ed2795267d7652d9413d7e01da202e Mon Sep 17 00:00:00 2001
From: Cristian Stoica <cristian.stoica@nxp.com>
Date: Tue, 25 Oct 2016 16:54:06 +0300
Subject: [PATCH 052/104] add flag to report in a machine friendly format

Signed-off-by: Cristian Stoica <cristian.stoica@nxp.com>
---
 tests/async_speed.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tests/async_speed.c b/tests/async_speed.c
index fff3414..1941750 100644
--- a/tests/async_speed.c
+++ b/tests/async_speed.c
@@ -35,6 +35,7 @@
 struct test_params {
 	bool tflag;
 	bool nflag;
+	bool mflag;
 	int tvalue;
 	int nvalue;
 };
@@ -43,6 +44,7 @@ const char usage_str[] = "Usage: %s [OPTION]... <cipher>|<hash>\n"
 	"Run benchmark test for cipher or hash\n\n"
 	"  -t <secs>\t" "time to run each test (default 10 secs)\n"
 	"  -n <bytes>\t" "size of the test buffer\n"
+	"  -m\t\t" "output in a machine readable format\n"
 	"  -h\t\t" "show this help\n"
 ;
 
@@ -369,9 +371,10 @@ int main(int argc, char **argv)
 
 	tp.tflag = false;
 	tp.nflag = false;
+	tp.mflag = false;
 	alg_flag = false;
 	opterr = 0;
-	while ((c = getopt(argc, argv, "hn:t:")) != -1) {
+	while ((c = getopt(argc, argv, "hn:t:m")) != -1) {
 		switch (c) {
 		case 'n':
 			tp.nvalue = atoi(optarg);
@@ -381,6 +384,9 @@ int main(int argc, char **argv)
 			tp.tvalue = atoi(optarg);
 			tp.tflag = true;
 			break;
+		case 'm':
+			tp.mflag = true;
+			break;
 		case 'h': /* no break */
 		default:
 			usage(argv[0]);
-- 
2.10.2