@@ -974,7 +974,6 @@ int tracecmd_write_guest_time_shift(struct tracecmd_output *handle,
if (i < tsync->vcpu_count)
goto out;
tracecmd_add_option_v(handle, TRACECMD_OPTION_TIME_SHIFT, vector, vcount);
- tracecmd_append_options(handle);
#ifdef TSYNC_DEBUG
if (count > 1)
printf("Got %d timestamp synch samples for guest %s in %lld ns trace\n\r",
@@ -681,6 +681,7 @@ static void host_tsync_complete(struct buffer_instance *instance)
if (!handle)
die("cannot create output handle");
tracecmd_write_guest_time_shift(handle, instance->tsync);
+ tracecmd_append_options(handle);
tracecmd_output_close(handle);
}
Moved the logic for appending new options into guest trace file from tracecmd_write_guest_time_shift() to host_tsync_complete() context. The guest time shift may not be the only option to append, the right place for this logic is when the tracing session is completed. Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com> --- lib/trace-cmd/trace-timesync.c | 1 - tracecmd/trace-record.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-)