Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp399299rwb; Thu, 18 Aug 2022 06:00:59 -0700 (PDT) X-Google-Smtp-Source: AA6agR5WRKe0r+gzt8Mm1oHAWu9atJsy3XD+Y/2Pa/vr0Ysu9a0z+1hjOHSTgk9fpGZDgal8oNeE X-Received: by 2002:a17:90b:4c8d:b0:1f5:409b:b017 with SMTP id my13-20020a17090b4c8d00b001f5409bb017mr8887599pjb.52.1660827659376; Thu, 18 Aug 2022 06:00:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660827659; cv=none; d=google.com; s=arc-20160816; b=X2EkVWwlqLqDGY+mYfaEqm9luSdFQrgCyAo1JmyrgIfzDWPXCmDoHGnqgwJrxdGdvG 9tPotl43KKpdkaSGoKRyx1GC+apO8nX0k2lyR12lVG+NM3pg7y3A3SxToV7aolbeo+Tc 1/+lcoG/ZE1Hx03AbRuPoIVdz3j/jqJDwEWb22ojybpqYaA6zqYdj2wgwlG0P5ZYlCyL PNaVb1YtbaPzNdz1WaPFaCOmdSsKiCBDctBtXs2zAQY5qqYJk2EbsGvqix5iyzaz+iPS jHVdlt41Fu4CAAHdV8WjW6m7It78pcZa8HfeoYLrJC7wNWY8qfm3mubEpB91kYUspMVI orxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=Ra0ds5CnY5m0hCc8oF9W8CIyDmlncOaykK7yrT2MQN0=; b=rgFYRVPBbRuPa6d1cjWYgnX3ZltmKpO8xBALO3GfblRownXHlhRifrYCcxmJcvZsGs F8EGerqceC/H8ZDzP+kHlec9+3xbaxrf7iEH6M4m3Ah/EPaiXsjklb9vh7KBARhTGr8R A3C0DoHdFE+k0LMzCvglBloTs2TcKovUa5OaaktJ1VCSb0zMS0Ez82PgNThedf3q5E2t XU45mIMD6ZJhloxX7pSa8SIjzP/gXSYQPv/YF7Qi8T//Ux+pDeo7Vk76wm1ppWTOZkNV Q6/0mG2VxPBohNY7YLlPxr8eqIhSy1s/ArA3jhlzauR3tAt0ueJeYWcHNE2yvSdnLQLP WUqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=ROb767Se; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h5-20020a170902f70500b0016641a8abcfsi1189474plo.549.2022.08.18.06.00.46; Thu, 18 Aug 2022 06:00:59 -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; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=ROb767Se; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244598AbiHRMP3 (ORCPT + 99 others); Thu, 18 Aug 2022 08:15:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244595AbiHRMP1 (ORCPT ); Thu, 18 Aug 2022 08:15:27 -0400 Received: from mail.sberdevices.ru (mail.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E36BA00C0 for ; Thu, 18 Aug 2022 05:15:23 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mail.sberdevices.ru (Postfix) with ESMTP id 9E9C45FD02; Thu, 18 Aug 2022 15:15:21 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1660824921; bh=Ra0ds5CnY5m0hCc8oF9W8CIyDmlncOaykK7yrT2MQN0=; h=From:To:Subject:Date:Message-ID:Content-Type:MIME-Version; b=ROb767SewNHk6KbMA/s1QXflrgQrZBdu3Fp57W+5pG7g2VsU8jqD+30WhasjcChFM u7Q8nAkI88l1m30L1fXs6LHBOgsBE+yL2O9oFWxjHgZTqo6RC4Wa+4AEgVB9fXtDy4 PUttbm/Q+QkTtUJ3BC/sp44StRd49BuU2CsObs/Z4DLSPhdQhqgLGdWE9vFxBDJhTy cayfwX6yd2+OEpSc4fIvApESbNfOBnf9dICQ5ajvHKH7i5+5ZALaCDJjSBV/dkm4tt d2Lklofk8LUBspmSD2HjlyCtK+TGJtD001ZRHXZDajA300BAJw3W85VC20Fd1P2AJe DIzogL3qnb7JA== Received: from S-MS-EXCH02.sberdevices.ru (S-MS-EXCH02.sberdevices.ru [172.16.1.5]) by mail.sberdevices.ru (Postfix) with ESMTP; Thu, 18 Aug 2022 15:15:20 +0300 (MSK) From: Dmitry Rokosov To: "broonie@kernel.org" , "gregkh@linuxfoundation.org" , "rafael@kernel.org" , "jic23@kernel.org" , "linux@rasmusvillemoes.dk>" , "tglx@linutronix.de" , "maz@kernel.org>" , "andy.shevchenko@gmail.com" CC: kernel , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v1] regmap: introduce value tracing for regmap bulk operations Thread-Topic: [PATCH v1] regmap: introduce value tracing for regmap bulk operations Thread-Index: AQHYsZwRTOzZdLxKvkqpBNcAgWIdzq20YtWA Date: Thu, 18 Aug 2022 12:15:00 +0000 Message-ID: <20220818121515.6azkxyqetnunwsc6@CAB-WSD-L081021.sigma.sbrf.ru> References: <20220816181451.5628-1-ddrokosov@sberdevices.ru> In-Reply-To: <20220816181451.5628-1-ddrokosov@sberdevices.ru> Accept-Language: ru-RU, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.16.1.12] Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2022/08/18 08:17:00 #20129731 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 +Thomas, Rasmus and Marc On Tue, Aug 16, 2022 at 06:14:48PM +0000, Dmitry Rokosov wrote: > Currently, only one-register io operations support tracepoints with > value logging. For the regmap bulk operations developer can view > hw_start/hw_done tracepoints with starting reg number and registers > count to be reading or writing. This patch injects tracepoints with > dumping registers values in the hex format to regmap bulk reading > and writing. >=20 > Signed-off-by: Dmitry Rokosov > --- > drivers/base/regmap/regmap.c | 7 ++++++ > drivers/base/regmap/trace.h | 43 ++++++++++++++++++++++++++++++++++++ > 2 files changed, 50 insertions(+) >=20 > diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c > index c3517ccc3159..673ad37df11f 100644 > --- a/drivers/base/regmap/regmap.c > +++ b/drivers/base/regmap/regmap.c > @@ -2323,6 +2323,10 @@ int regmap_bulk_write(struct regmap *map, unsigned= int reg, const void *val, > =20 > kfree(wval); > } > + > + if (!ret) > + trace_regmap_bulk_write(map, reg, val, val_bytes * val_count); > + > return ret; > } > EXPORT_SYMBOL_GPL(regmap_bulk_write); > @@ -3068,6 +3072,9 @@ int regmap_bulk_read(struct regmap *map, unsigned i= nt reg, void *val, > map->unlock(map->lock_arg); > } > =20 > + if (!ret) > + trace_regmap_bulk_read(map, reg, val, val_bytes * val_count); > + > return ret; > } > EXPORT_SYMBOL_GPL(regmap_bulk_read); > diff --git a/drivers/base/regmap/trace.h b/drivers/base/regmap/trace.h > index 9abee14df9ee..04329ba68ec5 100644 > --- a/drivers/base/regmap/trace.h > +++ b/drivers/base/regmap/trace.h > @@ -64,6 +64,49 @@ DEFINE_EVENT(regmap_reg, regmap_reg_read_cache, > =20 > ); > =20 > +DECLARE_EVENT_CLASS(regmap_bulk, > + > + TP_PROTO(struct regmap *map, unsigned int reg, > + const void *val, int val_len), > + > + TP_ARGS(map, reg, val, val_len), > + > + TP_STRUCT__entry( > + __string(name, regmap_name(map)) > + __field(unsigned int, reg) > + __dynamic_array(char, buf, val_len) > + __field(int, val_len) > + ), > + > + TP_fast_assign( > + __assign_str(name, regmap_name(map)); > + __entry->reg =3D reg; > + __entry->val_len =3D val_len; > + if (val) > + memcpy(__get_dynamic_array(buf), val, val_len); > + ), > + > + TP_printk("%s reg=3D%x val=3D%s", __get_str(name), > + (unsigned int)__entry->reg, > + __print_hex(__get_dynamic_array(buf), __entry->val_len)) > +); > + > +DEFINE_EVENT(regmap_bulk, regmap_bulk_write, > + > + TP_PROTO(struct regmap *map, unsigned int reg, > + const void *val, int val_len), > + > + TP_ARGS(map, reg, val, val_len) > +); > + > +DEFINE_EVENT(regmap_bulk, regmap_bulk_read, > + > + TP_PROTO(struct regmap *map, unsigned int reg, > + const void *val, int val_len), > + > + TP_ARGS(map, reg, val, val_len) > +); > + > DECLARE_EVENT_CLASS(regmap_block, > =20 > TP_PROTO(struct regmap *map, unsigned int reg, int count), > --=20 > 2.36.0 --=20 Thank you, Dmitry=