From patchwork Thu Feb 15 22:07:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eddie James X-Patchwork-Id: 201784 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp152580dyb; Thu, 15 Feb 2024 14:13:25 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUrhcHj7dWZflmGKH2OuWLyjXR0gPrZ0LDoob1/uQESW2SZ3NfVS6MtYmRz1d0oSiO78c7gsCE9t0+c5lbzrpbC3d9ntA== X-Google-Smtp-Source: AGHT+IEGmBOMnSN9lsU2Db9uA27rexEJArI5sCxrqE59aVc5zjtGuNc28D5Ft9AcoxsE3lHv3Crb X-Received: by 2002:a17:902:e88f:b0:1da:2272:f1ab with SMTP id w15-20020a170902e88f00b001da2272f1abmr4228368plg.0.1708035205646; Thu, 15 Feb 2024 14:13:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708035205; cv=pass; d=google.com; s=arc-20160816; b=ElPQ41uyNjJW4O4bkBgQtkOYfTMdQsnrDQbBY/TSfbAEWq8PUGzivPKvv1kk/Cr7Ni IVlPPNNreko6lkFV2jyRkc/nY8NuLRBjFssI3mL3MMtt3lC5E39dcmow0KIIwdZ2+S3I +MIDLp9t/i/vapm5EMGRsacTcPUes2DE+KSRHvrAXwFCBbrEGnXftvitBViOxpfwK3CC hA+IAowFLvCOqS4SiSlrK+1ap2VCo26DN1vg0ZbRR5hWwnFtWhFTaIEM+4n9FUULYlc5 Pg0P0ki2RZtCcPWEsc9EhC7ssXsVittehJRcHuEE24DmGfm6yO36vbw+tcAW7I81sYfi uivA== 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=m8S+2xLwMphNFY1D6Sp8VRqoMTm6aplbC8DM8AmNxec=; fh=Usz7XAB1EI7Q/DdLEXd449E1MLGpSzqdCCNe5XKh9R0=; b=NwIEjwvpwU9HWcppKJS5cxebBz3iXdwNtcLCPpJ50uIJ8Jbqehg++bVGRQtw+n+nM4 aty2KGniLP1bo0xxIQ71Smrh6ZbVco6qLp1g9ZRM6WRiBtlWU57JXjucoNdG4VfY/omf wq4w9LCR9U7Ej4kE3gNDQnsyNB+W4OENUgzTpfWvvDnljyQVcL6RqqyilyWzUnPdOt4M +J8SArx336s4fhLlHpxHFkymgtKWULK9eBXVsKMFEgz2iGRzn7D7hxCuW0FRWrI7gKAg kb0VEiorbLRRG85HMdIdAtljGui3r0pArKLoaS1TorKmVCXZO33+ryXIIOa2y+X+Ts4h V+SA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=n0bDip3N; 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-67742-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67742-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id bi11-20020a170902bf0b00b001d98fc60058si1775179plb.190.2024.02.15.14.13.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 14:13:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67742-ouuuleilei=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=n0bDip3N; 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-67742-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67742-ouuuleilei=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 4EEDF281BEF for ; Thu, 15 Feb 2024 22:13:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0ABAE14D45F; Thu, 15 Feb 2024 22:08:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="n0bDip3N" Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 BAD02145FF6; Thu, 15 Feb 2024 22:08:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708034907; cv=none; b=jPGtvhX+fRxML1dXnmvailLL6hv6unqBd9GJ09QUlj3vf818Z8NabfWwUVa104PAxArZD+DsnwcMdfAEuz+I2onF8hpUVk3tA+yYtIs4sK/P7KDClCvJn3RWSxQXQ56HIqjPgUreXt3gxCmUCCzC9AtIc80LQOTrBh1CeE8FoIw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708034907; c=relaxed/simple; bh=inaKuQeiyTMX0KtjdTI4EyJ9/PXUVO4eL0aHOzMV/Co=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=sPWxZlYxfQL83KsGWXFzg3p00U1Oaavav+ZUI6zskhONOBchsYztVzRmzT4V7luoAeXjpEy+vhjcglArZhIiaB5L4sprv2lDxSqQMi4o/zFvonLXAFl0Veco/HoDhyW4Y+wRYH9ags9ix0diIOhRGNes6dSI/BvK3f19EEGV69I= 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=n0bDip3N; arc=none smtp.client-ip=148.163.158.5 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 (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41FLVKYN012233; Thu, 15 Feb 2024 22:08:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=m8S+2xLwMphNFY1D6Sp8VRqoMTm6aplbC8DM8AmNxec=; b=n0bDip3NfnAOmsWR/Igqd+nf23qcxNZIsuW4P+s1XrsGDCfZNscRVvMhgm7DAg5+OiUY YhW44Z0O0XxOKsZqlOGdVOLj/NLvAJ6TkdwxUV7xBHBOB0W70SXZD7pQAjhOwk0NYqgi x6313p0Nzq9uPjRy9gOnlNFTxeEpzIX3ylwSaq90wew2QwVX9hVqtjhYqh720AY1745S LWa8KAnAdNy270S5iu5CpCf3q4KP2fpO2T1xbGplVAiLAUOPSSqVGVUCz6p53p1znMkN GZuwPFDc8XV1qPCOS3LzCgPu9Dhf+nEtGablAhC1SF0Kt35VLpbwow4krxiKWAxZb+Nd JQ== Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3w9q0v5ycj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 15 Feb 2024 22:08:10 +0000 Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 41FL5gej009694; Thu, 15 Feb 2024 22:08:09 GMT Received: from smtprelay07.wdc07v.mail.ibm.com ([172.16.1.74]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3w6npm781c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 15 Feb 2024 22:08:09 +0000 Received: from smtpav03.dal12v.mail.ibm.com (smtpav03.dal12v.mail.ibm.com [10.241.53.102]) by smtprelay07.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 41FM86Pg13042330 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 22:08:08 GMT Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C969F5806E; Thu, 15 Feb 2024 22:08:04 +0000 (GMT) Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7E7CC5807B; Thu, 15 Feb 2024 22:08:04 +0000 (GMT) Received: from slate16.aus.stglabs.ibm.com (unknown [9.61.14.18]) by smtpav03.dal12v.mail.ibm.com (Postfix) with ESMTP; Thu, 15 Feb 2024 22:08:04 +0000 (GMT) From: Eddie James To: linux-fsi@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, andi.shyti@kernel.org, eajames@linux.ibm.com, alistair@popple.id.au, joel@jms.id.au, jk@ozlabs.org, sboyd@kernel.org, mturquette@baylibre.com, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org Subject: [PATCH 08/33] fsi: core: Improve master read/write/error traces Date: Thu, 15 Feb 2024 16:07:34 -0600 Message-Id: <20240215220759.976998-9-eajames@linux.ibm.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240215220759.976998-1-eajames@linux.ibm.com> References: <20240215220759.976998-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 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: PhYq85HPg32kvcIizXdSAvVUQFcu8DjN X-Proofpoint-GUID: PhYq85HPg32kvcIizXdSAvVUQFcu8DjN X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-15_20,2024-02-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 adultscore=0 suspectscore=0 phishscore=0 mlxlogscore=916 clxscore=1015 impostorscore=0 malwarescore=0 lowpriorityscore=0 spamscore=0 bulkscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402150171 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791004724106995254 X-GMAIL-MSGID: 1791004724106995254 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 9610b5948550..a989a2007c0f 100644 --- a/drivers/fsi/fsi-core.c +++ b/drivers/fsi/fsi-core.c @@ -1110,14 +1110,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; } @@ -1127,14 +1128,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 5ff15126ad9d..fed8835f438e 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,