diff mbox series

[2/7] selftests/resctrl: Correct benchmark command help

Message ID 20230808091625.12760-3-ilpo.jarvinen@linux.intel.com (mailing list archive)
State New
Headers show
Series selftests/resctrl: Rework benchmark command handling | expand

Commit Message

Ilpo Järvinen Aug. 8, 2023, 9:16 a.m. UTC
Benchmark command must be the last argument because it consumes all the
remaining arguments but help misleadingly shows it as the first
argument. The benchmark command is also shown in quotes but it does not
match with the code.

Correct -b argument place in the help message and remove the quotes.
Tweak also how the options are presented by using ... notation.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
 tools/testing/selftests/resctrl/resctrl_tests.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Reinette Chatre Aug. 14, 2023, 5:49 p.m. UTC | #1
Hi Ilpo,

On 8/8/2023 2:16 AM, Ilpo Järvinen wrote:
> Benchmark command must be the last argument because it consumes all the
> remaining arguments but help misleadingly shows it as the first
> argument. The benchmark command is also shown in quotes but it does not
> match with the code.
> 
> Correct -b argument place in the help message and remove the quotes.
> Tweak also how the options are presented by using ... notation.
> 
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
> ---
>  tools/testing/selftests/resctrl/resctrl_tests.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/resctrl/resctrl_tests.c b/tools/testing/selftests/resctrl/resctrl_tests.c
> index eef9e02516ad..559868b16079 100644
> --- a/tools/testing/selftests/resctrl/resctrl_tests.c
> +++ b/tools/testing/selftests/resctrl/resctrl_tests.c
> @@ -52,7 +52,7 @@ int get_vendor(void)
>  
>  static void cmd_help(void)
>  {
> -	printf("usage: resctrl_tests [-h] [-b \"benchmark_cmd [options]\"] [-t test list] [-n no_of_bits]\n");
> +	printf("usage: resctrl_tests [-h] [-t test list] [-n no_of_bits] [-b benchmark_cmd [option]...]\n");
>  	printf("\t-b benchmark_cmd [options]: run specified benchmark for MBM, MBA and CMT\n");

Considering it was documented goal of patch to use "..." notation, should
it be done consistently by changing above line also?

>  	printf("\t   default benchmark is builtin fill_buf\n");
>  	printf("\t-t test list: run tests specified in the test list, ");

Reinette
Ilpo Järvinen Aug. 15, 2023, 9:11 a.m. UTC | #2
On Mon, 14 Aug 2023, Reinette Chatre wrote:

> Hi Ilpo,
> 
> On 8/8/2023 2:16 AM, Ilpo Järvinen wrote:
> > Benchmark command must be the last argument because it consumes all the
> > remaining arguments but help misleadingly shows it as the first
> > argument. The benchmark command is also shown in quotes but it does not
> > match with the code.
> > 
> > Correct -b argument place in the help message and remove the quotes.
> > Tweak also how the options are presented by using ... notation.
> > 
> > Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
> > ---
> >  tools/testing/selftests/resctrl/resctrl_tests.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/tools/testing/selftests/resctrl/resctrl_tests.c b/tools/testing/selftests/resctrl/resctrl_tests.c
> > index eef9e02516ad..559868b16079 100644
> > --- a/tools/testing/selftests/resctrl/resctrl_tests.c
> > +++ b/tools/testing/selftests/resctrl/resctrl_tests.c
> > @@ -52,7 +52,7 @@ int get_vendor(void)
> >  
> >  static void cmd_help(void)
> >  {
> > -	printf("usage: resctrl_tests [-h] [-b \"benchmark_cmd [options]\"] [-t test list] [-n no_of_bits]\n");
> > +	printf("usage: resctrl_tests [-h] [-t test list] [-n no_of_bits] [-b benchmark_cmd [option]...]\n");
> >  	printf("\t-b benchmark_cmd [options]: run specified benchmark for MBM, MBA and CMT\n");
> 
> Considering it was documented goal of patch to use "..." notation, should
> it be done consistently by changing above line also?

Yes, I'll do that.
diff mbox series

Patch

diff --git a/tools/testing/selftests/resctrl/resctrl_tests.c b/tools/testing/selftests/resctrl/resctrl_tests.c
index eef9e02516ad..559868b16079 100644
--- a/tools/testing/selftests/resctrl/resctrl_tests.c
+++ b/tools/testing/selftests/resctrl/resctrl_tests.c
@@ -52,7 +52,7 @@  int get_vendor(void)
 
 static void cmd_help(void)
 {
-	printf("usage: resctrl_tests [-h] [-b \"benchmark_cmd [options]\"] [-t test list] [-n no_of_bits]\n");
+	printf("usage: resctrl_tests [-h] [-t test list] [-n no_of_bits] [-b benchmark_cmd [option]...]\n");
 	printf("\t-b benchmark_cmd [options]: run specified benchmark for MBM, MBA and CMT\n");
 	printf("\t   default benchmark is builtin fill_buf\n");
 	printf("\t-t test list: run tests specified in the test list, ");