Merge tag 'v5.5-rc1' into core/kprobes, to resolve conflicts
[linux-2.6-microblaze.git] / include / trace / trace_events.h
index 7089760..96d77e5 100644 (file)
@@ -400,22 +400,16 @@ static struct trace_event_functions trace_event_type_funcs_##call = {     \
 #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
 
 #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), filter_type);    \
-       if (ret)                                                        \
-               return ret;
+#define __field_ext(_type, _item, _filter_type) {                      \
+       .type = #_type, .name = #_item,                                 \
+       .size = sizeof(_type), .align = __alignof__(_type),             \
+       .is_signed = is_signed_type(_type), .filter_type = _filter_type },
 
 #undef __field_struct_ext
-#define __field_struct_ext(type, item, filter_type)                    \
-       ret = trace_define_field(event_call, #type, #item,              \
-                                offsetof(typeof(field), item),         \
-                                sizeof(field.item),                    \
-                                0, filter_type);                       \
-       if (ret)                                                        \
-               return ret;
+#define __field_struct_ext(_type, _item, _filter_type) {               \
+       .type = #_type, .name = #_item,                                 \
+       .size = sizeof(_type), .align = __alignof__(_type),             \
+       0, .filter_type = _filter_type },
 
 #undef __field
 #define __field(type, item)    __field_ext(type, item, FILTER_OTHER)
@@ -424,25 +418,16 @@ static struct trace_event_functions trace_event_type_funcs_##call = {     \
 #define __field_struct(type, item) __field_struct_ext(type, item, FILTER_OTHER)
 
 #undef __array
-#define __array(type, item, len)                                       \
-       do {                                                            \
-               char *type_str = #type"["__stringify(len)"]";           \
-               BUILD_BUG_ON(len > MAX_FILTER_STR_VAL);                 \
-               BUILD_BUG_ON(len <= 0);                                 \
-               ret = trace_define_field(event_call, type_str, #item,   \
-                                offsetof(typeof(field), item),         \
-                                sizeof(field.item),                    \
-                                is_signed_type(type), FILTER_OTHER);   \
-               if (ret)                                                \
-                       return ret;                                     \
-       } while (0);
+#define __array(_type, _item, _len) {                                  \
+       .type = #_type"["__stringify(_len)"]", .name = #_item,          \
+       .size = sizeof(_type[_len]), .align = __alignof__(_type),       \
+       .is_signed = is_signed_type(_type), .filter_type = FILTER_OTHER },
 
 #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),              \
-                                is_signed_type(type), FILTER_OTHER);
+#define __dynamic_array(_type, _item, _len) {                          \
+       .type = "__data_loc " #_type "[]", .name = #_item,              \
+       .size = 4, .align = 4,                                          \
+       .is_signed = is_signed_type(_type), .filter_type = FILTER_OTHER },
 
 #undef __string
 #define __string(item, src) __dynamic_array(char, item, -1)
@@ -452,16 +437,9 @@ static struct trace_event_functions trace_event_type_funcs_##call = {      \
 
 #undef DECLARE_EVENT_CLASS
 #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, func, print)   \
-static int notrace __init                                              \
-trace_event_define_fields_##call(struct trace_event_call *event_call)  \
-{                                                                      \
-       struct trace_event_raw_##call field;                            \
-       int ret;                                                        \
-                                                                       \
-       tstruct;                                                        \
-                                                                       \
-       return ret;                                                     \
-}
+static struct trace_event_fields trace_event_fields_##call[] = {       \
+       tstruct                                                         \
+       {} };
 
 #undef DEFINE_EVENT
 #define DEFINE_EVENT(template, name, proto, args)
@@ -619,7 +597,7 @@ static inline notrace int trace_event_get_offsets_##call(           \
  *
  * static struct trace_event_class __used event_class_<template> = {
  *     .system                 = "<system>",
- *     .define_fields          = trace_event_define_fields_<call>,
+ *     .fields_array           = trace_event_fields_<call>,
  *     .fields                 = LIST_HEAD_INIT(event_class_##call.fields),
  *     .raw_init               = trace_event_raw_init,
  *     .probe                  = trace_event_raw_event_##call,
@@ -757,6 +735,7 @@ static inline void ftrace_test_probe_##call(void)                   \
 #undef __get_str
 #undef __get_bitmask
 #undef __print_array
+#undef __print_hex_dump
 
 #undef TP_printk
 #define TP_printk(fmt, args...) "\"" fmt "\", "  __stringify(args)
@@ -767,7 +746,7 @@ _TRACE_PERF_PROTO(call, PARAMS(proto));                                     \
 static char print_fmt_##call[] = print;                                        \
 static struct trace_event_class __used __refdata event_class_##call = { \
        .system                 = TRACE_SYSTEM_STRING,                  \
-       .define_fields          = trace_event_define_fields_##call,     \
+       .fields_array           = trace_event_fields_##call,            \
        .fields                 = LIST_HEAD_INIT(event_class_##call.fields),\
        .raw_init               = trace_event_raw_init,                 \
        .probe                  = trace_event_raw_event_##call,         \