const char *ftrace_print_hex_seq(struct trace_seq *p,
                                 const unsigned char *buf, int len);
 
+const char *ftrace_print_array_seq(struct trace_seq *p,
+                                  const void *buf, int buf_len,
+                                  size_t el_size);
+
 struct trace_iterator;
 struct trace_event;
 
 
 #undef __print_hex
 #define __print_hex(buf, buf_len) ftrace_print_hex_seq(p, buf, buf_len)
 
+#undef __print_array
+#define __print_array(array, count, el_size)                           \
+       ({                                                              \
+               BUILD_BUG_ON(el_size != 1 && el_size != 2 &&            \
+                            el_size != 4 && el_size != 8);             \
+               ftrace_print_array_seq(p, array, count, el_size);       \
+       })
+
 #undef DECLARE_EVENT_CLASS
 #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
 static notrace enum print_line_t                                       \
 #undef __get_dynamic_array_len
 #undef __get_str
 #undef __get_bitmask
+#undef __print_array
 
 #undef TP_printk
 #define TP_printk(fmt, args...) "\"" fmt "\", "  __stringify(args)
 
 }
 EXPORT_SYMBOL(ftrace_print_hex_seq);
 
+const char *
+ftrace_print_array_seq(struct trace_seq *p, const void *buf, int buf_len,
+                      size_t el_size)
+{
+       const char *ret = trace_seq_buffer_ptr(p);
+       const char *prefix = "";
+       void *ptr = (void *)buf;
+
+       trace_seq_putc(p, '{');
+
+       while (ptr < buf + buf_len) {
+               switch (el_size) {
+               case 1:
+                       trace_seq_printf(p, "%s0x%x", prefix,
+                                        *(u8 *)ptr);
+                       break;
+               case 2:
+                       trace_seq_printf(p, "%s0x%x", prefix,
+                                        *(u16 *)ptr);
+                       break;
+               case 4:
+                       trace_seq_printf(p, "%s0x%x", prefix,
+                                        *(u32 *)ptr);
+                       break;
+               case 8:
+                       trace_seq_printf(p, "%s0x%llx", prefix,
+                                        *(u64 *)ptr);
+                       break;
+               default:
+                       trace_seq_printf(p, "BAD SIZE:%zu 0x%x", el_size,
+                                        *(u8 *)ptr);
+                       el_size = 1;
+               }
+               prefix = ",";
+               ptr += el_size;
+       }
+
+       trace_seq_putc(p, '}');
+       trace_seq_putc(p, 0);
+
+       return ret;
+}
+EXPORT_SYMBOL(ftrace_print_array_seq);
+
 int ftrace_raw_output_prep(struct trace_iterator *iter,
                           struct trace_event *trace_event)
 {