
Add register read/write operations tracing support. ftrace events helps to trace register read and write location details of memory mapped IO registers. These trace logs helps to debug un clocked access of peripherals. Bug: 169045115 Change-Id: I849bf75b84c24c8f3e9d2e8fba34a10ddcf4aaca Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
39 lines
1.0 KiB
C
39 lines
1.0 KiB
C
// SPDX-License-Identifier: GPL-2.0
|
|
/*
|
|
* Register read and write tracepoints
|
|
*
|
|
* Copyright (c) 2021, The Linux Foundation. All rights reserved.
|
|
*/
|
|
|
|
#include <linux/kallsyms.h>
|
|
#include <linux/uaccess.h>
|
|
#include <linux/module.h>
|
|
#include <linux/ftrace.h>
|
|
#include <linux/log_mmiorw.h>
|
|
|
|
#define CREATE_TRACE_POINTS
|
|
#include <trace/events/rwmmio.h>
|
|
|
|
#ifdef CONFIG_TRACE_MMIO_ACCESS
|
|
void __log_write_mmio(u64 val, u8 width, volatile void __iomem *addr)
|
|
{
|
|
trace_rwmmio_write(CALLER_ADDR0, val, width, addr);
|
|
}
|
|
EXPORT_SYMBOL_GPL(__log_write_mmio);
|
|
EXPORT_TRACEPOINT_SYMBOL_GPL(rwmmio_write);
|
|
|
|
void __log_read_mmio(u8 width, const volatile void __iomem *addr)
|
|
{
|
|
trace_rwmmio_read(CALLER_ADDR0, width, addr);
|
|
}
|
|
EXPORT_SYMBOL_GPL(__log_read_mmio);
|
|
EXPORT_TRACEPOINT_SYMBOL_GPL(rwmmio_read);
|
|
|
|
void __log_post_read_mmio(u64 val, u8 width, const volatile void __iomem *addr)
|
|
{
|
|
trace_rwmmio_post_read(CALLER_ADDR0, val, width, addr);
|
|
}
|
|
EXPORT_SYMBOL_GPL(__log_post_read_mmio);
|
|
EXPORT_TRACEPOINT_SYMBOL_GPL(rwmmio_post_read);
|
|
#endif
|