* FAILED: patch "[PATCH] selftests/resctrl: Fix incorrect parsing of option "-t"" failed to apply to 5.12-stable tree
@ 2021-07-11 13:06 gregkh
2021-07-12 7:55 ` [PATCH 5.12] selftests/resctrl: Fix incorrect parsing of option "-t" Xiaochen Shen
0 siblings, 1 reply; 3+ messages in thread
From: gregkh @ 2021-07-11 13:06 UTC (permalink / raw)
To: xiaochen.shen, skhan, tony.luck; +Cc: stable
The patch below does not apply to the 5.12-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 1421ec684a43379b2aa3cfda20b03d38282dc990 Mon Sep 17 00:00:00 2001
From: Xiaochen Shen <xiaochen.shen@intel.com>
Date: Thu, 27 May 2021 17:31:53 +0800
Subject: [PATCH] selftests/resctrl: Fix incorrect parsing of option "-t"
Resctrl test suite accepts command line argument "-t" to specify the
unit tests to run in the test list (e.g., -t mbm,mba,cmt,cat) as
documented in the help.
When calling strtok() to parse the option, the incorrect delimiters
argument ":\t" is used. As a result, passing "-t mbm,mba,cmt,cat" throws
an invalid option error.
Fix this by using delimiters argument "," instead of ":\t" for parsing
of unit tests list. At the same time, remove the unnecessary "spaces"
between the unit tests in help documentation to prevent confusion.
Fixes: 790bf585b0ee ("selftests/resctrl: Add Cache Allocation Technology (CAT) selftest")
Fixes: 78941183d1b1 ("selftests/resctrl: Add Cache QoS Monitoring (CQM) selftest")
Fixes: ecdbb911f22d ("selftests/resctrl: Add MBM test")
Fixes: 034c7678dd2c ("selftests/resctrl: Add README for resctrl tests")
Cc: stable@vger.kernel.org
Signed-off-by: Xiaochen Shen <xiaochen.shen@intel.com>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
diff --git a/tools/testing/selftests/resctrl/README b/tools/testing/selftests/resctrl/README
index 4b36b25b6ac0..3d2bbd4fa3aa 100644
--- a/tools/testing/selftests/resctrl/README
+++ b/tools/testing/selftests/resctrl/README
@@ -47,7 +47,7 @@ Parameter '-h' shows usage information.
usage: resctrl_tests [-h] [-b "benchmark_cmd [options]"] [-t test list] [-n no_of_bits]
-b benchmark_cmd [options]: run specified benchmark for MBM, MBA and CMT default benchmark is builtin fill_buf
- -t test list: run tests specified in the test list, e.g. -t mbm, mba, cmt, cat
+ -t test list: run tests specified in the test list, e.g. -t mbm,mba,cmt,cat
-n no_of_bits: run cache tests using specified no of bits in cache bit mask
-p cpu_no: specify CPU number to run the test. 1 is default
-h: help
diff --git a/tools/testing/selftests/resctrl/resctrl_tests.c b/tools/testing/selftests/resctrl/resctrl_tests.c
index f51b5fc066a3..973f09a66e1e 100644
--- a/tools/testing/selftests/resctrl/resctrl_tests.c
+++ b/tools/testing/selftests/resctrl/resctrl_tests.c
@@ -40,7 +40,7 @@ static void cmd_help(void)
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, ");
- printf("e.g. -t mbm, mba, cmt, cat\n");
+ printf("e.g. -t mbm,mba,cmt,cat\n");
printf("\t-n no_of_bits: run cache tests using specified no of bits in cache bit mask\n");
printf("\t-p cpu_no: specify CPU number to run the test. 1 is default\n");
printf("\t-h: help\n");
@@ -173,7 +173,7 @@ int main(int argc, char **argv)
return -1;
}
- token = strtok(NULL, ":\t");
+ token = strtok(NULL, ",");
}
break;
case 'p':
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 5.12] selftests/resctrl: Fix incorrect parsing of option "-t"
2021-07-11 13:06 FAILED: patch "[PATCH] selftests/resctrl: Fix incorrect parsing of option "-t"" failed to apply to 5.12-stable tree gregkh
@ 2021-07-12 7:55 ` Xiaochen Shen
2021-07-15 10:48 ` Greg KH
0 siblings, 1 reply; 3+ messages in thread
From: Xiaochen Shen @ 2021-07-12 7:55 UTC (permalink / raw)
To: stable, gregkh, sashal
Cc: shuah, tony.luck, fenghua.yu, reinette.chatre, linux-kselftest,
linux-kernel, pei.p.jia, xiaochen.shen
commit 1421ec684a43379b2aa3cfda20b03d38282dc990 upstream.
Resctrl test suite accepts command line argument "-t" to specify the
unit tests to run in the test list (e.g., -t mbm,mba,cmt,cat) as
documented in the help.
When calling strtok() to parse the option, the incorrect delimiters
argument ":\t" is used. As a result, passing "-t mbm,mba,cmt,cat" throws
an invalid option error.
Fix this by using delimiters argument "," instead of ":\t" for parsing
of unit tests list. At the same time, remove the unnecessary "spaces"
between the unit tests in help documentation to prevent confusion.
Fixes: 790bf585b0ee ("selftests/resctrl: Add Cache Allocation Technology (CAT) selftest")
Fixes: 78941183d1b1 ("selftests/resctrl: Add Cache QoS Monitoring (CQM) selftest")
Fixes: ecdbb911f22d ("selftests/resctrl: Add MBM test")
Fixes: 034c7678dd2c ("selftests/resctrl: Add README for resctrl tests")
Cc: stable@vger.kernel.org
Signed-off-by: Xiaochen Shen <xiaochen.shen@intel.com>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
---
tools/testing/selftests/resctrl/README | 2 +-
tools/testing/selftests/resctrl/resctrl_tests.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/resctrl/README b/tools/testing/selftests/resctrl/README
index 6e5a0ff..20502cb 100644
--- a/tools/testing/selftests/resctrl/README
+++ b/tools/testing/selftests/resctrl/README
@@ -47,7 +47,7 @@ Parameter '-h' shows usage information.
usage: resctrl_tests [-h] [-b "benchmark_cmd [options]"] [-t test list] [-n no_of_bits]
-b benchmark_cmd [options]: run specified benchmark for MBM, MBA and CQM default benchmark is builtin fill_buf
- -t test list: run tests specified in the test list, e.g. -t mbm, mba, cqm, cat
+ -t test list: run tests specified in the test list, e.g. -t mbm,mba,cqm,cat
-n no_of_bits: run cache tests using specified no of bits in cache bit mask
-p cpu_no: specify CPU number to run the test. 1 is default
-h: help
diff --git a/tools/testing/selftests/resctrl/resctrl_tests.c b/tools/testing/selftests/resctrl/resctrl_tests.c
index ac22696..bd98746 100644
--- a/tools/testing/selftests/resctrl/resctrl_tests.c
+++ b/tools/testing/selftests/resctrl/resctrl_tests.c
@@ -40,7 +40,7 @@ static void cmd_help(void)
printf("\t-b benchmark_cmd [options]: run specified benchmark for MBM, MBA and CQM");
printf("\t default benchmark is builtin fill_buf\n");
printf("\t-t test list: run tests specified in the test list, ");
- printf("e.g. -t mbm, mba, cqm, cat\n");
+ printf("e.g. -t mbm,mba,cqm,cat\n");
printf("\t-n no_of_bits: run cache tests using specified no of bits in cache bit mask\n");
printf("\t-p cpu_no: specify CPU number to run the test. 1 is default\n");
printf("\t-h: help\n");
@@ -98,7 +98,7 @@ int main(int argc, char **argv)
return -1;
}
- token = strtok(NULL, ":\t");
+ token = strtok(NULL, ",");
}
break;
case 'p':
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 5.12] selftests/resctrl: Fix incorrect parsing of option "-t"
2021-07-12 7:55 ` [PATCH 5.12] selftests/resctrl: Fix incorrect parsing of option "-t" Xiaochen Shen
@ 2021-07-15 10:48 ` Greg KH
0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2021-07-15 10:48 UTC (permalink / raw)
To: Xiaochen Shen
Cc: stable, sashal, shuah, tony.luck, fenghua.yu, reinette.chatre,
linux-kselftest, linux-kernel, pei.p.jia
On Mon, Jul 12, 2021 at 03:55:23PM +0800, Xiaochen Shen wrote:
> commit 1421ec684a43379b2aa3cfda20b03d38282dc990 upstream.
>
> Resctrl test suite accepts command line argument "-t" to specify the
> unit tests to run in the test list (e.g., -t mbm,mba,cmt,cat) as
> documented in the help.
>
> When calling strtok() to parse the option, the incorrect delimiters
> argument ":\t" is used. As a result, passing "-t mbm,mba,cmt,cat" throws
> an invalid option error.
>
> Fix this by using delimiters argument "," instead of ":\t" for parsing
> of unit tests list. At the same time, remove the unnecessary "spaces"
> between the unit tests in help documentation to prevent confusion.
>
> Fixes: 790bf585b0ee ("selftests/resctrl: Add Cache Allocation Technology (CAT) selftest")
> Fixes: 78941183d1b1 ("selftests/resctrl: Add Cache QoS Monitoring (CQM) selftest")
> Fixes: ecdbb911f22d ("selftests/resctrl: Add MBM test")
> Fixes: 034c7678dd2c ("selftests/resctrl: Add README for resctrl tests")
> Cc: stable@vger.kernel.org
> Signed-off-by: Xiaochen Shen <xiaochen.shen@intel.com>
> Reviewed-by: Tony Luck <tony.luck@intel.com>
> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
> ---
> tools/testing/selftests/resctrl/README | 2 +-
> tools/testing/selftests/resctrl/resctrl_tests.c | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
Both now queued up, thanks.
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-07-15 10:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-11 13:06 FAILED: patch "[PATCH] selftests/resctrl: Fix incorrect parsing of option "-t"" failed to apply to 5.12-stable tree gregkh
2021-07-12 7:55 ` [PATCH 5.12] selftests/resctrl: Fix incorrect parsing of option "-t" Xiaochen Shen
2021-07-15 10:48 ` Greg KH
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.