aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-03-21 01:09:30 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-03-21 01:09:30 -0400
commit477cc48484ea0bfdee9e8319259b35a0ec03f332 (patch)
tree95a45bf408c3d7dec964855f67287cfcd162ad65 /include
parent7e09e738afd21ef99f047425fc0b0c9be8b03254 (diff)
parent87291347c49dc40aa339f587b209618201c2e527 (diff)
Merge tag 'trace-fixes-v3.14-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Pull trace fix from Steven Rostedt: "Vaibhav Nagarnaik discovered that since 3.10 a clean-up patch made the array index in the trace event format bogus. He supplied an elegant solution that uses __stringify() and also removes the need for the event_storage and event_storage_mutex and also cuts off a few K of overhead from the trace events" * tag 'trace-fixes-v3.14-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing: Fix array size mismatch in format string
Diffstat (limited to 'include')
-rw-r--r--include/linux/ftrace_event.h4
-rw-r--r--include/trace/ftrace.h7
2 files changed, 2 insertions, 9 deletions
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 4e4cc28623ad..4cdb3a17bcb5 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -495,10 +495,6 @@ enum {
495 FILTER_TRACE_FN, 495 FILTER_TRACE_FN,
496}; 496};
497 497
498#define EVENT_STORAGE_SIZE 128
499extern struct mutex event_storage_mutex;
500extern char event_storage[EVENT_STORAGE_SIZE];
501
502extern int trace_event_raw_init(struct ftrace_event_call *call); 498extern int trace_event_raw_init(struct ftrace_event_call *call);
503extern int trace_define_field(struct ftrace_event_call *call, const char *type, 499extern int trace_define_field(struct ftrace_event_call *call, const char *type,
504 const char *name, int offset, int size, 500 const char *name, int offset, int size,
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index 1a8b28db3775..1ee19a24cc5f 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -310,15 +310,12 @@ static struct trace_event_functions ftrace_event_type_funcs_##call = { \
310#undef __array 310#undef __array
311#define __array(type, item, len) \ 311#define __array(type, item, len) \
312 do { \ 312 do { \
313 mutex_lock(&event_storage_mutex); \ 313 char *type_str = #type"["__stringify(len)"]"; \
314 BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \ 314 BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \
315 snprintf(event_storage, sizeof(event_storage), \ 315 ret = trace_define_field(event_call, type_str, #item, \
316 "%s[%d]", #type, len); \
317 ret = trace_define_field(event_call, event_storage, #item, \
318 offsetof(typeof(field), item), \ 316 offsetof(typeof(field), item), \
319 sizeof(field.item), \ 317 sizeof(field.item), \
320 is_signed_type(type), FILTER_OTHER); \ 318 is_signed_type(type), FILTER_OTHER); \
321 mutex_unlock(&event_storage_mutex); \
322 if (ret) \ 319 if (ret) \
323 return ret; \ 320 return ret; \
324 } while (0); 321 } while (0);