x86: Remove unused config macros from instruction decoder selftest
[pandora-kernel.git] / include / trace / ftrace.h
index 4e81c9b..f2bd7a8 100644 (file)
@@ -21,6 +21,9 @@
 #undef __field
 #define __field(type, item)            type    item;
 
+#undef __field_ext
+#define __field_ext(type, item, filter_type)   type    item;
+
 #undef __array
 #define __array(type, item, len)       type    item[len];
 
        };                                                      \
        static struct ftrace_event_call event_##name
 
+/* Callbacks are meaningless to ftrace. */
+#undef TRACE_EVENT_FN
+#define TRACE_EVENT_FN(name, proto, args, tstruct,             \
+               assign, print, reg, unreg)                      \
+       TRACE_EVENT(name, TP_PROTO(proto), TP_ARGS(args),       \
+               TP_STRUCT__entry(tstruct),                      \
+               TP_fast_assign(assign),                         \
+               TP_printk(print))
+
 #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
 
 
  */
 
 #undef __field
-#define __field(type, item);
+#define __field(type, item)
+
+#undef __field_ext
+#define __field_ext(type, item, filter_type)
 
 #undef __array
 #define __array(type, item, len)
        if (!ret)                                                       \
                return 0;
 
+#undef __field_ext
+#define __field_ext(type, item, filter_type)   __field(type, item)
+
 #undef __array
 #define __array(type, item, len)                                               \
        ret = trace_seq_printf(s, "\tfield:" #type " " #item "[" #len "];\t"    \
@@ -265,28 +283,33 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags)  \
        
 #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
 
-#undef __field
-#define __field(type, item)                                            \
+#undef __field_ext
+#define __field_ext(type, item, filter_type)                           \
        ret = trace_define_field(event_call, #type, #item,              \
                                 offsetof(typeof(field), item),         \
-                                sizeof(field.item), is_signed_type(type));     \
+                                sizeof(field.item),                    \
+                                is_signed_type(type), filter_type);    \
        if (ret)                                                        \
                return ret;
 
+#undef __field
+#define __field(type, item)    __field_ext(type, item, FILTER_OTHER)
+
 #undef __array
 #define __array(type, item, len)                                       \
        BUILD_BUG_ON(len > MAX_FILTER_STR_VAL);                         \
        ret = trace_define_field(event_call, #type "[" #len "]", #item, \
                                 offsetof(typeof(field), item),         \
-                                sizeof(field.item), 0);                \
+                                sizeof(field.item), 0, FILTER_OTHER);  \
        if (ret)                                                        \
                return ret;
 
 #undef __dynamic_array
 #define __dynamic_array(type, item, len)                                      \
        ret = trace_define_field(event_call, "__data_loc " #type "[]", #item,  \
-                               offsetof(typeof(field), __data_loc_##item),    \
-                                sizeof(field.__data_loc_##item), 0);
+                                offsetof(typeof(field), __data_loc_##item),   \
+                                sizeof(field.__data_loc_##item), 0,           \
+                                FILTER_OTHER);
 
 #undef __string
 #define __string(item, src) __dynamic_array(char, item, -1)
@@ -299,11 +322,9 @@ ftrace_define_fields_##call(struct ftrace_event_call *event_call)  \
        struct ftrace_raw_##call field;                                 \
        int ret;                                                        \
                                                                        \
-       __common_field(int, type, 1);                                   \
-       __common_field(unsigned char, flags, 0);                        \
-       __common_field(unsigned char, preempt_count, 0);                \
-       __common_field(int, pid, 1);                                    \
-       __common_field(int, tgid, 1);                                   \
+       ret = trace_define_common_fields(event_call);                   \
+       if (ret)                                                        \
+               return ret;                                             \
                                                                        \
        tstruct;                                                        \
                                                                        \
@@ -322,6 +343,9 @@ ftrace_define_fields_##call(struct ftrace_event_call *event_call)   \
 #undef __field
 #define __field(type, item)
 
+#undef __field_ext
+#define __field_ext(type, item, filter_type)
+
 #undef __array
 #define __array(type, item, len)
 
@@ -410,7 +434,7 @@ static void ftrace_profile_disable_##call(struct ftrace_event_call *event_call)\
  *     event_trace_printk(_RET_IP_, "<call>: " <fmt>);
  * }
  *
- * static int ftrace_reg_event_<call>(void)
+ * static int ftrace_reg_event_<call>(struct ftrace_event_call *unused)
  * {
  *     int ret;
  *
@@ -421,7 +445,7 @@ static void ftrace_profile_disable_##call(struct ftrace_event_call *event_call)\
  *     return ret;
  * }
  *
- * static void ftrace_unreg_event_<call>(void)
+ * static void ftrace_unreg_event_<call>(struct ftrace_event_call *unused)
  * {
  *     unregister_trace_<call>(ftrace_event_<call>);
  * }
@@ -454,7 +478,7 @@ static void ftrace_profile_disable_##call(struct ftrace_event_call *event_call)\
  *     trace_current_buffer_unlock_commit(event, irq_flags, pc);
  * }
  *
- * static int ftrace_raw_reg_event_<call>(void)
+ * static int ftrace_raw_reg_event_<call>(struct ftrace_event_call *unused)
  * {
  *     int ret;
  *
@@ -465,7 +489,7 @@ static void ftrace_profile_disable_##call(struct ftrace_event_call *event_call)\
  *     return ret;
  * }
  *
- * static void ftrace_unreg_event_<call>(void)
+ * static void ftrace_unreg_event_<call>(struct ftrace_event_call *unused)
  * {
  *     unregister_trace_<call>(ftrace_raw_event_<call>);
  * }
@@ -474,7 +498,7 @@ static void ftrace_profile_disable_##call(struct ftrace_event_call *event_call)\
  *     .trace                  = ftrace_raw_output_<call>, <-- stage 2
  * };
  *
- * static int ftrace_raw_init_event_<call>(void)
+ * static int ftrace_raw_init_event_<call>(struct ftrace_event_call *unused)
  * {
  *     int id;
  *
@@ -568,7 +592,7 @@ static void ftrace_raw_event_##call(proto)                          \
                trace_nowake_buffer_unlock_commit(event, irq_flags, pc); \
 }                                                                      \
                                                                        \
-static int ftrace_raw_reg_event_##call(void *ptr)                      \
+static int ftrace_raw_reg_event_##call(struct ftrace_event_call *unused)\
 {                                                                      \
        int ret;                                                        \
                                                                        \
@@ -579,7 +603,7 @@ static int ftrace_raw_reg_event_##call(void *ptr)                   \
        return ret;                                                     \
 }                                                                      \
                                                                        \
-static void ftrace_raw_unreg_event_##call(void *ptr)                   \
+static void ftrace_raw_unreg_event_##call(struct ftrace_event_call *unused)\
 {                                                                      \
        unregister_trace_##call(ftrace_raw_event_##call);               \
 }                                                                      \
@@ -588,7 +612,7 @@ static struct trace_event ftrace_event_type_##call = {                      \
        .trace                  = ftrace_raw_output_##call,             \
 };                                                                     \
                                                                        \
-static int ftrace_raw_init_event_##call(void)                          \
+static int ftrace_raw_init_event_##call(struct ftrace_event_call *unused)\
 {                                                                      \
        int id;                                                         \
                                                                        \