From patchwork Thu Jun 30 17:31:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Marussi X-Patchwork-Id: 12902040 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 063FBC43334 for ; Thu, 30 Jun 2022 17:33:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=8c8dlTh6DqVK9BpISZynQ1rukNoStOKbmPsFaCwZSlI=; b=GagXmo+Z4+QZ77 3yJficlr6vQw/PyCtpU7ZZm55hj0vVXTx20lwL1NEHfPMXfDRc2SQDC+rY93tp9y08IVbtywsBjGG PBG1kPTIiEBYRs1S9T3+Rw8OibBpbCkU4+56qOcAelFnrRD4sKDRVI2TYDaRtkpU2NYPB0fDhIr15 J6DmIb5CBcZF6anIuAEHBAurPO57s2lzvpUeRj8yHcSZqa7NpsNkm1OJoaN65U5usKB2QxV8E82id aORdy3il5xjnDWM4dp/wElVD+AG6gXj/RtPlBgNnztJfFC6cagQADvAF73iO+X65j9vsHPibfbQ9x AZVe8LW3QUAaCI+iR3bQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6y1e-000pyM-EM; Thu, 30 Jun 2022 17:32:22 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6y1E-000ppV-EW for linux-arm-kernel@lists.infradead.org; Thu, 30 Jun 2022 17:32:00 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 451B71063; Thu, 30 Jun 2022 10:31:52 -0700 (PDT) Received: from e120937-lin.home (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DDE1A3F792; Thu, 30 Jun 2022 10:31:50 -0700 (PDT) From: Cristian Marussi To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: sudeep.holla@arm.com, f.fainelli@gmail.com, vincent.guittot@linaro.org, lukasz.luba@arm.com, james.quinlan@broadcom.com, Cristian Marussi Subject: [PATCH v2 0/2] Add SCMI full message tracing Date: Thu, 30 Jun 2022 18:31:33 +0100 Message-Id: <20220630173135.2086631-1-cristian.marussi@arm.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220630_103156_615541_52207179 X-CRM114-Status: UNSURE ( 9.83 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, after a few recent troubles handling too strictly out-of-spec replies from SCMI servers deployed in the wild, I though it could have been useful to have a basic way to dump at will the effective full payloads of successfully transmitted/received SCMI messages. The existing SCMI traces already collect a bunch of information about SCMI message exchanges but they do NOT keep any payload information: this is certainly preferable most of the time since dumping full SCMI messages to the trace buffer involves a full copy of the payload. For this reason I added a new distinct trace_scmi_msg_dump with this series in order to be able to selectively enable at will message dumping only when required. Only successfully transmitted and received (valid) xfers are dumped. Following the advice from Jim, I added some parsing/interpretation of the header, so that the final result is something like: root@deb-guest:~# echo 1 > /sys/kernel/debug/tracing/events/scmi/scmi_msg_dump/enable root@deb-guest:~# cat /sys/kernel/debug/tracing/trace_pipe ++ cmd/reply sugov:0-257 [000] ..... 401.954788: scmi_msg_dump: pt=13 t=CMND msg_id=07 seq=0082 s=0 pyld=0000000000000000 -0 [000] d.h2. 401.955085: scmi_msg_dump: pt=13 t=RESP msg_id=07 seq=0082 s=0 pyld= ++ cmd/reply/delayed cat-263 [001] ..... 471.533806: scmi_msg_dump: pt=15 t=CMND msg_id=06 seq=008A s=0 pyld=0100000001000000 -0 [000] d.h2. 471.554001: scmi_msg_dump: pt=15 t=RESP msg_id=06 seq=008A s=0 pyld= -0 [000] d.h2. 471.574102: scmi_msg_dump: pt=15 t=DLYD msg_id=06 seq=008A s=0 pyld=01000000a05a320000000000efbeaddefecafeca ++ enable notif/notif iio_generic_buf-282 [000] ..... 535.327307: scmi_msg_dump: pt=15 t=CMND msg_id=0A seq=00AB s=0 pyld=0800000003000000 -0 [000] d.h2. 535.327561: scmi_msg_dump: pt=15 t=RESP msg_id=0A seq=00AB s=0 pyld=00000000 -0 [000] d.h2. 535.334421: scmi_msg_dump: pt=15 t=NOTI msg_id=01 seq=0000 s=0 pyld=000000000800000008daffffffffffff008268d4c075fd1610daffffffffffff008268d4c075fd1618daffffffffffff008268d4c075fd16 -0 [000] d.h2. 535.434649: scmi_msg_dump: pt=15 t=NOTI msg_id=01 seq=0000 s=0 pyld=000000000800000009daffffffffffff008268d4c075fd1611daffffffffffff008268d4c075fd1619daffffffffffff008268d4c075fd16 Payload is dumped as it comes through byte-by-byte without any endianity conversion to avoid further load on the system. Thanks, Cristian --- V1 --> V2 - changed dumping format Cristian Marussi (2): include: trace: Add SCMI full message tracing firmware: arm_scmi: Use new SCMI full message tracing drivers/firmware/arm_scmi/driver.c | 21 ++++++++++++++++++++ include/trace/events/scmi.h | 31 ++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+)