[v3,2/7] app/test-compress-perf: add ptest command line option

Message ID 1561566633-12329-3-git-send-email-tjozwiakgm@gmail.com (mailing list archive)
State Superseded, archived
Delegated to: akhil goyal
Headers
Series add multiple cores feature to test-compress-perf |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Tomasz Jóźwiak June 26, 2019, 4:30 p.m. UTC
  From: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>

This patch adds --ptest option to make possible a choose
of test case from command line.

Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
---
 app/test-compress-perf/comp_perf_options_parse.c | 36 ++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
  

Comments

Shally Verma June 26, 2019, 5:13 p.m. UTC | #1
> -----Original Message-----
> From: Tomasz Jozwiak <tjozwiakgm@gmail.com>
> Sent: Wednesday, June 26, 2019 10:00 PM
> To: dev@dpdk.org; fiona.trahe@intel.com; tjozwiakgm@gmail.com; Shally
> Verma <shallyv@marvell.com>; arturx.trybula@intel.com
> Subject: [EXT] [PATCH v3 2/7] app/test-compress-perf: add ptest command
> line option
> 
> External Email
> 
> ----------------------------------------------------------------------
> From: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
> 
> This patch adds --ptest option to make possible a choose of test case from
> command line.
> 
> Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
> ---
>  app/test-compress-perf/comp_perf_options_parse.c | 36
> ++++++++++++++++++++++++
>  1 file changed, 36 insertions(+)
> 
> diff --git a/app/test-compress-perf/comp_perf_options_parse.c b/app/test-
> compress-perf/comp_perf_options_parse.c
> index bc4b98a..07672b2 100644
> --- a/app/test-compress-perf/comp_perf_options_parse.c
> +++ b/app/test-compress-perf/comp_perf_options_parse.c
> @@ -15,6 +15,7 @@
> 
>  #include "comp_perf_options.h"
> 
> +#define CPERF_PTEST_TYPE	("ptest")
>  #define CPERF_DRIVER_NAME	("driver-name")
>  #define CPERF_TEST_FILE		("input-file")
>  #define CPERF_SEG_SIZE		("seg-sz")
> @@ -37,6 +38,7 @@ static void
>  usage(char *progname)
>  {
>  	printf("%s [EAL options] --\n"
> +		" --ptest benchmark / verify :"
>  		" --driver-name NAME: compress driver to use\n"
>  		" --input-file NAME: file to compress and decompress\n"
>  		" --extended-input-sz N: extend file data up to this size
> (default: no extension)\n"
> @@ -76,6 +78,37 @@ get_str_key_id_mapping(struct name_id_map *map,
> unsigned int map_len,  }
> 
>  static int
> +parse_cperf_test_type(struct comp_test_data *test_data, const char
> +*arg) {
> +	struct name_id_map cperftest_namemap[] = {
> +		{
> +
> 	cperf_test_type_strs[CPERF_TEST_TYPE_BENCHMARK],
> +			CPERF_TEST_TYPE_BENCHMARK
> +		},
> +		{
> +			cperf_test_type_strs[CPERF_TEST_TYPE_VERIFY],
> +			CPERF_TEST_TYPE_VERIFY
> +		},
> +		{
> +			cperf_test_type_strs[CPERF_TEST_TYPE_PMDCC],
> +			CPERF_TEST_TYPE_PMDCC
What is PMDCC here? What kind of test type?

> +		}
> +	};
> +
> +	int id = get_str_key_id_mapping(
> +			(struct name_id_map *)cperftest_namemap,
> +			RTE_DIM(cperftest_namemap), arg);
> +	if (id < 0) {
> +		RTE_LOG(ERR, USER1, "failed to parse test type");
> +		return -1;
> +	}
> +
> +	test_data->test = (enum cperf_perf_test_type)id;
> +
> +	return 0;
> +}
> +
> +static int
>  parse_uint32_t(uint32_t *value, const char *arg)  {
>  	char *end = NULL;
> @@ -499,6 +532,8 @@ struct long_opt_parser {  };
> 
>  static struct option lgopts[] = {
> +
> +	{ CPERF_PTEST_TYPE, required_argument, 0, 0 },
>  	{ CPERF_DRIVER_NAME, required_argument, 0, 0 },
>  	{ CPERF_TEST_FILE, required_argument, 0, 0 },
>  	{ CPERF_SEG_SIZE, required_argument, 0, 0 }, @@ -517,6 +552,7 @@
> static int  comp_perf_opts_parse_long(int opt_idx, struct comp_test_data
> *test_data)  {
>  	struct long_opt_parser parsermap[] = {
> +		{ CPERF_PTEST_TYPE,	parse_cperf_test_type },
>  		{ CPERF_DRIVER_NAME,	parse_driver_name },
>  		{ CPERF_TEST_FILE,	parse_test_file },
>  		{ CPERF_SEG_SIZE,	parse_seg_sz },
> --
> 2.7.4
  
Tomasz Jóźwiak June 26, 2019, 5:34 p.m. UTC | #2
Hi Shally,


>> -----Original Message-----
>> From: Tomasz Jozwiak <tjozwiakgm@gmail.com>
>> Sent: Wednesday, June 26, 2019 10:00 PM
>> To: dev@dpdk.org; fiona.trahe@intel.com; tjozwiakgm@gmail.com; Shally
>> Verma <shallyv@marvell.com>; arturx.trybula@intel.com
>> Subject: [EXT] [PATCH v3 2/7] app/test-compress-perf: add ptest command
>> line option
>>
>> External Email
>>
>> ----------------------------------------------------------------------
>> From: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
>>
>> This patch adds --ptest option to make possible a choose of test case from
>> command line.
>>
>> Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
>> ---
>>   app/test-compress-perf/comp_perf_options_parse.c | 36
>> ++++++++++++++++++++++++
>>   1 file changed, 36 insertions(+)
>>
>> diff --git a/app/test-compress-perf/comp_perf_options_parse.c b/app/test-
>> compress-perf/comp_perf_options_parse.c
>> index bc4b98a..07672b2 100644
>> --- a/app/test-compress-perf/comp_perf_options_parse.c
>> +++ b/app/test-compress-perf/comp_perf_options_parse.c
>> @@ -15,6 +15,7 @@
>>
>>   #include "comp_perf_options.h"
>>
>> +#define CPERF_PTEST_TYPE	("ptest")
>>   #define CPERF_DRIVER_NAME	("driver-name")
>>   #define CPERF_TEST_FILE		("input-file")
>>   #define CPERF_SEG_SIZE		("seg-sz")
>> @@ -37,6 +38,7 @@ static void
>>   usage(char *progname)
>>   {
>>   	printf("%s [EAL options] --\n"
>> +		" --ptest benchmark / verify :"
>>   		" --driver-name NAME: compress driver to use\n"
>>   		" --input-file NAME: file to compress and decompress\n"
>>   		" --extended-input-sz N: extend file data up to this size
>> (default: no extension)\n"
>> @@ -76,6 +78,37 @@ get_str_key_id_mapping(struct name_id_map *map,
>> unsigned int map_len,  }
>>
>>   static int
>> +parse_cperf_test_type(struct comp_test_data *test_data, const char
>> +*arg) {
>> +	struct name_id_map cperftest_namemap[] = {
>> +		{
>> +
>> 	cperf_test_type_strs[CPERF_TEST_TYPE_BENCHMARK],
>> +			CPERF_TEST_TYPE_BENCHMARK
>> +		},
>> +		{
>> +			cperf_test_type_strs[CPERF_TEST_TYPE_VERIFY],
>> +			CPERF_TEST_TYPE_VERIFY
>> +		},
>> +		{
>> +			cperf_test_type_strs[CPERF_TEST_TYPE_PMDCC],
>> +			CPERF_TEST_TYPE_PMDCC
> What is PMDCC here? What kind of test type?

[Tomek] This's for 'pmd_cyclecount_test'. Actually compression_perf tool

doesn't support that test, but we added a sort of 'template' for that, 
cause there's a plan to add

this test in the future.


Thx

--

Tomek
  
Shally Verma June 27, 2019, 4:41 a.m. UTC | #3
> -----Original Message-----
> From: Tomasz Jozwiak <tjozwiakgm@gmail.com>
> Sent: Wednesday, June 26, 2019 11:05 PM
> To: Shally Verma <shallyv@marvell.com>; dev@dpdk.org;
> fiona.trahe@intel.com; arturx.trybula@intel.com
> Subject: Re: [EXT] [PATCH v3 2/7] app/test-compress-perf: add ptest
> command line option
> 
> Hi Shally,
> 
> 
> >> -----Original Message-----
> >> From: Tomasz Jozwiak <tjozwiakgm@gmail.com>
> >> Sent: Wednesday, June 26, 2019 10:00 PM
> >> To: dev@dpdk.org; fiona.trahe@intel.com; tjozwiakgm@gmail.com;
> Shally
> >> Verma <shallyv@marvell.com>; arturx.trybula@intel.com
> >> Subject: [EXT] [PATCH v3 2/7] app/test-compress-perf: add ptest
> >> command line option
> >>
> >> External Email
> >>
> >> ---------------------------------------------------------------------
> >> -
> >> From: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
> >>
> >> This patch adds --ptest option to make possible a choose of test case
> >> from command line.
> >>
> >> Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
> >> ---
> >>   app/test-compress-perf/comp_perf_options_parse.c | 36
> >> ++++++++++++++++++++++++
> >>   1 file changed, 36 insertions(+)
> >>
> >> diff --git a/app/test-compress-perf/comp_perf_options_parse.c
> >> b/app/test- compress-perf/comp_perf_options_parse.c
> >> index bc4b98a..07672b2 100644
> >> --- a/app/test-compress-perf/comp_perf_options_parse.c
> >> +++ b/app/test-compress-perf/comp_perf_options_parse.c
> >> @@ -15,6 +15,7 @@
> >>
> >>   #include "comp_perf_options.h"
> >>
> >> +#define CPERF_PTEST_TYPE	("ptest")
> >>   #define CPERF_DRIVER_NAME	("driver-name")
> >>   #define CPERF_TEST_FILE		("input-file")
> >>   #define CPERF_SEG_SIZE		("seg-sz")
> >> @@ -37,6 +38,7 @@ static void
> >>   usage(char *progname)
> >>   {
> >>   	printf("%s [EAL options] --\n"
> >> +		" --ptest benchmark / verify :"
> >>   		" --driver-name NAME: compress driver to use\n"
> >>   		" --input-file NAME: file to compress and decompress\n"
> >>   		" --extended-input-sz N: extend file data up to this size
> >> (default: no extension)\n"
> >> @@ -76,6 +78,37 @@ get_str_key_id_mapping(struct name_id_map
> *map,
> >> unsigned int map_len,  }
> >>
> >>   static int
> >> +parse_cperf_test_type(struct comp_test_data *test_data, const char
> >> +*arg) {
> >> +	struct name_id_map cperftest_namemap[] = {
> >> +		{
> >> +
> >> 	cperf_test_type_strs[CPERF_TEST_TYPE_BENCHMARK],
> >> +			CPERF_TEST_TYPE_BENCHMARK
> >> +		},
> >> +		{
> >> +			cperf_test_type_strs[CPERF_TEST_TYPE_VERIFY],
> >> +			CPERF_TEST_TYPE_VERIFY
> >> +		},
> >> +		{
> >> +			cperf_test_type_strs[CPERF_TEST_TYPE_PMDCC],
> >> +			CPERF_TEST_TYPE_PMDCC
> > What is PMDCC here? What kind of test type?
> 
> [Tomek] This's for 'pmd_cyclecount_test'. Actually compression_perf tool
> 
> doesn't support that test, but we added a sort of 'template' for that, cause
> there's a plan to add
> 
> this test in the future.

Isn’t it better we add this .. when we actually add feature?

> 
> 
> Thx
> 
> --
> 
> Tomek
> 
>
  
Tomasz Jóźwiak June 27, 2019, 9:27 p.m. UTC | #4
Hi Shally,


>
>> -----Original Message-----
>> From: Tomasz Jozwiak <tjozwiakgm@gmail.com>
>> Sent: Wednesday, June 26, 2019 11:05 PM
>> To: Shally Verma <shallyv@marvell.com>; dev@dpdk.org;
>> fiona.trahe@intel.com; arturx.trybula@intel.com
>> Subject: Re: [EXT] [PATCH v3 2/7] app/test-compress-perf: add ptest
>> command line option
>>
>> Hi Shally,
>>
>>
>>>> -----Original Message-----
>>>> From: Tomasz Jozwiak <tjozwiakgm@gmail.com>
>>>> Sent: Wednesday, June 26, 2019 10:00 PM
>>>> To: dev@dpdk.org; fiona.trahe@intel.com; tjozwiakgm@gmail.com;
>> Shally
>>>> Verma <shallyv@marvell.com>; arturx.trybula@intel.com
>>>> Subject: [EXT] [PATCH v3 2/7] app/test-compress-perf: add ptest
>>>> command line option
>>>>
>>>> External Email
>>>>
>>>> ---------------------------------------------------------------------
>>>> -
>>>> From: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
>>>>
>>>> This patch adds --ptest option to make possible a choose of test case
>>>> from command line.
>>>>
>>>> Signed-off-by: Tomasz Jozwiak <tomaszx.jozwiak@intel.com>
>>>> ---
>>>>    app/test-compress-perf/comp_perf_options_parse.c | 36
>>>> ++++++++++++++++++++++++
>>>>    1 file changed, 36 insertions(+)
>>>>
>>>> diff --git a/app/test-compress-perf/comp_perf_options_parse.c
>>>> b/app/test- compress-perf/comp_perf_options_parse.c
>>>> index bc4b98a..07672b2 100644
>>>> --- a/app/test-compress-perf/comp_perf_options_parse.c
>>>> +++ b/app/test-compress-perf/comp_perf_options_parse.c
>>>> @@ -15,6 +15,7 @@
>>>>
>>>>    #include "comp_perf_options.h"
>>>>
>>>> +#define CPERF_PTEST_TYPE	("ptest")
>>>>    #define CPERF_DRIVER_NAME	("driver-name")
>>>>    #define CPERF_TEST_FILE		("input-file")
>>>>    #define CPERF_SEG_SIZE		("seg-sz")
>>>> @@ -37,6 +38,7 @@ static void
>>>>    usage(char *progname)
>>>>    {
>>>>    	printf("%s [EAL options] --\n"
>>>> +		" --ptest benchmark / verify :"
>>>>    		" --driver-name NAME: compress driver to use\n"
>>>>    		" --input-file NAME: file to compress and decompress\n"
>>>>    		" --extended-input-sz N: extend file data up to this size
>>>> (default: no extension)\n"
>>>> @@ -76,6 +78,37 @@ get_str_key_id_mapping(struct name_id_map
>> *map,
>>>> unsigned int map_len,  }
>>>>
>>>>    static int
>>>> +parse_cperf_test_type(struct comp_test_data *test_data, const char
>>>> +*arg) {
>>>> +	struct name_id_map cperftest_namemap[] = {
>>>> +		{
>>>> +
>>>> 	cperf_test_type_strs[CPERF_TEST_TYPE_BENCHMARK],
>>>> +			CPERF_TEST_TYPE_BENCHMARK
>>>> +		},
>>>> +		{
>>>> +			cperf_test_type_strs[CPERF_TEST_TYPE_VERIFY],
>>>> +			CPERF_TEST_TYPE_VERIFY
>>>> +		},
>>>> +		{
>>>> +			cperf_test_type_strs[CPERF_TEST_TYPE_PMDCC],
>>>> +			CPERF_TEST_TYPE_PMDCC
>>> What is PMDCC here? What kind of test type?
>> [Tomek] This's for 'pmd_cyclecount_test'. Actually compression_perf tool
>>
>> doesn't support that test, but we added a sort of 'template' for that, cause
>> there's a plan to add
>>
>> this test in the future.
> Isn’t it better we add this .. when we actually add feature?

[Tomek] True , I'll remove this in V4.


Thx, Tomek
  

Patch

diff --git a/app/test-compress-perf/comp_perf_options_parse.c b/app/test-compress-perf/comp_perf_options_parse.c
index bc4b98a..07672b2 100644
--- a/app/test-compress-perf/comp_perf_options_parse.c
+++ b/app/test-compress-perf/comp_perf_options_parse.c
@@ -15,6 +15,7 @@ 
 
 #include "comp_perf_options.h"
 
+#define CPERF_PTEST_TYPE	("ptest")
 #define CPERF_DRIVER_NAME	("driver-name")
 #define CPERF_TEST_FILE		("input-file")
 #define CPERF_SEG_SIZE		("seg-sz")
@@ -37,6 +38,7 @@  static void
 usage(char *progname)
 {
 	printf("%s [EAL options] --\n"
+		" --ptest benchmark / verify :"
 		" --driver-name NAME: compress driver to use\n"
 		" --input-file NAME: file to compress and decompress\n"
 		" --extended-input-sz N: extend file data up to this size (default: no extension)\n"
@@ -76,6 +78,37 @@  get_str_key_id_mapping(struct name_id_map *map, unsigned int map_len,
 }
 
 static int
+parse_cperf_test_type(struct comp_test_data *test_data, const char *arg)
+{
+	struct name_id_map cperftest_namemap[] = {
+		{
+			cperf_test_type_strs[CPERF_TEST_TYPE_BENCHMARK],
+			CPERF_TEST_TYPE_BENCHMARK
+		},
+		{
+			cperf_test_type_strs[CPERF_TEST_TYPE_VERIFY],
+			CPERF_TEST_TYPE_VERIFY
+		},
+		{
+			cperf_test_type_strs[CPERF_TEST_TYPE_PMDCC],
+			CPERF_TEST_TYPE_PMDCC
+		}
+	};
+
+	int id = get_str_key_id_mapping(
+			(struct name_id_map *)cperftest_namemap,
+			RTE_DIM(cperftest_namemap), arg);
+	if (id < 0) {
+		RTE_LOG(ERR, USER1, "failed to parse test type");
+		return -1;
+	}
+
+	test_data->test = (enum cperf_perf_test_type)id;
+
+	return 0;
+}
+
+static int
 parse_uint32_t(uint32_t *value, const char *arg)
 {
 	char *end = NULL;
@@ -499,6 +532,8 @@  struct long_opt_parser {
 };
 
 static struct option lgopts[] = {
+
+	{ CPERF_PTEST_TYPE, required_argument, 0, 0 },
 	{ CPERF_DRIVER_NAME, required_argument, 0, 0 },
 	{ CPERF_TEST_FILE, required_argument, 0, 0 },
 	{ CPERF_SEG_SIZE, required_argument, 0, 0 },
@@ -517,6 +552,7 @@  static int
 comp_perf_opts_parse_long(int opt_idx, struct comp_test_data *test_data)
 {
 	struct long_opt_parser parsermap[] = {
+		{ CPERF_PTEST_TYPE,	parse_cperf_test_type },
 		{ CPERF_DRIVER_NAME,	parse_driver_name },
 		{ CPERF_TEST_FILE,	parse_test_file },
 		{ CPERF_SEG_SIZE,	parse_seg_sz },