android_kernel_xiaomi_sm8450/drivers/spi/spi-qup-trace.h
Anil Veshala 5e1bf53915 spi: spi-msm-geni: Add support of ftrace logging for SPI/I2C & geni_se
Currently IPC logging is enabled for debug build only,so it is
very difficult to analyze the SPI/I2C and common driver issues if
IPC logging is not present. To overcome this issue we have added
the support of ftrace logging. Here we have created the different
events to print the logs for different types using TRACE_EVENT
macro. The ftrace output will be present in below mentioned paths.

cat /sys/kernel/tracing/instances/spi_qup/trace.
cat /sys/kernel/tracing/instances/i2c_qup/trace.
cat /sys/kernel/tracing/instances/qupv3_common/trace.

Change-Id: I99b339c73464ee99b4f2a79128ed588f5367ce5c
Signed-off-by: Anil Veshala <aveshala@codeaurora.org>
2021-06-29 11:51:58 +05:30

47 lines
986 B
C

/* SPDX-License-Identifier: GPL-2.0-only
*
* Copyright (c) 2021, The Linux Foundation. All rights reserved.
*/
#undef TRACE_SYSTEM
#define TRACE_SYSTEM qup_spi_trace
#if !defined(_TRACE_SPI_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_SPI_TRACE_H
#include <linux/ktime.h>
#include <linux/tracepoint.h>
#define MAX_MSG_LEN 256
TRACE_EVENT(spi_log_info,
TP_PROTO(const char *name, struct va_format *vaf),
TP_ARGS(name, vaf),
TP_STRUCT__entry(
__string(name, name)
__dynamic_array(char, msg, MAX_MSG_LEN)
),
TP_fast_assign(
__assign_str(name, name);
WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
MAX_MSG_LEN, vaf->fmt,
*vaf->va) >= MAX_MSG_LEN);
),
TP_printk("%s: %s", __get_str(name), __get_str(msg))
);
#endif /* _TRACE_SPI_TRACE_H */
/* This part must be outside protection */
#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH .
#define TRACE_INCLUDE_FILE spi-qup-trace
#include <trace/define_trace.h>