Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7472547rwd; Tue, 6 Jun 2023 11:10:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7IqRoFLeXbcF7lzrMhNVeoGJoI1Q/1+mLUOaHUi/hG7NonkaDgpyhLpcKpF13RalicV6BW X-Received: by 2002:a05:6a00:3a0f:b0:654:3dac:f107 with SMTP id fj15-20020a056a003a0f00b006543dacf107mr1251754pfb.4.1686075004060; Tue, 06 Jun 2023 11:10:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686075004; cv=none; d=google.com; s=arc-20160816; b=KfPdAE/xfWMQ9yb7XgtprBYy+GKnfxESK0v2F2lDuRLaNnZRYGomk2ZNM4rhi5PjOB RAMwpPO9cdudzeqccmkaoRK8TV6VX8GIIPCXfA3KVWxdUan8l8JqU2hV/Dx5nVXoaZuH 16d1FrnDeeCHM9CwfpFW5v2XojPz9NyHNNvjYOd3zEBRcoUZqp5K4wVvD+dW08NGK2UC nEPPnRdDwSu6lI1rq8OaOUm7PYIzNAgktJUhFFzl/lGDe72ginPZo7mIcHqGKKHBByY3 /+IlxzwfyhIVvS0w6qxGrVqVbPxHXebPLqFPz7jbwZ9LfGvGh1b5OtPtkhbjQIDXRa6Z sW5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=56IFcbaoOJA/Vk1vLHprukilKFI7OAlY/kSu28sS3xU=; b=sUrMEsYmT8IlZR0S/e546PHcCQTc9PkfM9C6WAknVy2NkeHBjVRGfkw9iIuHxFqWkX a9GzSf6EmKbn82CNl+mvPhP/UWiE2qEiriHIef8E3/MR5mmb47GVXyYBlzJMivyd7BFQ aHT2x5kud25cEOQXRGn8C0coFlrMk1Vso5V/k1hPjND76TQ7AJS5m1yxwEQ+zdItGiE6 qckgVxDdvajypcT1BscGRSdxdu4XKrc7tKwlVvG+FI+LqS1BuhRNdLjocYy0akxWGKLd BISy5ZGX/j20j954vZpHATcp78J2OZMWkYPiV4rVE72yXlpPVztUjHsd00cnb/Db+7os I0lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NwFIFNzw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a30-20020a63705e000000b0054290a07fbbsi7557561pgn.324.2023.06.06.11.09.50; Tue, 06 Jun 2023 11:10:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NwFIFNzw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238777AbjFFRmi (ORCPT + 99 others); Tue, 6 Jun 2023 13:42:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238691AbjFFRmg (ORCPT ); Tue, 6 Jun 2023 13:42:36 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71F57E47; Tue, 6 Jun 2023 10:42:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 09FE260BC8; Tue, 6 Jun 2023 17:42:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 027BBC433A1; Tue, 6 Jun 2023 17:42:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1686073354; bh=W/KDPZOxJk5tdqnBucNrlj7mWSLSVWai/QXp3tQYGig=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NwFIFNzwVrzuqnOfqFLrRiZ8nu8sF/hLe423ENSXT4SfXSjaRLta76CHHj9BBsY+G hTpgBZCLcw6OOt7cHdxIxuqz3sVaMRykM5mvFwQYSfYlwdpbLApnZR5PuXxPMq6SFn jS77FMll5OAVcQrIpvh6ffkxg7rPofdXfLpTKDWY= Date: Tue, 6 Jun 2023 19:42:31 +0200 From: Greg KH To: Ekansh Gupta Cc: srinivas.kandagatla@linaro.org, linux-arm-msm@vger.kernel.org, ekangupt@qti.qualcomm.com, linux-kernel@vger.kernel.org, bkumar@qti.qualcomm.com, fastrpc.upstream@qti.qualcomm.com Subject: Re: [PATCH v1] misc: fastrpc: Collect driver-remote processor transaction logs Message-ID: <2023060608-junction-conclude-f607@gregkh> References: <1686070555-11154-1-git-send-email-quic_ekangupt@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1686070555-11154-1-git-send-email-quic_ekangupt@quicinc.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 06, 2023 at 10:25:55PM +0530, Ekansh Gupta wrote: > Add changes to collect driver-remote processor rpmsg transaction > logs. These logs will carry payload information for the rpmsg message > instance. These logs are channel specific and are collected in > channel context structure. > > These rpmsg transaction logs can help in improving debugability as > all requests from processes are getting captured in channel context > structure. > > Signed-off-by: Ekansh Gupta > --- > drivers/misc/fastrpc.c | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 88 insertions(+) > > diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c > index 30d4d04..6447cee 100644 > --- a/drivers/misc/fastrpc.c > +++ b/drivers/misc/fastrpc.c > @@ -104,6 +104,9 @@ > > #define miscdev_to_fdevice(d) container_of(d, struct fastrpc_device, miscdev) > > +/* Length of glink transaction history to store */ > +#define GLINK_MSG_HISTORY_LEN (128) > + > static const char *domains[FASTRPC_DEV_MAX] = { "adsp", "mdsp", > "sdsp", "cdsp"}; > struct fastrpc_phy_page { > @@ -181,6 +184,28 @@ struct fastrpc_invoke_rsp { > int retval; /* invoke return value */ > }; > > +struct fastrpc_tx_msg { > + struct fastrpc_msg msg; /* Msg sent to remote subsystem */ > + int rpmsg_send_err; /* rpmsg error */ > + s64 ns; /* Timestamp (in ns) of msg */ > +}; > + > +struct fastrpc_rx_msg { > + struct fastrpc_invoke_rsp rsp; /* Response from remote subsystem */ > + s64 ns; /* Timestamp (in ns) of response */ > +}; > + > +struct fastrpc_rpmsg_log { > + u32 tx_index; /* Current index of 'tx_msgs' array */ > + u32 rx_index; /* Current index of 'rx_msgs' array */ > + /* Rolling history of messages sent to remote subsystem */ > + struct fastrpc_tx_msg tx_msgs[GLINK_MSG_HISTORY_LEN]; > + /* Rolling history of responses from remote subsystem */ > + struct fastrpc_rx_msg rx_msgs[GLINK_MSG_HISTORY_LEN]; > + spinlock_t tx_lock; > + spinlock_t rx_lock; Why roll your own ring-buffer logic instead of using one of the many offerings that the kernel already provides for you? thanks, greg k-h