Re: [PATCH V2 8/9] spi: bcm2835aux: add driver stats to debugfs

Stefan Wahren
2019-03-25T09:29:13Z

Hi Martin,

Am 24.03.19 um 18:50 schrieb kernel@martin.sperl.org:
> From: Martin Sperl <kernel@martin.sperl.org>
>
> To estimate efficiency add statistics on transfer types
> (polling and interrupt) used to debugfs.
>
> Signed-off-by: Martin Sperl <kernel@martin.sperl.org>
> ---
> 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?