|
@@ -1274,6 +1274,8 @@ static struct record record = {
|
|
|
const char record_callchain_help[] = CALLCHAIN_RECORD_HELP
|
|
|
"\n\t\t\t\tDefault: fp";
|
|
|
|
|
|
+static bool dry_run;
|
|
|
+
|
|
|
/*
|
|
|
* XXX Will stay a global variable till we fix builtin-script.c to stop messing
|
|
|
* with it and switch to use the library functions in perf_evlist that came
|
|
@@ -1393,6 +1395,8 @@ struct option __record_options[] = {
|
|
|
"append timestamp to output filename"),
|
|
|
OPT_BOOLEAN(0, "switch-output", &record.switch_output,
|
|
|
"Switch output when receive SIGUSR2"),
|
|
|
+ OPT_BOOLEAN(0, "dry-run", &dry_run,
|
|
|
+ "Parse options then exit"),
|
|
|
OPT_END()
|
|
|
};
|
|
|
|
|
@@ -1462,6 +1466,9 @@ int cmd_record(int argc, const char **argv, const char *prefix __maybe_unused)
|
|
|
if (err)
|
|
|
return err;
|
|
|
|
|
|
+ if (dry_run)
|
|
|
+ return 0;
|
|
|
+
|
|
|
err = bpf__setup_stdout(rec->evlist);
|
|
|
if (err) {
|
|
|
bpf__strerror_setup_stdout(rec->evlist, err, errbuf, sizeof(errbuf));
|