Re: [PATCH v5 2/6] perf record: Split output into multiple files via '--switch-output'
From: Jiri Olsa
Date: Wed Apr 20 2016 - 03:54:19 EST
On Mon, Apr 18, 2016 at 02:55:28PM +0000, Wang Nan wrote:
SNIP
> "Record build-id of all DSOs regardless of hits"),
> OPT_BOOLEAN(0, "timestamp-filename", &record.timestamp_filename,
> "append timestamp to output filename"),
> + OPT_BOOLEAN(0, "switch-output", &record.switch_output,
> + "Switch output when receive SIGUSR2"),
> OPT_END()
> };
>
> @@ -1413,10 +1440,13 @@ out_symbol_exit:
>
> static void snapshot_sig_handler(int sig __maybe_unused)
> {
> - if (!auxtrace_snapshot_is_ready())
> - return;
> - auxtrace_snapshot_toggle();
> - auxtrace_record__snapshot_started = 1;
> - if (auxtrace_record__snapshot_start(record.itr))
> - auxtrace_snapshot_error();
> + if (auxtrace_snapshot_is_ready()) {
> + auxtrace_snapshot_toggle();
> + auxtrace_record__snapshot_started = 1;
> + if (auxtrace_record__snapshot_start(record.itr))
> + auxtrace_snapshot_error();
Adrian,
I know it's out of the scope of this patchset, however
should auxtrace_record__snapshot_start call be in the
__cmd_record's loop path rather then in here in signal?
thanks,
jirka