diff options
Diffstat (limited to 'kernel/trace')
| -rw-r--r-- | kernel/trace/ftrace.c | 8 | ||||
| -rw-r--r-- | kernel/trace/ring_buffer.c | 14 | ||||
| -rw-r--r-- | kernel/trace/trace.c | 8 | ||||
| -rw-r--r-- | kernel/trace/trace_output.c | 5 |
4 files changed, 20 insertions, 15 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 37ba67e33265..6dc4e5ef7a01 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
| @@ -740,7 +740,7 @@ ftrace_profile_write(struct file *filp, const char __user *ubuf, | |||
| 740 | out: | 740 | out: |
| 741 | mutex_unlock(&ftrace_profile_lock); | 741 | mutex_unlock(&ftrace_profile_lock); |
| 742 | 742 | ||
| 743 | filp->f_pos += cnt; | 743 | *ppos += cnt; |
| 744 | 744 | ||
| 745 | return cnt; | 745 | return cnt; |
| 746 | } | 746 | } |
| @@ -2222,15 +2222,15 @@ ftrace_regex_write(struct file *file, const char __user *ubuf, | |||
| 2222 | ret = ftrace_process_regex(parser->buffer, | 2222 | ret = ftrace_process_regex(parser->buffer, |
| 2223 | parser->idx, enable); | 2223 | parser->idx, enable); |
| 2224 | if (ret) | 2224 | if (ret) |
| 2225 | goto out; | 2225 | goto out_unlock; |
| 2226 | 2226 | ||
| 2227 | trace_parser_clear(parser); | 2227 | trace_parser_clear(parser); |
| 2228 | } | 2228 | } |
| 2229 | 2229 | ||
| 2230 | ret = read; | 2230 | ret = read; |
| 2231 | 2231 | out_unlock: | |
| 2232 | mutex_unlock(&ftrace_regex_lock); | 2232 | mutex_unlock(&ftrace_regex_lock); |
| 2233 | out: | 2233 | |
| 2234 | return ret; | 2234 | return ret; |
| 2235 | } | 2235 | } |
| 2236 | 2236 | ||
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index d4ff01970547..5dd017fea6f5 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c | |||
| @@ -483,7 +483,7 @@ struct ring_buffer_iter { | |||
| 483 | /* Up this if you want to test the TIME_EXTENTS and normalization */ | 483 | /* Up this if you want to test the TIME_EXTENTS and normalization */ |
| 484 | #define DEBUG_SHIFT 0 | 484 | #define DEBUG_SHIFT 0 |
| 485 | 485 | ||
| 486 | static inline u64 rb_time_stamp(struct ring_buffer *buffer, int cpu) | 486 | static inline u64 rb_time_stamp(struct ring_buffer *buffer) |
| 487 | { | 487 | { |
| 488 | /* shift to debug/test normalization and TIME_EXTENTS */ | 488 | /* shift to debug/test normalization and TIME_EXTENTS */ |
| 489 | return buffer->clock() << DEBUG_SHIFT; | 489 | return buffer->clock() << DEBUG_SHIFT; |
| @@ -494,7 +494,7 @@ u64 ring_buffer_time_stamp(struct ring_buffer *buffer, int cpu) | |||
| 494 | u64 time; | 494 | u64 time; |
| 495 | 495 | ||
| 496 | preempt_disable_notrace(); | 496 | preempt_disable_notrace(); |
| 497 | time = rb_time_stamp(buffer, cpu); | 497 | time = rb_time_stamp(buffer); |
| 498 | preempt_enable_no_resched_notrace(); | 498 | preempt_enable_no_resched_notrace(); |
| 499 | 499 | ||
| 500 | return time; | 500 | return time; |
| @@ -599,7 +599,7 @@ static struct list_head *rb_list_head(struct list_head *list) | |||
| 599 | } | 599 | } |
| 600 | 600 | ||
| 601 | /* | 601 | /* |
| 602 | * rb_is_head_page - test if the give page is the head page | 602 | * rb_is_head_page - test if the given page is the head page |
| 603 | * | 603 | * |
| 604 | * Because the reader may move the head_page pointer, we can | 604 | * Because the reader may move the head_page pointer, we can |
| 605 | * not trust what the head page is (it may be pointing to | 605 | * not trust what the head page is (it may be pointing to |
| @@ -1193,6 +1193,7 @@ rb_remove_pages(struct ring_buffer_per_cpu *cpu_buffer, unsigned nr_pages) | |||
| 1193 | atomic_inc(&cpu_buffer->record_disabled); | 1193 | atomic_inc(&cpu_buffer->record_disabled); |
| 1194 | synchronize_sched(); | 1194 | synchronize_sched(); |
| 1195 | 1195 | ||
| 1196 | spin_lock_irq(&cpu_buffer->reader_lock); | ||
| 1196 | rb_head_page_deactivate(cpu_buffer); | 1197 | rb_head_page_deactivate(cpu_buffer); |
| 1197 | 1198 | ||
| 1198 | for (i = 0; i < nr_pages; i++) { | 1199 | for (i = 0; i < nr_pages; i++) { |
| @@ -1207,6 +1208,7 @@ rb_remove_pages(struct ring_buffer_per_cpu *cpu_buffer, unsigned nr_pages) | |||
| 1207 | return; | 1208 | return; |
| 1208 | 1209 | ||
| 1209 | rb_reset_cpu(cpu_buffer); | 1210 | rb_reset_cpu(cpu_buffer); |
| 1211 | spin_unlock_irq(&cpu_buffer->reader_lock); | ||
| 1210 | 1212 | ||
| 1211 | rb_check_pages(cpu_buffer); | 1213 | rb_check_pages(cpu_buffer); |
| 1212 | 1214 | ||
| @@ -1868,7 +1870,7 @@ rb_move_tail(struct ring_buffer_per_cpu *cpu_buffer, | |||
| 1868 | * Nested commits always have zero deltas, so | 1870 | * Nested commits always have zero deltas, so |
| 1869 | * just reread the time stamp | 1871 | * just reread the time stamp |
| 1870 | */ | 1872 | */ |
| 1871 | *ts = rb_time_stamp(buffer, cpu_buffer->cpu); | 1873 | *ts = rb_time_stamp(buffer); |
| 1872 | next_page->page->time_stamp = *ts; | 1874 | next_page->page->time_stamp = *ts; |
| 1873 | } | 1875 | } |
| 1874 | 1876 | ||
| @@ -2111,7 +2113,7 @@ rb_reserve_next_event(struct ring_buffer *buffer, | |||
| 2111 | if (RB_WARN_ON(cpu_buffer, ++nr_loops > 1000)) | 2113 | if (RB_WARN_ON(cpu_buffer, ++nr_loops > 1000)) |
| 2112 | goto out_fail; | 2114 | goto out_fail; |
| 2113 | 2115 | ||
| 2114 | ts = rb_time_stamp(cpu_buffer->buffer, cpu_buffer->cpu); | 2116 | ts = rb_time_stamp(cpu_buffer->buffer); |
| 2115 | 2117 | ||
| 2116 | /* | 2118 | /* |
| 2117 | * Only the first commit can update the timestamp. | 2119 | * Only the first commit can update the timestamp. |
| @@ -2681,7 +2683,7 @@ unsigned long ring_buffer_entries(struct ring_buffer *buffer) | |||
| 2681 | EXPORT_SYMBOL_GPL(ring_buffer_entries); | 2683 | EXPORT_SYMBOL_GPL(ring_buffer_entries); |
| 2682 | 2684 | ||
| 2683 | /** | 2685 | /** |
| 2684 | * ring_buffer_overrun_cpu - get the number of overruns in buffer | 2686 | * ring_buffer_overruns - get the number of overruns in buffer |
| 2685 | * @buffer: The ring buffer | 2687 | * @buffer: The ring buffer |
| 2686 | * | 2688 | * |
| 2687 | * Returns the total number of overruns in the ring buffer | 2689 | * Returns the total number of overruns in the ring buffer |
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index c820b0310a12..b20d3ec75de9 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
| @@ -2440,7 +2440,7 @@ tracing_trace_options_write(struct file *filp, const char __user *ubuf, | |||
| 2440 | return ret; | 2440 | return ret; |
| 2441 | } | 2441 | } |
| 2442 | 2442 | ||
| 2443 | filp->f_pos += cnt; | 2443 | *ppos += cnt; |
| 2444 | 2444 | ||
| 2445 | return cnt; | 2445 | return cnt; |
| 2446 | } | 2446 | } |
| @@ -2582,7 +2582,7 @@ tracing_ctrl_write(struct file *filp, const char __user *ubuf, | |||
| 2582 | } | 2582 | } |
| 2583 | mutex_unlock(&trace_types_lock); | 2583 | mutex_unlock(&trace_types_lock); |
| 2584 | 2584 | ||
| 2585 | filp->f_pos += cnt; | 2585 | *ppos += cnt; |
| 2586 | 2586 | ||
| 2587 | return cnt; | 2587 | return cnt; |
| 2588 | } | 2588 | } |
| @@ -2764,7 +2764,7 @@ tracing_set_trace_write(struct file *filp, const char __user *ubuf, | |||
| 2764 | if (err) | 2764 | if (err) |
| 2765 | return err; | 2765 | return err; |
| 2766 | 2766 | ||
| 2767 | filp->f_pos += ret; | 2767 | *ppos += ret; |
| 2768 | 2768 | ||
| 2769 | return ret; | 2769 | return ret; |
| 2770 | } | 2770 | } |
| @@ -3299,7 +3299,7 @@ tracing_entries_write(struct file *filp, const char __user *ubuf, | |||
| 3299 | } | 3299 | } |
| 3300 | } | 3300 | } |
| 3301 | 3301 | ||
| 3302 | filp->f_pos += cnt; | 3302 | *ppos += cnt; |
| 3303 | 3303 | ||
| 3304 | /* If check pages failed, return ENOMEM */ | 3304 | /* If check pages failed, return ENOMEM */ |
| 3305 | if (tracing_disabled) | 3305 | if (tracing_disabled) |
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c index ed17565826b0..b6c12c6a1bcd 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c | |||
| @@ -69,6 +69,9 @@ enum print_line_t trace_print_printk_msg_only(struct trace_iterator *iter) | |||
| 69 | * @s: trace sequence descriptor | 69 | * @s: trace sequence descriptor |
| 70 | * @fmt: printf format string | 70 | * @fmt: printf format string |
| 71 | * | 71 | * |
| 72 | * It returns 0 if the trace oversizes the buffer's free | ||
| 73 | * space, 1 otherwise. | ||
| 74 | * | ||
| 72 | * The tracer may use either sequence operations or its own | 75 | * The tracer may use either sequence operations or its own |
| 73 | * copy to user routines. To simplify formating of a trace | 76 | * copy to user routines. To simplify formating of a trace |
| 74 | * trace_seq_printf is used to store strings into a special | 77 | * trace_seq_printf is used to store strings into a special |
| @@ -95,7 +98,7 @@ trace_seq_printf(struct trace_seq *s, const char *fmt, ...) | |||
| 95 | 98 | ||
| 96 | s->len += ret; | 99 | s->len += ret; |
| 97 | 100 | ||
| 98 | return len; | 101 | return 1; |
| 99 | } | 102 | } |
| 100 | EXPORT_SYMBOL_GPL(trace_seq_printf); | 103 | EXPORT_SYMBOL_GPL(trace_seq_printf); |
| 101 | 104 | ||
