trace-cmd: Minor updates to tracecmd_unpair_peer() function
cover trace-cmd: Minor updates to tracecmd_unpair_peer() function
Some minor clean ups of Tzvetomir's code for tracecmd_unpair_peer().
Instead of asking Tzvetomir to send another version, as these were minor changes, I just decided to do it myself ;-)
Steven Rostedt (VMware) (2):
trace-cmd: Fix cut and paste header comment of tracecmd_unpair_peer()
trace-cmd: Make tracecmd_unpair_peer() return void
----
include/trace-cmd/trace-cmd.h | 2 +- lib/trace-cmd/trace-input.c | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-)
PATCH 1/2 trace-cmd: Fix cut and paste header comment of tracecmd_unpair_peer()
From: "Steven Rostedt (VMware)" <[email protected]>
The comment describing tracecmd_unpair_peer() is the same as the comment for tracecmd_pair_peer(). Update it to describe the unpair function.
--- lib/trace-cmd/trace-input.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
lib/trace-cmd/trace-input.c +2 -3
@@ -3233,9 +3233,8 @@ fail: }/** -* tracecmd_unpair_peer - Link a tracing peer to this handle +* tracecmd_unpair_peer - Remove the linked tracing peer of this handle * @handle: input handle for the trace.dat file -* @peer: input handle for the tracing peer * * When tracing host and one or more guest machines at the same time, * guest and host are tracing peers. There is information in both trace
@@ -3244,7 +3243,7 @@ fail:* merging the events. When the host is set as a tracing peer to the guest, then * the timestamps of guest's events are recalculated to match the host event's time * -* Returns 1, if a peer is already paired, -1 in case of an error or 0 otherwise +* This removes any peer that is linked to the @handle. */ int tracecmd_unpair_peer (struct tracecmd_input *handle) {
Signature · 1 line
2.25.1
PATCH 2/2 trace-cmd: Make tracecmd_unpair_peer() return void
In reply to Steven RostedtFrom: "Steven Rostedt (VMware)" <[email protected]>
The return value of tracecmd_unpair_peer() is useless. Just make it a void function call.
--- include/trace-cmd/trace-cmd.h | 2 +- lib/trace-cmd/trace-input.c | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-)
include/trace-cmd/trace-cmd.h +1 -1
@@ -147,7 +147,7 @@ struct tracecmd_input *tracecmd_open_head(const char *file);struct tracecmd_input *tracecmd_open_fd (int fd);int tracecmd_pair_peer (struct tracecmd_input *handle,struct tracecmd_input *peer); -int tracecmd_unpair_peer (struct tracecmd_input *handle); +void tracecmd_unpair_peer (struct tracecmd_input *handle);void tracecmd_ref (struct tracecmd_input *handle);void tracecmd_close (struct tracecmd_input *handle);int tracecmd_read_headers (struct tracecmd_input *handle);
lib/trace-cmd/trace-input.c +2 -4
@@ -3245,18 +3245,16 @@ fail:* * This removes any peer that is linked to the @handle. */ -int tracecmd_unpair_peer (struct tracecmd_input *handle) +void tracecmd_unpair_peer (struct tracecmd_input *handle) {if (!handle) -return -1 ; +return ;if (handle->host.peer_data) {tracecmd_close (handle->host.peer_data); handle->host.peer_data =NULL ;tsync_check_enable (handle); } - -return 0 ; }/**
Signature · 1 line
2.25.1
Quoted 11 lines · Steven Rostedt
Some minor clean ups of Tzvetomir's code for
tracecmd_unpair_peer().Instead of asking Tzvetomir to send another version, as these were minor changes, I just decided to do it myself ;-)
Steven Rostedt (VMware) (2):
trace-cmd: Fix cut and paste header comment oftracecmd_unpair_peer()
trace-cmd: Maketracecmd_unpair_peer()return void
Thanks, Steven!
Quoted 4 lines
----
include/trace-cmd/trace-cmd.h | 2 +- lib/trace-cmd/trace-input.c | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-)
Signature · 2 lines
Tzvetomir (Ceco) Stoyanov VMware Open Source Technology Center