1 /* 2 * drivers/amlogic/amports/vdec_trace.h 3 * 4 * Copyright (C) 2016 Amlogic, Inc. All rights reserved. 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 14 * more details. 15 * 16 */ 17 18 #undef TRACE_SYSTEM 19 #define TRACE_SYSTEM vdec 20 21 #if !defined(_VDEC_TRACE_H) || defined(TRACE_HEADER_MULTI_READ) 22 #define _VDEC_TRACE_H 23 24 #include <linux/tracepoint.h> 25 26 struct vdec_s; 27 28 /* single lifecycle events */ 29 DECLARE_EVENT_CLASS(vdec_event_class, 30 TP_PROTO(struct vdec_s *vdec), 31 TP_ARGS(vdec), 32 TP_STRUCT__entry( 33 __field(struct vdec_s *, vdec) 34 ), 35 TP_fast_assign( 36 __entry->vdec = vdec; 37 ), 38 TP_printk("[%p]", __entry->vdec) 39 ); 40 41 #define DEFINE_VDEC_EVENT(name) \ 42 DEFINE_EVENT(vdec_event_class, name, \ 43 TP_PROTO(struct vdec_s *vdec), \ 44 TP_ARGS(vdec)) 45 46 DEFINE_VDEC_EVENT(vdec_create); 47 DEFINE_VDEC_EVENT(vdec_connect); 48 DEFINE_VDEC_EVENT(vdec_disconnect); 49 DEFINE_VDEC_EVENT(vdec_destroy); 50 DEFINE_VDEC_EVENT(vdec_reset); 51 DEFINE_VDEC_EVENT(vdec_release); 52 53 /* set format event */ 54 #define format_name(format) \ 55 __print_symbolic(format, \ 56 {0, "MPEG"}, \ 57 {1, "MPEG4"}, \ 58 {2, "H264"}, \ 59 {3, "MJPEG"}, \ 60 {4, "REAL"}, \ 61 {5, "JPEG"}, \ 62 {6, "VC1"}, \ 63 {7, "AVS"}, \ 64 {8, "YUV"}, \ 65 {9, "H264MVC"}, \ 66 {10, "H264_4K2K"}, \ 67 {11, "H265"}, \ 68 {12, "ENC_AVC"}, \ 69 {13, "ENC_JPEG"}, \ 70 {14, "VP9"}) 71 72 TRACE_EVENT(vdec_set_format, 73 TP_PROTO(struct vdec_s *vdec, int format), 74 TP_ARGS(vdec, format), 75 TP_STRUCT__entry( 76 __field(struct vdec_s *, vdec) 77 __field(int, format) 78 ), 79 TP_fast_assign( 80 __entry->vdec = vdec; 81 __entry->format = format; 82 ), 83 TP_printk("[%p]:%s", __entry->vdec, 84 format_name(__entry->format)) 85 ); 86 87 /* status events */ 88 #define status_name(status) \ 89 __print_symbolic(status, \ 90 {0, "UNINITIALIZED"}, \ 91 {1, "DISCONNECTED"}, \ 92 {2, "CONNECTED"}, \ 93 {3, "ACTIVE"}) 94 95 DECLARE_EVENT_CLASS(vdec_status_class, 96 TP_PROTO(struct vdec_s *vdec, int state), 97 TP_ARGS(vdec, state), 98 TP_STRUCT__entry( 99 __field(struct vdec_s *, vdec) 100 __field(int, state) 101 ), 102 TP_fast_assign( 103 __entry->vdec = vdec; 104 __entry->state = state; 105 ), 106 TP_printk("[%p]:%s", __entry->vdec, status_name(__entry->state)) 107 ); 108 109 #define DEFINE_STATUS_EVENT(name) \ 110 DEFINE_EVENT(vdec_status_class, name, \ 111 TP_PROTO(struct vdec_s *vdec, int status), \ 112 TP_ARGS(vdec, status)) 113 114 DEFINE_STATUS_EVENT(vdec_set_status); 115 DEFINE_STATUS_EVENT(vdec_set_next_status); 116 117 /* set pts events */ 118 DECLARE_EVENT_CLASS(vdec_pts_class, 119 TP_PROTO(struct vdec_s *vdec, u64 pts), 120 TP_ARGS(vdec, pts), 121 TP_STRUCT__entry( 122 __field(struct vdec_s *, vdec) 123 __field(u64, pts) 124 ), 125 TP_fast_assign( 126 __entry->vdec = vdec; 127 __entry->pts = pts; 128 ), 129 TP_printk("[%p]%llu", __entry->vdec, __entry->pts) 130 ); 131 132 #define DEFINE_PTS_EVENT(name) \ 133 DEFINE_EVENT(vdec_pts_class, name, \ 134 TP_PROTO(struct vdec_s *vdec, u64 pts), \ 135 TP_ARGS(vdec, pts)) 136 137 DEFINE_PTS_EVENT(vdec_set_pts); 138 DEFINE_PTS_EVENT(vdec_set_pts64); 139 140 #endif /* _VDEC_TRACE_H */ 141 142 /* 143 #undef TRACE_INCLUDE_PATH 144 #undef TRACE_INCLUDE_FILE 145 #define TRACE_INCLUDE_PATH . 146 #define TRACE_INCLUDE_FILE vdec_trace 147 #include <trace/define_trace.h> 148 */ 149 /**/ //DEBUG_TMP 150