Re: [PATCH V2 8/9] spi: bcm2835aux: add driver stats to debugfs
From: Stefan Wahren <hidden>
Date: 2019-03-25 09:29:13
Also in:
linux-spi
Hi Martin, Am 24.03.19 um 18:50 schrieb kernel@martin.sperl.org:
quoted hunk ↗ jump to hunk
From: Martin Sperl <redacted> To estimate efficiency add statistics on transfer types (polling and interrupt) used to debugfs. Signed-off-by: Martin Sperl <redacted> --- 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 <linux/clk.h> #include <linux/completion.h> +#include <linux/debugfs.h> #include <linux/delay.h> #include <linux/err.h> #include <linux/interrupt.h>@@ -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? _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel