trace-cmd stream: Add a flush signal to kick the output

Have trace-cmd stream periodically signal the recorder tasks to flush some
output, otherwise it will look empty for a long time (especially with the
default setting of a 50 percent buffering, where the ring buffers will not
return read until they are half full).

Add a "finish" flag to tracecmd_flush_recording() that will keep the old
behavior when set, but when not set, it will only do a single
tracefs_cpu_flush() that will output some data, but not all of it.

Use the SIGUSR2 to signal the recorder tasks to do the flush.

Link: https://lore.kernel.org/linux-trace-devel/20230106183930.12565-4-rostedt@goodmis.org

Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
3 files changed