Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp568576lqr; Wed, 5 Jun 2024 14:24:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUde4ITT20erXX051uEc8Yf6mO+WpTABTULcYE86uphW1EaXdHp3qUVTUdWxCiaur9iF36wezBi4cLnqmUePHEKj9sgaxmvC0K0OPC0wg== X-Google-Smtp-Source: AGHT+IFUzYpoM2y/jHfBv/Azl89uSSYXz6TTacn/vsDBvmlMn7YhVKVeTHuN+yLgVyEIgBbZcQ5l X-Received: by 2002:a05:6a20:da92:b0:1a9:c33f:224f with SMTP id adf61e73a8af0-1b2b6f1cf4cmr4825821637.16.1717622662697; Wed, 05 Jun 2024 14:24:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717622662; cv=pass; d=google.com; s=arc-20160816; b=LU6sANALRL+rXErnI1SHy250vkMNS4kUM9gXWjQXhj6/9hs2iZKBAjknoUrgDN5Ar+ /KLHvavoL4tG2lUp6Jk+ClQjhRTVGfzrdAIuY2HxBZ+ztz3wVcU0pRiMpE21DxMqj+b7 dXhwd30Msax8LprxGOKDqc8BF2bD4jPlwedaTd39FVlS71Dg7ge4qhHX5WiRVMi8ekui SkCExzRr5IlbegUYDYAy6utySyPjYiCpYywZAS6cHoDBgwPVYzvGVUOaS2jFyX7jRz9z 91LYhhqtdQKODIA5dtVsGr0RA4EIrnjHRvna6ev1DxQtEaQNL6nst3h2Hf3QdpzBr23z QmiA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=5eeoXCbaU56E8ifND9k7gRXOpAZyJwysFP2rCDv7kG0=; fh=F5i+rNW4hjf57QJHDx14Nq4Eso4Z4OyY/LhC2i40VT4=; b=FhgS1j3GCmy6zkjCz6VljtcCBvVIX9ygM5SZ09bQKndZblJgOtQb61dPlfTFJ+uUnn CisvgsJzm5k/CGi+NhyVRi0TTaZ8zh/whK82JdY1tYLXFx3Zv5+PZVkJhVGEmgchu/Nj hzYwAefAySJWeiUbppiRB8jsWa+99XF93Jfljv5fPvKrkLQ5wlmM0Ps1N9PHVCjUrDe2 ADjmwvGm97AJEFLUYh/ZsUgQh7d8AvIXuSIVD4asa4mhYXmaI39mJzjc+7Mi3PIk6Yy6 ReFWSyqQ8a6UGaGfJnpKyxH+JKxBIlHmvJjmP1GI1tLmiAoPXeER+7a8dH++Q2FRAXTQ H5Mw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=YVdz2aft; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-203252-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203252-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d2e1a72fcca58-70242d5acfcsi431263b3a.366.2024.06.05.14.24.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 14:24:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203252-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=YVdz2aft; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-203252-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203252-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id C4F712874ED for ; Wed, 5 Jun 2024 21:24:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 96D6315FD1E; Wed, 5 Jun 2024 21:23:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="YVdz2aft" Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CEC5A15F3ED; Wed, 5 Jun 2024 21:23:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717622617; cv=none; b=M5ZUeiT20L84p7F4cl4SxXJrtHn8leBWytacdTkCqFbgwl+iX9vVwHMc2zyH6JFJFucSZX9v53o8p19W6nvnC/88kMEvf3tZ6K4bNU4ti94wUaUThgzhsLWcYA8i/yd/GyfhCdpEAkeddRRuWwnzfeE255g81ifNtxYHn7Z3VYU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717622617; c=relaxed/simple; bh=yUz/ROMGEoe6+SLnrmcPZvLaUjxobW2ydVpNVylcngM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tTzR8/ivrusnSpgfx5H3qWGl/Y5t01lZD+JYftA89nz1SdV7yqrC27KMytzWx6nE9Za+WqZS0eqWqWN3ucSVPzXqvKaoQDudP+5w86yZC0jMmha+3SVbfyOS7JcgAduQWwVS/ooof2Irz3g1WIE/DgJ+QoKprum3aXCvplLQErU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=YVdz2aft; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0353727.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 455KKjTo025753; Wed, 5 Jun 2024 21:23:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc : content-transfer-encoding : date : from : in-reply-to : message-id : mime-version : references : subject : to; s=pp1; bh=5eeoXCbaU56E8ifND9k7gRXOpAZyJwysFP2rCDv7kG0=; b=YVdz2aftBMryZIQ7m9AHhESDlRVisCt7tgFSuXcqtwHTHoAQ4ArMfUgh9Y4pmiIwDeRb RvHPspileR7Lfj8h4fpmsxr/gcZCliF/SLS2thk2M+/1mEN1DEwyO3THr9Dl+7dbGuj7 bmmwvRFcJkxBtLhkUQ2LBoD8lyNdrbqtvWoHdUp4BRb2hb8ktE1Cf0xEDGGn1ffA+Stt muuCD90oSIR+e9Pa+gtjy17Sy0wBDZBrE1KJ4Li6+HSWbbcjCAjUJDFcL8m10iKTs+mp 08tUEO8Gn+IY7cc8yuIJzIgjWkTtrc5odfyH5Pt9lk2luHTVETv+4BDkkA1BERPrkd8y Ag== Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3yjuwr0qbj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Jun 2024 21:23:19 +0000 Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 455JBRYQ031204; Wed, 5 Jun 2024 21:23:18 GMT Received: from smtprelay02.dal12v.mail.ibm.com ([172.16.1.4]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3ygeyppnsw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Jun 2024 21:23:18 +0000 Received: from smtpav06.dal12v.mail.ibm.com (smtpav06.dal12v.mail.ibm.com [10.241.53.105]) by smtprelay02.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 455LNFJV34603530 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 5 Jun 2024 21:23:17 GMT Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 50E3E58067; Wed, 5 Jun 2024 21:23:15 +0000 (GMT) Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 11AB658061; Wed, 5 Jun 2024 21:23:15 +0000 (GMT) Received: from slate16.aus.stglabs.ibm.com (unknown [9.61.121.242]) by smtpav06.dal12v.mail.ibm.com (Postfix) with ESMTP; Wed, 5 Jun 2024 21:23:15 +0000 (GMT) From: Eddie James To: linux-fsi@lists.ozlabs.org Cc: eajames@linux.ibm.com, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-spi@vger.kernel.org, broonie@kernel.org, andi.shyti@kernel.org, joel@jms.id.au, alistair@popple.id.au, jk@ozlabs.org, andrew@codeconstruct.com.au, linux-aspeed@lists.ozlabs.org, ninad@linux.ibm.com, lakshmiy@us.ibm.com Subject: [PATCH v4 06/40] fsi: core: Improve master read/write/error traces Date: Wed, 5 Jun 2024 16:22:38 -0500 Message-Id: <20240605212312.349188-7-eajames@linux.ibm.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240605212312.349188-1-eajames@linux.ibm.com> References: <20240605212312.349188-1-eajames@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: _O1ZRDGMxSsC5kg47PdcNM1eU2IYsdJp X-Proofpoint-GUID: _O1ZRDGMxSsC5kg47PdcNM1eU2IYsdJp X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-05_02,2024-06-05_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 phishscore=0 adultscore=0 priorityscore=1501 lowpriorityscore=0 bulkscore=0 clxscore=1015 impostorscore=0 malwarescore=0 spamscore=0 mlxlogscore=886 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406050160 Consolidate the master read and write traces into one trace and change the result trace into an error trace for less spam. Signed-off-by: Eddie James --- drivers/fsi/fsi-core.c | 26 +++++---- include/trace/events/fsi.h | 112 ++++++++++++------------------------- 2 files changed, 51 insertions(+), 87 deletions(-) diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c index 44875f2350b04..b3029f9c05e4a 100644 --- a/drivers/fsi/fsi-core.c +++ b/drivers/fsi/fsi-core.c @@ -1116,14 +1116,15 @@ static int fsi_master_read(struct fsi_master *master, int link, { int rc; - trace_fsi_master_read(master, link, slave_id, addr, size); - rc = fsi_check_access(addr, size); - if (!rc) + if (!rc) { rc = master->read(master, link, slave_id, addr, val, size); - - trace_fsi_master_rw_result(master, link, slave_id, addr, size, - false, val, rc); + if (rc) + trace_fsi_master_error(master->idx, link, slave_id, addr, size, val, rc, + true); + else + trace_fsi_master_xfer(master->idx, link, slave_id, addr, size, val, true); + } return rc; } @@ -1133,14 +1134,15 @@ static int fsi_master_write(struct fsi_master *master, int link, { int rc; - trace_fsi_master_write(master, link, slave_id, addr, size, val); - rc = fsi_check_access(addr, size); - if (!rc) + if (!rc) { rc = master->write(master, link, slave_id, addr, val, size); - - trace_fsi_master_rw_result(master, link, slave_id, addr, size, - true, val, rc); + if (rc) + trace_fsi_master_error(master->idx, link, slave_id, addr, size, val, rc, + false); + else + trace_fsi_master_xfer(master->idx, link, slave_id, addr, size, val, false); + } return rc; } diff --git a/include/trace/events/fsi.h b/include/trace/events/fsi.h index 5ff15126ad9d5..fed8835f438e5 100644 --- a/include/trace/events/fsi.h +++ b/include/trace/events/fsi.h @@ -8,101 +8,63 @@ #include -TRACE_EVENT(fsi_master_read, - TP_PROTO(const struct fsi_master *master, int link, int id, - uint32_t addr, size_t size), - TP_ARGS(master, link, id, addr, size), +TRACE_EVENT(fsi_master_xfer, + TP_PROTO(int master_idx, int link, int id, uint32_t addr, size_t size, const void *data, + bool read), + TP_ARGS(master_idx, link, id, addr, size, data, read), TP_STRUCT__entry( - __field(int, master_idx) - __field(int, link) - __field(int, id) - __field(__u32, addr) - __field(size_t, size) + __field(int, master_idx) + __field(int, link) + __field(int, id) + __field(uint32_t, addr) + __field(int, size) + __field(uint32_t, data) + __field(bool, read) ), TP_fast_assign( - __entry->master_idx = master->idx; + __entry->master_idx = master_idx; __entry->link = link; __entry->id = id; __entry->addr = addr; - __entry->size = size; - ), - TP_printk("fsi%d:%02d:%02d %08x[%zu]", - __entry->master_idx, - __entry->link, - __entry->id, - __entry->addr, - __entry->size - ) -); - -TRACE_EVENT(fsi_master_write, - TP_PROTO(const struct fsi_master *master, int link, int id, - uint32_t addr, size_t size, const void *data), - TP_ARGS(master, link, id, addr, size, data), - TP_STRUCT__entry( - __field(int, master_idx) - __field(int, link) - __field(int, id) - __field(__u32, addr) - __field(size_t, size) - __field(__u32, data) - ), - TP_fast_assign( - __entry->master_idx = master->idx; - __entry->link = link; - __entry->id = id; - __entry->addr = addr; - __entry->size = size; + __entry->size = (int)size; __entry->data = 0; memcpy(&__entry->data, data, size); + __entry->read = read; ), - TP_printk("fsi%d:%02d:%02d %08x[%zu] <= {%*ph}", - __entry->master_idx, - __entry->link, - __entry->id, - __entry->addr, - __entry->size, - (int)__entry->size, &__entry->data - ) + TP_printk("fsi%d:%02d:%02d %s %08x {%*ph}", __entry->master_idx, __entry->link, + __entry->id, __entry->read ? "read" : "write", __entry->addr, __entry->size, + &__entry->data) ); -TRACE_EVENT(fsi_master_rw_result, - TP_PROTO(const struct fsi_master *master, int link, int id, - uint32_t addr, size_t size, - bool write, const void *data, int ret), - TP_ARGS(master, link, id, addr, size, write, data, ret), +TRACE_EVENT(fsi_master_error, + TP_PROTO(int master_idx, int link, int id, uint32_t addr, size_t size, const void *data, + int ret, bool read), + TP_ARGS(master_idx, link, id, addr, size, data, ret, read), TP_STRUCT__entry( - __field(int, master_idx) - __field(int, link) - __field(int, id) - __field(__u32, addr) - __field(size_t, size) - __field(bool, write) - __field(__u32, data) - __field(int, ret) + __field(int, master_idx) + __field(int, link) + __field(int, id) + __field(uint32_t, addr) + __field(int, size) + __field(uint32_t, data) + __field(int, ret) + __field(bool, read) ), TP_fast_assign( - __entry->master_idx = master->idx; + __entry->master_idx = master_idx; __entry->link = link; __entry->id = id; __entry->addr = addr; - __entry->size = size; - __entry->write = write; + __entry->size = (int)size; __entry->data = 0; - __entry->ret = ret; - if (__entry->write || !__entry->ret) + if (!read) memcpy(&__entry->data, data, size); + __entry->ret = ret; + __entry->read = read; ), - TP_printk("fsi%d:%02d:%02d %08x[%zu] %s {%*ph} ret %d", - __entry->master_idx, - __entry->link, - __entry->id, - __entry->addr, - __entry->size, - __entry->write ? "<=" : "=>", - (int)__entry->size, &__entry->data, - __entry->ret - ) + TP_printk("fsi%d:%02d:%02d %s %08x {%*ph} %d", __entry->master_idx, __entry->link, + __entry->id, __entry->read ? "read" : "write", __entry->addr, __entry->size, + &__entry->data, __entry->ret) ); TRACE_EVENT(fsi_master_break, -- 2.39.3