From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Wahren Subject: Re: [PATCH V2 8/9] spi: bcm2835aux: add driver stats to debugfs Date: Mon, 25 Mar 2019 10:28:44 +0100 Message-ID: References: <20190324175002.28969-1-kernel@martin.sperl.org> <20190324175002.28969-9-kernel@martin.sperl.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kernel@martin.sperl.org, Mark Brown , Eric Anholt , Hubert Denkmair , linux-spi@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org Return-path: In-Reply-To: <20190324175002.28969-9-kernel@martin.sperl.org> Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org List-Id: linux-spi.vger.kernel.org Hi Martin, Am 24.03.19 um 18:50 schrieb kernel@martin.sperl.org: > From: Martin Sperl > > To estimate efficiency add statistics on transfer types > (polling and interrupt) used to debugfs. > > Signed-off-by: Martin Sperl > --- > drivers/spi/spi-bcm2835aux.c | 61 ++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 61 insertions(+) > > diff --git a/drivers/spi/spi-bcm2835aux.c b/drivers/spi/spi-bcm2835aux.c > index dd0446968da6..d2b58060b333 100644 > --- a/drivers/spi/spi-bcm2835aux.c > +++ b/drivers/spi/spi-bcm2835aux.c > @@ -21,6 +21,7 @@ > > #include > #include > +#include > #include > #include > #include > @@ -102,8 +103,57 @@ struct bcm2835aux_spi { > int tx_len; > int rx_len; > int pending; > + > +#if defined(CONFIG_DEBUG_FS) > +#define BCM2835_AUX_INCR(field) ((field)++) > + u64 count_transfer_polling; > + u64 count_transfer_irq; > + u64 count_transfer_irq_after_poll; > + > + struct dentry *debugfs_dir; > +#else > +#define BCM2835_AUX_INCR(field) > +#endif /* CONFIG_DEBUG_FS */ > }; > is there a chance to avoid these ifdefs CONFIG_DEBUG_FS?