@@ -11,6 +11,7 @@
struct clock_sync_context {
void *proto_data; /* time sync protocol specific data */
bool is_server; /* server side time sync role */
+ bool is_guest; /* guest or host time sync role */
struct tracefs_instance *instance; /* ftrace buffer, used for time sync events */
/* Arrays with calculated time offsets at given time */
@@ -296,7 +296,7 @@ clock_synch_delete_instance(struct tracefs_instance *inst)
tracefs_instance_free(inst);
}
-static int clock_context_init(struct tracecmd_time_sync *tsync, bool server)
+static int clock_context_init(struct tracecmd_time_sync *tsync, bool guest)
{
struct clock_sync_context *clock = NULL;
struct tsync_proto *protocol;
@@ -311,8 +311,9 @@ static int clock_context_init(struct tracecmd_time_sync *tsync, bool server)
clock = calloc(1, sizeof(struct clock_sync_context));
if (!clock)
return -1;
+ clock->is_guest = guest;
+ clock->is_server = clock->is_guest;
- clock->is_server = server;
if (get_vsocket_params(tsync->msg_handle->fd, &clock->local_cid,
&clock->local_port, &clock->remote_cid,
&clock->remote_port))
Added new parameter in timestamp synchronization context, holding the current role in the timestamp synchronization process - host or guest. Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com> --- lib/trace-cmd/include/trace-tsync-local.h | 1 + lib/trace-cmd/trace-timesync.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-)