trace-cmd: Simplify and fix memory leaks in tracecmd_msg_collect_data

This patch addresses leaking tracecmd_msg messages in tracecmd_msg_collect_data.

It also splits out tracecmd_msg_read_data from tracecmd_msg_collect_data which
only reads incomming data and doesn't wait for a final MSG_CLOSE message and is
used by the VM tracing agent.

Signed-off-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2 files changed