1 /* 2 * Copyright (C) 2013 Google, Inc. 3 * 4 * This software is licensed under the terms of the GNU General Public 5 * License version 2, as published by the Free Software Foundation, and 6 * may be copied, distributed, and modified under those terms. 7 * 8 * This program is distributed in the hope that it will be useful, 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * GNU General Public License for more details. 12 * 13 */ 14 15 #undef TRACE_SYSTEM 16 #define TRACE_SYSTEM adf 17 18 #if !defined(__VIDEO_ADF_ADF_TRACE_H) || defined(TRACE_HEADER_MULTI_READ) 19 #define __VIDEO_ADF_ADF_TRACE_H 20 21 #include <linux/tracepoint.h> 22 #include <video/adf.h> 23 24 TRACE_EVENT(adf_event, 25 TP_PROTO(struct adf_obj *obj, enum adf_event_type type), 26 TP_ARGS(obj, type), 27 28 TP_STRUCT__entry( 29 __string(name, obj->name) 30 __field(enum adf_event_type, type) 31 __array(char, type_str, 32) 32 ), 33 TP_fast_assign( 34 __assign_str(name, obj->name); 35 __entry->type = type; 36 strlcpy(__entry->type_str, adf_event_type_str(obj, type), 37 sizeof(__entry->type_str)); 38 ), 39 TP_printk("obj=%s type=%u (%s)", 40 __get_str(name), 41 __entry->type, 42 __entry->type_str) 43 ); 44 45 TRACE_EVENT(adf_event_enable, 46 TP_PROTO(struct adf_obj *obj, enum adf_event_type type), 47 TP_ARGS(obj, type), 48 49 TP_STRUCT__entry( 50 __string(name, obj->name) 51 __field(enum adf_event_type, type) 52 __array(char, type_str, 32) 53 ), 54 TP_fast_assign( 55 __assign_str(name, obj->name); 56 __entry->type = type; 57 strlcpy(__entry->type_str, adf_event_type_str(obj, type), 58 sizeof(__entry->type_str)); 59 ), 60 TP_printk("obj=%s type=%u (%s)", 61 __get_str(name), 62 __entry->type, 63 __entry->type_str) 64 ); 65 66 TRACE_EVENT(adf_event_disable, 67 TP_PROTO(struct adf_obj *obj, enum adf_event_type type), 68 TP_ARGS(obj, type), 69 70 TP_STRUCT__entry( 71 __string(name, obj->name) 72 __field(enum adf_event_type, type) 73 __array(char, type_str, 32) 74 ), 75 TP_fast_assign( 76 __assign_str(name, obj->name); 77 __entry->type = type; 78 strlcpy(__entry->type_str, adf_event_type_str(obj, type), 79 sizeof(__entry->type_str)); 80 ), 81 TP_printk("obj=%s type=%u (%s)", 82 __get_str(name), 83 __entry->type, 84 __entry->type_str) 85 ); 86 87 #endif /* __VIDEO_ADF_ADF_TRACE_H */ 88 89 #undef TRACE_INCLUDE_PATH 90 #undef TRACE_INCLUDE_FILE 91 #define TRACE_INCLUDE_PATH . 92 #define TRACE_INCLUDE_FILE adf_trace 93 #include <trace/define_trace.h> 94