--- a/src/oslat/oslat.c +++ b/src/oslat/oslat.c @@ -655,16 +655,10 @@ static void parse_options(int argc, char *argv[]) */ g.single_preheat_thread = true; break; - case 'v': - /* - * Because we always dump the version even before parsing options, - * what we need to do is to quit.. - */ - exit(0); - break; case 'z': g.output_omit_zero_buckets = 1; break; + case 'v': case 'h': usage(0); break; $ ./oslat -v oslat V 1.10 Usage: oslat <options> This is an OS latency detector by running busy loops on specified cores. Please run this tool using root. Available options: -b, --bucket-size Specify the number of the buckets (4-1024) -B, --bias Add a bias to all the buckets using the estimated mininum -c, --cpu-list Specify CPUs to run on, e.g. '1,3,5,7-15' -C, --cpu-main-thread Specify which CPU the main thread runs on. Default is cpu0. -D, --duration Specify test duration, e.g., 60, 20m, 2H (m/M: minutes, h/H: hours, d/D: days) -f, --rtprio Using SCHED_FIFO priority (1-99) -m, --workload-mem Size of the memory to use for the workload (e.g., 4K, 1M). Total memory usage will be this value multiplies 2*N, because there will be src/dst buffers for each thread, and N is the number of processors for testing. -s, --single-preheat Use a single thread when measuring latency at preheat stage NOTE: please make sure the CPU frequency on all testing cores are locked before using this parmater. If you don't know how to lock the freq then please don't use this parameter. -T, --trace-threshold Stop the test when threshold triggered (in us), print a marker in ftrace and stop ftrace too. -v, --version Display the version of the software. -w, --workload Specify a kind of workload, default is no workload (options: no, memmove) -z, --zero-omit Don't display buckets in the output histogram if all zeros. The other tests print also the usage text which included the version if you provided '--version'. So this would make it behave in the same way. Good enough?