diff mbox series

[v28,1/8] trace-cmd: Save command lines in VM agent

Message ID 20210208061743.510964-2-tz.stoyanov@gmail.com (mailing list archive)
State Accepted
Headers show
Series Timestamp synchronization of host - guest tracing session | expand

Commit Message

Tzvetomir Stoyanov (VMware) Feb. 8, 2021, 6:17 a.m. UTC
Command lines were not saved in the guest tracing file, due to bug
inrtoduced by commit:
https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/commit/?id=1eea02a4bef10507d157489a1ee97f273db7b319

Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
---
 lib/trace-cmd/include/private/trace-cmd-private.h | 3 +++
 lib/trace-cmd/trace-output.c                      | 4 ++--
 tracecmd/trace-record.c                           | 1 +
 3 files changed, 6 insertions(+), 2 deletions(-)

Comments

Steven Rostedt Feb. 17, 2021, 8:55 p.m. UTC | #1
On Mon,  8 Feb 2021 08:17:36 +0200
"Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com> wrote:

> Command lines were not saved in the guest tracing file, due to bug
> inrtoduced by commit:
> https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/commit/?id=1eea02a4bef10507d157489a1ee97f273db7b319

I already pulled this in (not really noticing this link), but for next
time, the proper way of doing this is to add a "Fixes:" tag.

Fixes: 1eea02a4bef ("trace-cmd: Add missing APIs to libtracecmd main man page")

This way, we can easily add a search to the git history looking for fixes
that should be backported to a previous release.

-- Steve


> 
> Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
> ---
>
diff mbox series

Patch

diff --git a/lib/trace-cmd/include/private/trace-cmd-private.h b/lib/trace-cmd/include/private/trace-cmd-private.h
index a08566e6..d370fa8b 100644
--- a/lib/trace-cmd/include/private/trace-cmd-private.h
+++ b/lib/trace-cmd/include/private/trace-cmd-private.h
@@ -503,4 +503,7 @@  void *tracecmd_record_page(struct tracecmd_input *handle,
 void *tracecmd_record_offset(struct tracecmd_input *handle,
 			     struct tep_record *record);
 
+int save_tracing_file_data(struct tracecmd_output *handle,
+			   const char *filename);
+
 #endif /* _TRACE_CMD_PRIVATE_H */
diff --git a/lib/trace-cmd/trace-output.c b/lib/trace-cmd/trace-output.c
index 032c8ff4..4ffb4d47 100644
--- a/lib/trace-cmd/trace-output.c
+++ b/lib/trace-cmd/trace-output.c
@@ -797,8 +797,8 @@  static int read_ftrace_printk(struct tracecmd_output *handle)
 	return -1;
 }
 
-static int save_tracing_file_data(struct tracecmd_output *handle,
-						const char *filename)
+int save_tracing_file_data(struct tracecmd_output *handle,
+			   const char *filename)
 {
 	unsigned long long endian8;
 	char *file = NULL;
diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c
index a1c4e919..a0a0b8b5 100644
--- a/tracecmd/trace-record.c
+++ b/tracecmd/trace-record.c
@@ -3770,6 +3770,7 @@  static void setup_agent(struct buffer_instance *instance,
 	network_handle = tracecmd_create_init_fd_msg(instance->msg_handle,
 						     listed_events);
 	add_options(network_handle, ctx);
+	save_tracing_file_data(network_handle, "saved_cmdlines");
 	tracecmd_write_cpus(network_handle, instance->cpu_count);
 	tracecmd_write_options(network_handle);
 	tracecmd_msg_finish_sending_data(instance->msg_handle);