Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp5964241iog; Thu, 23 Jun 2022 08:38:30 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ta2YmwcbJIjwelyxVYOOUPljuZPu0cvy6tywQsEpzuy8i+7fS5xxHsoCwvQOZ5TZEZJkDd X-Received: by 2002:a17:906:3f09:b0:712:466:e04a with SMTP id c9-20020a1709063f0900b007120466e04amr8615788ejj.719.1655998710296; Thu, 23 Jun 2022 08:38:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655998710; cv=none; d=google.com; s=arc-20160816; b=XHkPaKjN4oXScUpo3IO2UjUsmeobz/2yqlzFknG0A5IE5FD2HwA7NtigWTlSxkST7E RPTm5aEd8SGTQiALzC2t0EzOryxFXca4EedSrWw72mq+nFLibGpFdQrpCwCdP9x74lip SmfEHRMNaiM9ZiX/mW9t36JF/wZ7Y2Mf00+mM2Jcx6TOh9ZMKVU8CGo+THCRmbbxxLoW /rl9gMqCKJjP0zji0fAcQG9m09fvYIjgDczMl9Fb+HHM6x7VZD9wTz+HRKygfc0bjqvg uxml4/Rcs+gO0oOqHFoETL9zulGlGDYwIrGSg/GpOVUYemMAzdNyTkNMi9t64Zs5lT5A SK6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=NCYQp+4VOPnaBL3N0qSKy01FbrqvkffN/lLtKNPPBgU=; b=N7BSlfz6wv6+IvQXiGLLKO5Kkhed4yLS/S4q9mj/fZx3i77ByCxfKdU1YP9Zplg3a1 PbLS1NhNKlsyJcXorOlEUWvXnbcgrdezTH3iYW6qB23AMToOXgauRpDxCnKTGFYedtmk SLV+RDutHtzcwJjrqeLLv7AiNVMZaIj2SbF9DVfTD+5+6xQnSuYzTdpyI8T0GJrGtFF2 2J9Cp/fJgumZj5Fu4kXVIPjXMglq9dJ+lyhqn18y8iKSixjbZNs9VEAJA/3RMfe4bqe2 +X8/hcwazOUaX8MQrv5UruHdWk4w7xMA7ZM7mGMDNNxXLa8xVy4NKzLeGx5omtgxWuAs BHZw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nd17-20020a170907629100b0071c9ef2243asi8341055ejc.300.2022.06.23.08.38.01; Thu, 23 Jun 2022 08:38:30 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231976AbiFWOzs (ORCPT + 99 others); Thu, 23 Jun 2022 10:55:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231521AbiFWOzr (ORCPT ); Thu, 23 Jun 2022 10:55:47 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F34EE25B for ; Thu, 23 Jun 2022 07:55:46 -0700 (PDT) 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 EC5CD13D5; Thu, 23 Jun 2022 07:55:46 -0700 (PDT) Received: from e120937-lin.home (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A2F6F3F66F; Thu, 23 Jun 2022 07:55:45 -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 1/2] include: trace: Add SCMI full message tracing Date: Thu, 23 Jun 2022 15:55:32 +0100 Message-Id: <20220623145533.2882688-2-cristian.marussi@arm.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220623145533.2882688-1-cristian.marussi@arm.com> References: <20220623145533.2882688-1-cristian.marussi@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 Add a distinct trace event to dump full SCMI message headers and payloads. Signed-off-by: Cristian Marussi --- include/trace/events/scmi.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/include/trace/events/scmi.h b/include/trace/events/scmi.h index cee4b2b64ae4..40995c8416ba 100644 --- a/include/trace/events/scmi.h +++ b/include/trace/events/scmi.h @@ -112,6 +112,37 @@ TRACE_EVENT(scmi_rx_done, __entry->transfer_id, __entry->msg_id, __entry->protocol_id, __entry->seq, __entry->msg_type) ); + +TRACE_EVENT(scmi_msg_dump, + TP_PROTO(u8 protocol_id, u8 msg_id, unsigned char *tag, u16 seq, + int status, void *buf, size_t len), + TP_ARGS(protocol_id, msg_id, tag, seq, status, buf, len), + + TP_STRUCT__entry( + __field(u8, protocol_id) + __field(u8, msg_id) + __array(char, tag, 5) + __field(u16, seq) + __field(int, status) + __field(size_t, len) + __dynamic_array(unsigned char, cmd, len) + ), + + TP_fast_assign( + __entry->protocol_id = protocol_id; + __entry->msg_id = msg_id; + strscpy(__entry->tag, tag, 5); + __entry->seq = seq; + __entry->status = status; + __entry->len = len; + memcpy(__get_dynamic_array(cmd), buf, __entry->len); + ), + + TP_printk("[0x%02X]:%s:[0x%02X]:[%04X]:[%d]: %s", + __entry->protocol_id, __entry->tag, __entry->msg_id, + __entry->seq, __entry->status, + __print_hex_str(__get_dynamic_array(cmd), __entry->len)) +); #endif /* _TRACE_SCMI_H */ /* This part must be outside protection */ -- 2.32.0