Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8367788ybl; Thu, 16 Jan 2020 15:28:35 -0800 (PST) X-Google-Smtp-Source: APXvYqxWehyaUNgF54ZzaLK84yh2OQGxWnewl26GP7kqSSO3mEe5mzneztTS/CWmy5bbnF44gPSo X-Received: by 2002:a9d:6c0d:: with SMTP id f13mr3831016otq.354.1579217315525; Thu, 16 Jan 2020 15:28:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579217315; cv=none; d=google.com; s=arc-20160816; b=YqN09rYnAYKj7rWG7TiD0gtp5eTupPtRAHRpSefoaFGCUd+0rhh+CYDD/0K9BRmPcV 08ohAlyqLKljdzSW28XSAPW8aY+TTlzHp5Xmm/C/w0jhI+K1+mDo/DbA0eSUdl32UKRG A+3lNhgv24tjUeCnHKoTCMHK+iNMNejUrhRvOsqEp7Oyl8uw+bNzrGkHPMvNfpG//cdl kHr//rER4Am8F7qq731WgKSZVaSfRY95W9egaZ0qxepEYE4ZNCP0h/tYUAxAtRZT546D b/0aL36IRv9qBns/UCAdKQqKK5wgekVCtVZd7nI1+KZJEJ3DZ8QKxxeW/h0dH44Ck3yC vIPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature; bh=JFrlslqOPY+Or7IJG3FwTPI5aLmDB7PbhDVncuMzPps=; b=fe4XNtrUpt4bLdYaztx8TCqtyPzNDX62a2HEjUUzHO7Sb55zmlHDtEF63LKSpRm8jx HtodYajzFiiqOcnwzVOFiP9K4wiyqzD1MNuiDKavl40tvL8UGXu5xTA+AreUiqMaNSKl t7sxPiU7rV53paBL93I+fFkAX5j0h5xlPBeIwRtERolFSIiByK/1vkqIBXJq/5cSW/43 6J0jupFp7i6ixoG+4bpJd1VObs3zOju8IMP9AMFnJuf21mG6Pl9PahF1LUz3dgKicmYI fJ38tLWP9L/EaGAvxlJKn3rLW1J36HoovmBfEXFXrmJRW9s4TmowXVous3c1xfOjZ0UU 8vPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=i8qFqN8x; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e1si14003526otj.276.2020.01.16.15.28.23; Thu, 16 Jan 2020 15:28:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=i8qFqN8x; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390228AbgAPXDV (ORCPT + 99 others); Thu, 16 Jan 2020 18:03:21 -0500 Received: from mail26.static.mailgun.info ([104.130.122.26]:32266 "EHLO mail26.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730322AbgAPXDV (ORCPT ); Thu, 16 Jan 2020 18:03:21 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1579215800; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=JFrlslqOPY+Or7IJG3FwTPI5aLmDB7PbhDVncuMzPps=; b=i8qFqN8xGkdJnKxH3CevhsepuDKcJl+1qtTgqRLwM0cnICd8ArqFFbzgCmBPN0xbIedKWjoo YYmL9lSnoHZWLghTuQPcw55pLBy9t3oKFdZgjJjznmrq9ZmRECbea6YCTobuYlhzVR/ZYLrq 1E/i6DGZm/hvC2zs7eGq8xSk4Gc= X-Mailgun-Sending-Ip: 104.130.122.26 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e20ebb7.7fa929ca3e30-smtp-out-n02; Thu, 16 Jan 2020 23:03:19 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 4A7D4C447AB; Thu, 16 Jan 2020 23:03:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from [10.46.161.159] (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: asutoshd) by smtp.codeaurora.org (Postfix) with ESMTPSA id 9A8A6C433A2; Thu, 16 Jan 2020 23:03:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 9A8A6C433A2 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=asutoshd@codeaurora.org Subject: Re: [PATCH v1 1/1] scsi: ufs: Add command logging infrastructure To: Bjorn Andersson , cang@codeaurora.org Cc: Avri Altman , "Winkler, Tomas" , nguyenb@codeaurora.org, rnayak@codeaurora.org, linux-scsi@vger.kernel.org, kernel-team@android.com, saravanak@google.com, salyzyn@google.com, Alim Akhtar , Pedro Sousa , "James E.J. Bottomley" , "Martin K. Petersen" , Evan Green , Janek Kotas , Stanley Chu , Bean Huo , Subhash Jadavani , Arnd Bergmann , open list References: <1571808560-3965-1-git-send-email-cang@codeaurora.org> <5B8DA87D05A7694D9FA63FD143655C1B9DCF0AFE@hasmsx108.ger.corp.intel.com> <01eb3c55e35738f2853fbc7175a12eaa@codeaurora.org> <20191029054620.GG1929@tuxbook-pro> From: "Asutosh Das (asd)" Message-ID: Date: Thu, 16 Jan 2020 15:03:15 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <20191029054620.GG1929@tuxbook-pro> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/28/2019 10:46 PM, Bjorn Andersson wrote: > On Mon 28 Oct 19:37 PDT 2019, cang@codeaurora.org wrote: > >> On 2019-10-23 18:33, Avri Altman wrote: >>>> >>>>> Add the necessary infrastructure to keep timestamp history of >>>>> commands, events and other useful info for debugging complex issues. >>>>> This helps in diagnosing events leading upto failure. >>>> >>>> Why not use tracepoints, for that? >>> Ack on Tomas's comment. >>> Are there any pieces of information that you need not provided by the >>> upiu tracer? >>> >>> Thanks, >>> Avri >> >> In extreme cases, when the UFS runs into bad state, system may crash. There >> may not be a chance to collect trace. If trace is not collected and failure >> is hard to be reproduced, some command logs prints would be very helpful to >> help understand what was going on before we run into failure. >> > > This is a common problem shared among many/all subsystems, so it's > better to rely on a generic solution for this; such as using tracepoints > dumped into pstore/ramoops. > > Regards, > Bjorn > Reviving this discussion. Another issue with using ftrace is that several subsystems use it. Consider a situation in which we store a history of 64 commands, responses and some other required info in ftrace. Say there's a command that's stuck for seconds until the software times out. In this case, the other ftrace events are still enabled and keep writing to ftrace buffer thus overwriting some/most of the ufs's command history; thus the history is more or less lost. And there's a need to reproduce the issue with other tracing disabled. So what we need is a client specific logging mechanism, which is lightweight as ftrace and can be parsed from ramdumps. I'm open to ideas but ftrace in its current form may not be suitable for this. -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, Linux Foundation Collaborative Project