From patchwork Mon Apr 13 20:53:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11486235 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 43FA714DD for ; Mon, 13 Apr 2020 20:55:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2BE3920735 for ; Mon, 13 Apr 2020 20:55:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388526AbgDMUzX (ORCPT ); Mon, 13 Apr 2020 16:55:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:35718 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388620AbgDMUzW (ORCPT ); Mon, 13 Apr 2020 16:55:22 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7671D20663 for ; Mon, 13 Apr 2020 20:55:22 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.93) (envelope-from ) id 1jO66z-004Epg-CE for linux-trace-devel@vger.kernel.org; Mon, 13 Apr 2020 16:55:21 -0400 Message-Id: <20200413205521.252964374@goodmis.org> User-Agent: quilt/0.65 Date: Mon, 13 Apr 2020 16:53:47 -0400 From: Steven Rostedt To: linux-trace-devel@vger.kernel.org Subject: [PATCH 1/2] trace-cmd: Fix cut and paste header comment of tracecmd_unpair_peer() References: <20200413205346.028742220@goodmis.org> MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org From: "Steven Rostedt (VMware)" 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) --- 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) { From patchwork Mon Apr 13 20:53:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 11486237 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7AEB81871 for ; Mon, 13 Apr 2020 20:55:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 62EDA20735 for ; Mon, 13 Apr 2020 20:55:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388620AbgDMUzY (ORCPT ); Mon, 13 Apr 2020 16:55:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:35720 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388621AbgDMUzW (ORCPT ); Mon, 13 Apr 2020 16:55:22 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9001920732 for ; Mon, 13 Apr 2020 20:55:22 +0000 (UTC) Received: from rostedt by gandalf.local.home with local (Exim 4.93) (envelope-from ) id 1jO66z-004EqD-Gr for linux-trace-devel@vger.kernel.org; Mon, 13 Apr 2020 16:55:21 -0400 Message-Id: <20200413205521.400302580@goodmis.org> User-Agent: quilt/0.65 Date: Mon, 13 Apr 2020 16:53:48 -0400 From: Steven Rostedt To: linux-trace-devel@vger.kernel.org Subject: [PATCH 2/2] trace-cmd: Make tracecmd_unpair_peer() return void References: <20200413205346.028742220@goodmis.org> MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org From: "Steven Rostedt (VMware)" The return value of tracecmd_unpair_peer() is useless. Just make it a void function call. Signed-off-by: Steven Rostedt (VMware) --- 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; } /**