From: "Steven Rostedt (Google)" <rostedt@xxxxxxxxxxx> Currently the trace-cmd agent is expected to run on the guest with the host running the recorder. There is a lot of assumptions throughout the code that expects this. Rearrange the code and allow the guest to be the recorder and the host act as an agent via the -P (proxy) option. The guest record can call the agent proxy on the host with the --proxy option. Currently this does not handle the host being a proxy for other guests, but that will come later. For now, this code will allow the host to run the agent and handle the time synchronizations needed between the two (and pass the data back up to the guest). The siblings will be another project, but for now we at least have the host agent working with the guest and having the timings all in sync. Joel Fernandes (1): trace-cmd: Move trace_msg cache file to memfd Steven Rostedt (Google) (25): trace-cmd record: Make start_threads() static trace-cmd: Move add_guest_info() into trace-vm.c trace-cmd: Simplify add_guest() trace-cmd: Move find_pid_by_cid() into add_guest() trace-cmd: Move find_tasks() into add_guest() trace-cmd Makefile: Change test-build to link as well trace-cmd agent: Test if memfd_create() is available trace-cmd: Add kernel-doc to trace_record_agent() trace-cmd: Move selecting tsync protocol out of tracecmd_tsync_with_host() trace-cmd: Move accepting tsync connection out of tracecmd_tsync_with_host() trace-cmd: Have get_vsocket_params() cid and rcid parameters be optional trace-cmd agent: Add trace_tsync_as_guest() helper function trace-cmd record: Pass cpu_count instead of an instance to stop_mapping_vcpus() trace-cmd record: Add trace_tsync_as_host() helper trace-cmd: Move tsync as guest and host helpers into trace-tsync.c trace-cmd msg: Add PROXY communication trace-cmd: Add agent proxy communications between record and agent trace-cmd msg: Keep track of offset of flushed cache trace-cmd library: Add tracecmd_prepare_options() trace-cmd library: Add tracecmd_msg_flush_data() trace-cmd agent proxy: Allow agent to send more meta data after trace trace-cmd agent proxy: Add the remote guest cid to guest list trace-cmd agent-proxy: Send options at the end of the trace trace-cmd: Have the guest structure hold guest trace_id trace-cmd: Have the host agent proxy control the time synchronization Makefile | 13 +- .../include/private/trace-cmd-private.h | 35 +- lib/trace-cmd/include/trace-cmd-local.h | 2 + lib/trace-cmd/trace-msg.c | 292 ++++++++++-- lib/trace-cmd/trace-output.c | 243 +++++++++- lib/trace-cmd/trace-timesync.c | 72 +-- tracecmd/Makefile | 1 + tracecmd/include/trace-local.h | 24 +- tracecmd/trace-agent.c | 130 ++++- tracecmd/trace-record.c | 444 +++++++----------- tracecmd/trace-tsync.c | 244 ++++++++++ tracecmd/trace-vm.c | 138 +++++- tracecmd/trace-vsock.c | 32 +- 13 files changed, 1205 insertions(+), 465 deletions(-) create mode 100644 tracecmd/trace-tsync.c -- 2.35.1