tools/sched_ext: Clean up unused getopt flags
cover tools/sched_ext: Clean up unused getopt flags
This series removes unused option characters from the getopt() strings in scx_central and scx_sdt.
These flags ('-p' and '-f' respectively) were defined in the optstring but not implemented in the switch logic or documented in the help text. Removing them ensures consistency and prevents user confusion when providing these invalid arguments.
Thanks,
cheng-yang
---
Cheng-Yang Chou (2):
tools/sched_ext: scx_central: Remove unused '-p' option tools/sched_ext: scx_sdt: Remove unused '-f' option
tools/sched_ext/scx_central.c | 2 +- tools/sched_ext/scx_sdt.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.48.1
PATCH 1/2 tools/sched_ext: scx_central: Remove unused '-p' option
The '-p' option is defined in getopt() but not handled in the switch statement or documented in the help text. Providing '-p' currently triggers the default error path.
Remove it to sync the optstring with the actual implementation.
--- tools/sched_ext/scx_central.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/sched_ext/scx_central.c +1 -1
@@ -66,7 +66,7 @@ int main(int argc, char **argv)assert (skel->rodata->nr_cpu_ids >0 );assert (skel->rodata->nr_cpu_ids <=INT32_MAX ); -while ((opt =getopt (argc, argv,"s:c:pvh" )) !=-1 ) { +while ((opt =getopt (argc, argv,"s:c:vh" )) !=-1 ) {switch (opt) {case 's' : skel->rodata->slice_ns =strtoull (optarg,NULL ,0 ) *1000 ;
Signature · 1 line
2.48.1
PATCH 2/2 tools/sched_ext: scx_sdt: Remove unused '-f' option
In reply to Cheng-Yang ChouThe '-f' option is defined in getopt() but not handled in the switch statement or documented in the help text. Providing '-f' currently triggers the default error path.
Remove it to sync the optstring with the actual implementation.
--- tools/sched_ext/scx_sdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/sched_ext/scx_sdt.c +1 -1
@@ -54,7 +54,7 @@ int main(int argc, char **argv) optind =1 ; skel =SCX_OPS_OPEN (sdt_ops, scx_sdt); -while ((opt =getopt (argc, argv,"fvh" )) !=-1 ) { +while ((opt =getopt (argc, argv,"vh" )) !=-1 ) {switch (opt) {case 'v' : verbose = true;
Signature · 1 line
2.48.1
Tejun Heo
reviewerQuoted 3 lines
Cheng-Yang Chou (2):
tools/sched_ext:scx_central: Remove unused '-p' optiontools/sched_ext:scx_sdt: Remove unused '-f' option
Applied 1-2 to sched_ext/for-7.0-fixes.
Thanks.
--
tejun