Re: [PATCH v2] tracing: Add register read and write tracing support

From: Greg KH
Date: Fri Nov 06 2020 - 01:49:41 EST


On Thu, Nov 05, 2020 at 06:56:26PM -0800, Prasad Sodagudi wrote:
> Add register read/write operations tracing support.
> ftrace events helps to trace register read and write
> location details of memory mapped IO registers.

This sentance does not parse for me, can you please rework it?

> These trace logs helps to debug un clocked access
> of peripherals.

"un clocked"? What does that mean?

And you do have 72 columns to fill, please use it :)

>
> Signed-off-by: Prasad Sodagudi <psodagud@xxxxxxxxxxxxxx>
> ---
> arch/arm64/include/asm/io.h | 9 ++++++++
> arch/arm64/kernel/image-vars.h | 8 +++++++

You are only adding it for arm64, why not add the generic support first,
and then add it for all "major" arches afterwards?


> include/linux/iorw.h | 38 +++++++++++++++++++++++++++++++
> include/trace/events/rwio.h | 51 ++++++++++++++++++++++++++++++++++++++++++
> kernel/trace/Kconfig | 11 +++++++++
> kernel/trace/Makefile | 1 +
> kernel/trace/trace_readwrite.c | 31 +++++++++++++++++++++++++
> 7 files changed, 149 insertions(+)
> create mode 100644 include/linux/iorw.h
> create mode 100644 include/trace/events/rwio.h
> create mode 100644 kernel/trace/trace_readwrite.c
>
> diff --git a/arch/arm64/include/asm/io.h b/arch/arm64/include/asm/io.h
> index fd172c4..bcfc65c 100644
> --- a/arch/arm64/include/asm/io.h
> +++ b/arch/arm64/include/asm/io.h
> @@ -9,6 +9,7 @@
> #define __ASM_IO_H
>
> #include <linux/types.h>
> +#include <linux/iorw.h>
> #include <linux/pgtable.h>
>
> #include <asm/byteorder.h>
> @@ -24,24 +25,28 @@
> #define __raw_writeb __raw_writeb
> static inline void __raw_writeb(u8 val, volatile void __iomem *addr)
> {
> + log_write_io(addr);
> asm volatile("strb %w0, [%1]" : : "rZ" (val), "r" (addr));

Why are you not logging the value here, and everywhere else? You need
to document why that is somewhere, as it's the most obvious question you
will get.

thanks,

greg k-h