History

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

Linus Torvalds committed 12 years ago

Commit 477cc482 parents 7e09e73 87291344 files · +4 −20Browse files

Unified · Split

4 files
  1. include/linux/ftrace_event.h +0 −4
  2. include/trace/ftrace.h +2 −5
  3. kernel/trace/trace_events.c +0 −6
  4. kernel/trace/trace_export.c +2 −5
include/linux/ftrace_event.h+0−4
@@ -495,10 +495,6 @@ enum { · 494 unmodified lines
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,
include/trace/ftrace.h+2−5
@@ -310,15 +310,12 @@ static struct trace_event_functions ftrace_event_type_funcs_##call = { \ · 309 unmodified lines
310#undef __array310#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);
kernel/trace/trace_events.c+0−6
@@ -27,12 +27,6 @@ · 26 unmodified lines
27 27
28DEFINE_MUTEX(event_mutex);28DEFINE_MUTEX(event_mutex);
29 29
30DEFINE_MUTEX(event_storage_mutex);
31EXPORT_SYMBOL_GPL(event_storage_mutex);
32
33char event_storage[EVENT_STORAGE_SIZE];
34EXPORT_SYMBOL_GPL(event_storage);
35
36LIST_HEAD(ftrace_events);30LIST_HEAD(ftrace_events);
37static LIST_HEAD(ftrace_common_fields);31static LIST_HEAD(ftrace_common_fields);
38 32
kernel/trace/trace_export.c+2−5
@@ -95,15 +95,12 @@ static void __always_unused ____ftrace_check_##name(void) \ · 94 unmodified lines
95#undef __array95#undef __array
96#define __array(type, item, len) \96#define __array(type, item, len) \
97 do { \97 do { \
98 char *type_str = #type"["__stringify(len)"]"; \
98 BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \99 BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \
99 mutex_lock(&event_storage_mutex); \100 ret = trace_define_field(event_call, type_str, #item, \
100 snprintf(event_storage, sizeof(event_storage), \
101 "%s[%d]", #type, len); \
102 ret = trace_define_field(event_call, event_storage, #item, \
103 offsetof(typeof(field), item), \101 offsetof(typeof(field), item), \
104 sizeof(field.item), \102 sizeof(field.item), \
105 is_signed_type(type), filter_type); \103 is_signed_type(type), filter_type); \
106 mutex_unlock(&event_storage_mutex); \
107 if (ret) \104 if (ret) \
108 return ret; \105 return ret; \
109 } while (0);106 } while (0);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t