.PP
\fB--no-perf\fP Disable all the uses of the perf API.
.PP
-\fB--force\fPForce turbostat to run on an unsupported platform (minimal defaults).
+\fB--force\fP Force turbostat to run on an unsupported platform (minimal defaults).
.PP
\fB--interval seconds\fP overrides the default 5.0 second measurement interval.
.PP
\fB--num_iterations num\fP number of the measurement iterations.
.PP
+\fB--header_iterations num\fP print header every num iterations.
+.PP
\fB--out output_file\fP turbostat output is written to the specified output_file.
The file is truncated if it already exists, and it is created if it does not exist.
.PP
* Parse some options early, because they may make other options invalid,
* like adding the MSR counter with --add and at the same time using --no-msr.
*/
- while ((opt = getopt_long_only(argc, argv, "+MPn:", long_options, &option_index)) != -1) {
+ while ((opt = getopt_long_only(argc, argv, "+:MP", long_options, &option_index)) != -1) {
switch (opt) {
case 'M':
no_msr = 1;
}
optind = 0;
- while ((opt = getopt_long_only(argc, argv, "+C:c:Dde:hi:Jn:o:qMST:v", long_options, &option_index)) != -1) {
+ while ((opt = getopt_long_only(argc, argv, "+C:c:Dde:hi:Jn:N:o:qMST:v", long_options, &option_index)) != -1) {
switch (opt) {
case 'a':
parse_add_command(optarg);
}
break;
case 'h':
- default:
help();
exit(1);
case 'i':
num_iterations = strtoul(optarg, NULL, 0);
errno = 0;
- if (errno || num_iterations == 0) {
- fprintf(outf, "invalid iteration count: %s\n", optarg);
- exit(2);
- }
+ if (errno || num_iterations == 0)
+ errx(-1, "invalid iteration count: %s", optarg);
break;
case 'N':
header_iterations = strtoul(optarg, NULL, 0);
errno = 0;
- if (errno || header_iterations == 0) {
- fprintf(outf, "invalid header iteration count: %s\n", optarg);
- exit(2);
- }
+ if (errno || header_iterations == 0)
+ errx(-1, "invalid header iteration count: %s", optarg);
break;
case 's':
/*
print_version();
exit(0);
break;
+ default:
+ help();
+ exit(1);
}
}
}