From 76b3ac7dce31a07be1337b860bd55e10458017c8 Mon Sep 17 00:00:00 2001 From: Han Gao Date: Tue, 7 May 2024 12:34:17 +0000 Subject: [PATCH] trace_point: fix: move header file to events Signed-off-by: Han Gao --- .../linux/subsys_driver/Makefile | 10 +- .../linux/kernel_module/Makefile | 10 +- include/trace/events/gpu_trace_point.h | 34 +++++++ include/trace/events/vdec_trace_point.h | 36 +++++++ include/trace/events/venc_trace_point.h | 36 +++++++ include/trace/events/vha_trace_point.h | 97 +++++++++++++++++++ 6 files changed, 213 insertions(+), 10 deletions(-) create mode 100644 include/trace/events/gpu_trace_point.h create mode 100644 include/trace/events/vdec_trace_point.h create mode 100644 include/trace/events/venc_trace_point.h create mode 100644 include/trace/events/vha_trace_point.h diff --git a/drivers/staging/media/vpu-vc8000d-kernel/linux/subsys_driver/Makefile b/drivers/staging/media/vpu-vc8000d-kernel/linux/subsys_driver/Makefile index b25a2931a..df4b03ff4 100644 --- a/drivers/staging/media/vpu-vc8000d-kernel/linux/subsys_driver/Makefile +++ b/drivers/staging/media/vpu-vc8000d-kernel/linux/subsys_driver/Makefile @@ -64,11 +64,11 @@ EXTRA_CFLAGS += $(DEBFLAGS) # EXTRA_CFLAGS += -DDYNAMIC_MALLOC_VCMDNODE #adapt for andriod $src is where this dir. -ifeq ($(CONFIG_ANDROID), y) -ccflags-y += -DTRACE_INCLUDE_PATH=$(src) -else -ccflags-y += -DTRACE_INCLUDE_PATH=$(PWD) -endif +#ifeq ($(CONFIG_ANDROID), y) +#ccflags-y += -DTRACE_INCLUDE_PATH=$(src) +#else +#ccflags-y += -DTRACE_INCLUDE_PATH=$(PWD) +#endif ifneq ($(KERNELRELEASE),) # recursive call from kernel build system diff --git a/drivers/staging/media/vpu-vc8000e-kernel/linux/kernel_module/Makefile b/drivers/staging/media/vpu-vc8000e-kernel/linux/kernel_module/Makefile index 0209f8bfb..f9c8b2248 100755 --- a/drivers/staging/media/vpu-vc8000e-kernel/linux/kernel_module/Makefile +++ b/drivers/staging/media/vpu-vc8000e-kernel/linux/kernel_module/Makefile @@ -109,11 +109,11 @@ endif CC += -I$(obj) EXTRA_CFLAGS += -g -ifeq ($(CONFIG_ANDROID), y) -ccflags-y += -DTRACE_INCLUDE_PATH=$(src) -else -ccflags-y += -DTRACE_INCLUDE_PATH=$(PWD) -endif +#ifeq ($(CONFIG_ANDROID), y) +#ccflags-y += -DTRACE_INCLUDE_PATH=$(src) +#else +#ccflags-y += -DTRACE_INCLUDE_PATH=$(PWD) +#endif # Print debugging messages from the device #EXTRA_CFLAGS += -DHANTRO_DRIVER_DEBUG diff --git a/include/trace/events/gpu_trace_point.h b/include/trace/events/gpu_trace_point.h new file mode 100644 index 000000000..63b00d20d --- /dev/null +++ b/include/trace/events/gpu_trace_point.h @@ -0,0 +1,34 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM gpu_trace_point + +#if !defined(_TRACE_GPU_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_GPU_H + +#include +#include +#include + +TRACE_EVENT(gpu_interrupt, + + TP_PROTO(unsigned int IRQStatusReg, unsigned int IRQStatus), + + TP_ARGS(IRQStatusReg, IRQStatus), + + TP_STRUCT__entry( + __field( unsigned int, IRQStatusReg) + __field( unsigned int, IRQStatus) + ), + + TP_fast_assign( + __entry->IRQStatusReg = IRQStatusReg; + __entry->IRQStatus = IRQStatus; + ), + + TP_printk("IRQStatusReg=%d IRQStatus=%d", __entry->IRQStatusReg, __entry->IRQStatus) +); + +#endif /* _TRACE_GPU_H */ + +/* This part must be outside protection */ +#include \ No newline at end of file diff --git a/include/trace/events/vdec_trace_point.h b/include/trace/events/vdec_trace_point.h new file mode 100644 index 000000000..9f9638435 --- /dev/null +++ b/include/trace/events/vdec_trace_point.h @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM vdec_trace_point + +#if !defined(_TRACE_VDEC_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_VDEC_H + +#include +#include +#include + +TRACE_EVENT(vdec_interrupt, + + TP_PROTO(unsigned int complete_cmd, unsigned int irq_status, unsigned int processed_vcmd_num), + + TP_ARGS(complete_cmd, irq_status,processed_vcmd_num), + + TP_STRUCT__entry( + __field( unsigned int, complete_cmd ) + __field( unsigned int, irq_status) + __field( unsigned int, processed_vcmd_num) + ), + + TP_fast_assign( + __entry->complete_cmd = complete_cmd; + __entry->irq_status = irq_status; + __entry->processed_vcmd_num = processed_vcmd_num; + ), + + TP_printk("dec irq type complete_cmd %u irq status =%x processed_vcmd_num %d ", __entry->complete_cmd, __entry->irq_status,__entry->processed_vcmd_num) +); + +#endif /* _TRACE_VDEC_H */ + +/* This part must be outside protection */ +#include \ No newline at end of file diff --git a/include/trace/events/venc_trace_point.h b/include/trace/events/venc_trace_point.h new file mode 100644 index 000000000..df75dff7b --- /dev/null +++ b/include/trace/events/venc_trace_point.h @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM venc_trace_point + +#if !defined(_TRACE_VENC_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_VENC_H + +#include +#include +#include + +TRACE_EVENT(venc_interrupt, + + TP_PROTO(unsigned int complete_cmd, unsigned int irq_status, unsigned int processed_vcmd_num), + + TP_ARGS(complete_cmd, irq_status,processed_vcmd_num), + + TP_STRUCT__entry( + __field( unsigned int, complete_cmd ) + __field( unsigned int, irq_status) + __field( unsigned int, processed_vcmd_num) + ), + + TP_fast_assign( + __entry->complete_cmd = complete_cmd; + __entry->irq_status = irq_status; + __entry->processed_vcmd_num = processed_vcmd_num; + ), + + TP_printk("venc irq type complete_cmd %u irq status =%x processed_vcmd_num %d ", __entry->complete_cmd, __entry->irq_status,__entry->processed_vcmd_num) +); + +#endif /* _TRACE_VENC_H */ + +/* This part must be outside protection */ +#include \ No newline at end of file diff --git a/include/trace/events/vha_trace_point.h b/include/trace/events/vha_trace_point.h new file mode 100644 index 000000000..d4223a9d6 --- /dev/null +++ b/include/trace/events/vha_trace_point.h @@ -0,0 +1,97 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* vha message transfer tracepoints + * + * Copyright (C) 2013 Red Hat, Inc. All Rights Reserved. + * Written by David Howells (dhowells@redhat.com) + */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM vha_trace_point + +#if !defined(_TRACE_VHA_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_VHA_H + +#include +#include +#include + +TRACE_EVENT(vha_session_in, + TP_PROTO(uint32_t session_id, uint64_t kicks), + + TP_ARGS(session_id, kicks), + + TP_STRUCT__entry( + __field( uint32_t, session_id) + __field( uint64_t, kicks) + ), + + TP_fast_assign( + __entry->session_id = session_id; + __entry->kicks = kicks; + ), + + TP_printk("session_id %d, kicks=%d", __entry->session_id, __entry->kicks) +); + +TRACE_EVENT(vha_session_out, + TP_PROTO(uint32_t session_id, uint64_t kicks), + + TP_ARGS(session_id, kicks), + + TP_STRUCT__entry( + __field( uint32_t, session_id) + __field( uint64_t, kicks) + ), + + TP_fast_assign( + __entry->session_id = session_id; + __entry->kicks = kicks; + ), + + TP_printk("session_id %d, kicks=%d", __entry->session_id, __entry->kicks) +); + +TRACE_EVENT(vha_hwexec_in, + TP_PROTO(uint32_t session_id, uint32_t subseg_current), + + TP_ARGS(session_id, subseg_current), + + TP_STRUCT__entry( + __field( uint32_t, session_id) + __field( uint32_t, subseg_current) + ), + + TP_fast_assign( + __entry->session_id = session_id; + __entry->subseg_current = subseg_current; + ), + + TP_printk("session_id %d, subseg_current=%d", __entry->session_id, __entry->subseg_current) +); + +TRACE_EVENT(vha_irq, + TP_PROTO(unsigned int dev_id, uint64_t status, uint8_t count, uint64_t last_proc_us), + + TP_ARGS(dev_id, status, count, last_proc_us), + + TP_STRUCT__entry( + __field( unsigned int, dev_id) + __field( uint64_t, status) + __field( uint8_t, count) + __field( uint64_t, last_proc_us) + ), + + TP_fast_assign( + __entry->dev_id = dev_id; + __entry->status = status; + __entry->count = count; + __entry->last_proc_us = last_proc_us; + ), + + TP_printk("dev_id=%d, status=%lld, count=%d, last_proc_us=%lld", + __entry->dev_id, __entry->status, __entry->count, __entry->last_proc_us) +); + +#endif /* _TRACE_VHA_H */ + +/* This part must be outside protection */ +#include