From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3CD7C2D0A8 for ; Mon, 28 Sep 2020 05:49:01 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 220132068E for ; Mon, 28 Sep 2020 05:49:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="sKYDJgzI"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="VEOp3e5w" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 220132068E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-ID:References:In-Reply-To:Subject:To:From: Date:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=TgBFY/ynMzhxTAngYod63+DidJ48dUlycoVEACgJn98=; b=sKYDJgzIIXtg1LENRLcNJt3OI W83Q8G2n+YI7pbWSmND36aINEgOf4INq1r/ryrytqO/v+PTjbztg7P0WDtemYGiiOvfzBJrp2t+Xo kY2s508ISPIXVSJtxXQTCtGVlhtk9RpsuQ4aiSoadCD2zwb63ZyEg0/TuKvDVi5oO9ksWSRLhgdEG Mt1pPR5Pf5zz+OuZaMBBF8yysS3P/WZ4FWcUGCF0+to334m7xOWcQKPhMQ6ObkMR0ISrSc1+8nwhk dktKngoqNI6dmWLmBc5g0mInoO6KozmP4VEf2DFK04H9gcHlHpyqibwRAJuO8ZsOeIcTDaguSHPzP J2lFHT9DA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kMm0W-0007MD-Lx; Mon, 28 Sep 2020 05:47:28 +0000 Received: from z5.mailgun.us ([104.130.96.5]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kMm0R-0007Lo-Hk for linux-arm-kernel@lists.infradead.org; Mon, 28 Sep 2020 05:47:26 +0000 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1601272045; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=Ie5rUDiiovTLKTOWZjkrtVsETmI7mVXRVE6tZnlDGJk=; b=VEOp3e5wJI4ISuJloqF0eGvMdyAsyp1muYOBwyrEL9UmeOcdx6T6EJVOTAgsKw9zoZyJ2BO9 Vy8O9mPF/o4eJ0mWdBYWwk/Nbp376J1bkYZKw+nf0sNmfu8hwTbqcE89rm4pckq8QKar/cOy 3zX9BAu71/Eirx9XXDWzpRQvwr0= X-Mailgun-Sending-Ip: 104.130.96.5 X-Mailgun-Sid: WyJiYzAxZiIsICJsaW51eC1hcm0ta2VybmVsQGxpc3RzLmluZnJhZGVhZC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n03.prod.us-east-1.postgun.com with SMTP id 5f717898356bcc21fbc4af54 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Mon, 28 Sep 2020 05:46:00 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 21F7EC433FE; Mon, 28 Sep 2020 05:46:00 +0000 (UTC) Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: saiprakash.ranjan) by smtp.codeaurora.org (Postfix) with ESMTPSA id DB659C433CA; Mon, 28 Sep 2020 05:45:58 +0000 (UTC) MIME-Version: 1.0 Date: Mon, 28 Sep 2020 11:15:58 +0530 From: Sai Prakash Ranjan To: Prasad Sodagudi Subject: Re: [PATCH] Register read and writes tracing In-Reply-To: <1601253290-400618-1-git-send-email-psodagud@codeaurora.org> References: <1601253290-400618-1-git-send-email-psodagud@codeaurora.org> Message-ID: X-Sender: saiprakash.ranjan@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200928_014725_659245_6BEF305A X-CRM114-Status: GOOD ( 25.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: catalin.marinas@arm.com, keescook@chromium.org, arnd@arndb.de, jim.cromie@gmail.com, linux-arm-msm@vger.kernel.org, anton@enomsg.org, linux-kernel@vger.kernel.org, rostedt@goodmis.org, ccross@android.com, joel@joelfernandes.org, jbaron@akamai.com, mingo@redhat.com, gregkh@linuxfoundation.org, joe@perches.com, Will Deacon , linux-arm-kernel@lists.infradead.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Prasad, On 2020-09-28 06:04, Prasad Sodagudi wrote: > Qualcomm team have tried to upstreaming the register trace buffer(RTB) > use case earlier - [1] > with pstore approach. In that discussion, there was suggestion to use > the ftrace events for > tracking the register reads and writes. In this patch, added register > read/write operations > tracing support and also add _no_log variants(for example - > readl_relaxed_no_log to readl_relaxed) > functions, which will help to avoid excessive logging for certain > register operations > (continuous writes from a loop). These tracepoints can be used by > modules > to register probes and log the data convenient for silicon vendor > format. > > [1] - > https://lore.kernel.org/lkml/cover.1535119710.git.saiprakash.ranjan@codeaurora.org/ > Thanks for picking this up again. This kind of looks like going back to downstream implementation of having log and nolog variants which was exactly the thing we wanted to avoid. I believe the reason for this nolog variants is not just to avoid excessive logging but also to provide filtering i.e, selectively trace the register reads/writes from required drivers or subsystems like for example we wouldn't want to trace register reads/writes from serial drivers, now if you use these nolog variants then it will need to be sprinkled all over the kernel in various drivers to provide this kind of filtering. That was the reason I did not want to introduce these nolog and log variants, instead introduced a way to use dynamic debug [2] to provide this kind of filtering. Dynamic debug provides an array of filtering capacity such as filter by files, folders and even is applicable for modules making it a prime candidate for these kind of scenarios. So why not use it instead of all these new variants? Then you don't have to export things like you do in this patch and just have to add tracepoints. Also the patch series[1][2] was almost OK'ed(they didn't give a formal review) by arm folks at the time and even acked by Steve[3] except for the pstore part. We have ways to extract trace events from ramdumps via crash utility or STM, so pstore support is not mandatory and can be done later(it is currently being worked on). Plus the link you mentioned was an RFC and there was a new version posted after that[4]. Please take at the series[4] look once and see if you can use that, only thing required I suppose is decouple the pstore patches and you should be good to go. [1] https://patchwork.kernel.org/patch/10593175/ [2] https://patchwork.kernel.org/patch/10593175/ [3] https://patchwork.kernel.org/patch/10593173/ [4] https://patchwork.kernel.org/cover/10593159/ > Qualcomm teams uses these logs for debugging various issues in the > product life cycle and > hopping that this logging would help other silicon vendors as this is > generic approach. > Please provide your suggestion/comments to bring this patch upstream > quality. > > Prasad Sodagudi (1): > tracing: Add register read and write tracing support > > arch/arm64/include/asm/io.h | 117 > ++++++++++++++++++++++++++++++++++++++--- > include/linux/iorw.h | 20 +++++++ > include/trace/events/rwio.h | 51 ++++++++++++++++++ > kernel/trace/Kconfig | 11 ++++ > kernel/trace/Makefile | 1 + > kernel/trace/trace_readwrite.c | 30 +++++++++++ > 6 files changed, 222 insertions(+), 8 deletions(-) > create mode 100644 include/linux/iorw.h > create mode 100644 include/trace/events/rwio.h > create mode 100644 kernel/trace/trace_readwrite.c Thanks, Sai -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel