* [PATCH 0/2] trace-cmd: Minor updates to tracecmd_unpair_peer() function
@ 2020-04-13 20:53 Steven Rostedt
2020-04-13 20:53 ` [PATCH 1/2] trace-cmd: Fix cut and paste header comment of tracecmd_unpair_peer() Steven Rostedt
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Steven Rostedt @ 2020-04-13 20:53 UTC (permalink / raw)
To: linux-trace-devel
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(-)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] trace-cmd: Fix cut and paste header comment of tracecmd_unpair_peer()
2020-04-13 20:53 [PATCH 0/2] trace-cmd: Minor updates to tracecmd_unpair_peer() function Steven Rostedt
@ 2020-04-13 20:53 ` Steven Rostedt
2020-04-13 20:53 ` [PATCH 2/2] trace-cmd: Make tracecmd_unpair_peer() return void Steven Rostedt
2020-04-14 14:15 ` [PATCH 0/2] trace-cmd: Minor updates to tracecmd_unpair_peer() function Tzvetomir Stoyanov
2 siblings, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2020-04-13 20:53 UTC (permalink / raw)
To: linux-trace-devel
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
The comment describing tracecmd_unpair_peer() is the same as the comment for
tracecmd_pair_peer(). Update it to describe the unpair function.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
lib/trace-cmd/trace-input.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/lib/trace-cmd/trace-input.c b/lib/trace-cmd/trace-input.c
index c19aa4005767..50d52f49a8f0 100644
--- a/lib/trace-cmd/trace-input.c
+++ b/lib/trace-cmd/trace-input.c
@@ -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)
{
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] trace-cmd: Make tracecmd_unpair_peer() return void
2020-04-13 20:53 [PATCH 0/2] trace-cmd: Minor updates to tracecmd_unpair_peer() function Steven Rostedt
2020-04-13 20:53 ` [PATCH 1/2] trace-cmd: Fix cut and paste header comment of tracecmd_unpair_peer() Steven Rostedt
@ 2020-04-13 20:53 ` Steven Rostedt
2020-04-14 14:15 ` [PATCH 0/2] trace-cmd: Minor updates to tracecmd_unpair_peer() function Tzvetomir Stoyanov
2 siblings, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2020-04-13 20:53 UTC (permalink / raw)
To: linux-trace-devel
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
The return value of tracecmd_unpair_peer() is useless. Just make it a void
function call.
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
include/trace-cmd/trace-cmd.h | 2 +-
lib/trace-cmd/trace-input.c | 6 ++----
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/include/trace-cmd/trace-cmd.h b/include/trace-cmd/trace-cmd.h
index 76fcffaea235..f3c95f3087a2 100644
--- a/include/trace-cmd/trace-cmd.h
+++ b/include/trace-cmd/trace-cmd.h
@@ -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);
diff --git a/lib/trace-cmd/trace-input.c b/lib/trace-cmd/trace-input.c
index 50d52f49a8f0..55c3d80a6057 100644
--- a/lib/trace-cmd/trace-input.c
+++ b/lib/trace-cmd/trace-input.c
@@ -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;
}
/**
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] trace-cmd: Minor updates to tracecmd_unpair_peer() function
2020-04-13 20:53 [PATCH 0/2] trace-cmd: Minor updates to tracecmd_unpair_peer() function Steven Rostedt
2020-04-13 20:53 ` [PATCH 1/2] trace-cmd: Fix cut and paste header comment of tracecmd_unpair_peer() Steven Rostedt
2020-04-13 20:53 ` [PATCH 2/2] trace-cmd: Make tracecmd_unpair_peer() return void Steven Rostedt
@ 2020-04-14 14:15 ` Tzvetomir Stoyanov
2 siblings, 0 replies; 4+ messages in thread
From: Tzvetomir Stoyanov @ 2020-04-14 14:15 UTC (permalink / raw)
To: Steven Rostedt; +Cc: linux-trace-devel
On Mon, Apr 13, 2020 at 11:53 PM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> 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
>
Thanks, Steven!
Reviewed-by: Tzvetomir (VMware) Stoyanov <tz.stoyanov@gmail.com>
> ----
> include/trace-cmd/trace-cmd.h | 2 +-
> lib/trace-cmd/trace-input.c | 11 ++++-------
> 2 files changed, 5 insertions(+), 8 deletions(-)
--
Tzvetomir (Ceco) Stoyanov
VMware Open Source Technology Center
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-04-14 14:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-13 20:53 [PATCH 0/2] trace-cmd: Minor updates to tracecmd_unpair_peer() function Steven Rostedt
2020-04-13 20:53 ` [PATCH 1/2] trace-cmd: Fix cut and paste header comment of tracecmd_unpair_peer() Steven Rostedt
2020-04-13 20:53 ` [PATCH 2/2] trace-cmd: Make tracecmd_unpair_peer() return void Steven Rostedt
2020-04-14 14:15 ` [PATCH 0/2] trace-cmd: Minor updates to tracecmd_unpair_peer() function Tzvetomir Stoyanov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).