diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/ftrace_event.h | 15 | ||||
-rw-r--r-- | include/trace/ftrace.h | 15 |
2 files changed, 20 insertions, 10 deletions
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 755480484eb6..23f7179bf74e 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
@@ -93,13 +93,17 @@ void tracing_generic_entry_update(struct trace_entry *entry, | |||
93 | unsigned long flags, | 93 | unsigned long flags, |
94 | int pc); | 94 | int pc); |
95 | struct ring_buffer_event * | 95 | struct ring_buffer_event * |
96 | trace_current_buffer_lock_reserve(int type, unsigned long len, | 96 | trace_current_buffer_lock_reserve(struct ring_buffer **current_buffer, |
97 | int type, unsigned long len, | ||
97 | unsigned long flags, int pc); | 98 | unsigned long flags, int pc); |
98 | void trace_current_buffer_unlock_commit(struct ring_buffer_event *event, | 99 | void trace_current_buffer_unlock_commit(struct ring_buffer *buffer, |
100 | struct ring_buffer_event *event, | ||
99 | unsigned long flags, int pc); | 101 | unsigned long flags, int pc); |
100 | void trace_nowake_buffer_unlock_commit(struct ring_buffer_event *event, | 102 | void trace_nowake_buffer_unlock_commit(struct ring_buffer *buffer, |
103 | struct ring_buffer_event *event, | ||
101 | unsigned long flags, int pc); | 104 | unsigned long flags, int pc); |
102 | void trace_current_buffer_discard_commit(struct ring_buffer_event *event); | 105 | void trace_current_buffer_discard_commit(struct ring_buffer *buffer, |
106 | struct ring_buffer_event *event); | ||
103 | 107 | ||
104 | void tracing_record_cmdline(struct task_struct *tsk); | 108 | void tracing_record_cmdline(struct task_struct *tsk); |
105 | 109 | ||
@@ -135,7 +139,8 @@ struct ftrace_event_call { | |||
135 | 139 | ||
136 | extern void destroy_preds(struct ftrace_event_call *call); | 140 | extern void destroy_preds(struct ftrace_event_call *call); |
137 | extern int filter_match_preds(struct ftrace_event_call *call, void *rec); | 141 | extern int filter_match_preds(struct ftrace_event_call *call, void *rec); |
138 | extern int filter_current_check_discard(struct ftrace_event_call *call, | 142 | extern int filter_current_check_discard(struct ring_buffer *buffer, |
143 | struct ftrace_event_call *call, | ||
139 | void *rec, | 144 | void *rec, |
140 | struct ring_buffer_event *event); | 145 | struct ring_buffer_event *event); |
141 | 146 | ||
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index bfbc842600a1..308bafd93325 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -460,13 +460,15 @@ static void ftrace_profile_disable_##call(struct ftrace_event_call *event_call)\ | |||
460 | * { | 460 | * { |
461 | * struct ring_buffer_event *event; | 461 | * struct ring_buffer_event *event; |
462 | * struct ftrace_raw_<call> *entry; <-- defined in stage 1 | 462 | * struct ftrace_raw_<call> *entry; <-- defined in stage 1 |
463 | * struct ring_buffer *buffer; | ||
463 | * unsigned long irq_flags; | 464 | * unsigned long irq_flags; |
464 | * int pc; | 465 | * int pc; |
465 | * | 466 | * |
466 | * local_save_flags(irq_flags); | 467 | * local_save_flags(irq_flags); |
467 | * pc = preempt_count(); | 468 | * pc = preempt_count(); |
468 | * | 469 | * |
469 | * event = trace_current_buffer_lock_reserve(event_<call>.id, | 470 | * event = trace_current_buffer_lock_reserve(&buffer, |
471 | * event_<call>.id, | ||
470 | * sizeof(struct ftrace_raw_<call>), | 472 | * sizeof(struct ftrace_raw_<call>), |
471 | * irq_flags, pc); | 473 | * irq_flags, pc); |
472 | * if (!event) | 474 | * if (!event) |
@@ -476,7 +478,7 @@ static void ftrace_profile_disable_##call(struct ftrace_event_call *event_call)\ | |||
476 | * <assign>; <-- Here we assign the entries by the __field and | 478 | * <assign>; <-- Here we assign the entries by the __field and |
477 | * __array macros. | 479 | * __array macros. |
478 | * | 480 | * |
479 | * trace_current_buffer_unlock_commit(event, irq_flags, pc); | 481 | * trace_current_buffer_unlock_commit(buffer, event, irq_flags, pc); |
480 | * } | 482 | * } |
481 | * | 483 | * |
482 | * static int ftrace_raw_reg_event_<call>(void) | 484 | * static int ftrace_raw_reg_event_<call>(void) |
@@ -568,6 +570,7 @@ static void ftrace_raw_event_##call(proto) \ | |||
568 | struct ftrace_event_call *event_call = &event_##call; \ | 570 | struct ftrace_event_call *event_call = &event_##call; \ |
569 | struct ring_buffer_event *event; \ | 571 | struct ring_buffer_event *event; \ |
570 | struct ftrace_raw_##call *entry; \ | 572 | struct ftrace_raw_##call *entry; \ |
573 | struct ring_buffer *buffer; \ | ||
571 | unsigned long irq_flags; \ | 574 | unsigned long irq_flags; \ |
572 | int __data_size; \ | 575 | int __data_size; \ |
573 | int pc; \ | 576 | int pc; \ |
@@ -577,7 +580,8 @@ static void ftrace_raw_event_##call(proto) \ | |||
577 | \ | 580 | \ |
578 | __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \ | 581 | __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \ |
579 | \ | 582 | \ |
580 | event = trace_current_buffer_lock_reserve(event_##call.id, \ | 583 | event = trace_current_buffer_lock_reserve(&buffer, \ |
584 | event_##call.id, \ | ||
581 | sizeof(*entry) + __data_size, \ | 585 | sizeof(*entry) + __data_size, \ |
582 | irq_flags, pc); \ | 586 | irq_flags, pc); \ |
583 | if (!event) \ | 587 | if (!event) \ |
@@ -589,8 +593,9 @@ static void ftrace_raw_event_##call(proto) \ | |||
589 | \ | 593 | \ |
590 | { assign; } \ | 594 | { assign; } \ |
591 | \ | 595 | \ |
592 | if (!filter_current_check_discard(event_call, entry, event)) \ | 596 | if (!filter_current_check_discard(buffer, event_call, entry, event)) \ |
593 | trace_nowake_buffer_unlock_commit(event, irq_flags, pc); \ | 597 | trace_nowake_buffer_unlock_commit(buffer, \ |
598 | event, irq_flags, pc); \ | ||
594 | } \ | 599 | } \ |
595 | \ | 600 | \ |
596 | static int ftrace_raw_reg_event_##call(void *ptr) \ | 601 | static int ftrace_raw_reg_event_##call(void *ptr) \ |