aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/ring_buffer.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-08-04 14:50:00 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-04 14:50:00 -0400
commitb8c0aa46b3e86083721b57ed2eec6bd2c29ebfba (patch)
tree45e349bf8a14aa99279d323fdc515e849fd349f3 /kernel/trace/ring_buffer.c
parentc7ed326fa7cafb83ced5a8b02517a61672fe9e90 (diff)
parentdc6f03f26f570104a2bb03f9d1deb588026d7c75 (diff)
Merge tag 'trace-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Pull tracing updates from Steven Rostedt: "This pull request has a lot of work done. The main thing is the changes to the ftrace function callback infrastructure. It's introducing a way to allow different functions to call directly different trampolines instead of all calling the same "mcount" one. The only user of this for now is the function graph tracer, which always had a different trampoline, but the function tracer trampoline was called and did basically nothing, and then the function graph tracer trampoline was called. The difference now, is that the function graph tracer trampoline can be called directly if a function is only being traced by the function graph trampoline. If function tracing is also happening on the same function, the old way is still done. The accounting for this takes up more memory when function graph tracing is activated, as it needs to keep track of which functions it uses. I have a new way that wont take as much memory, but it's not ready yet for this merge window, and will have to wait for the next one. Another big change was the removal of the ftrace_start/stop() calls that were used by the suspend/resume code that stopped function tracing when entering into suspend and resume paths. The stop of ftrace was done because there was some function that would crash the system if one called smp_processor_id()! The stop/start was a big hammer to solve the issue at the time, which was when ftrace was first introduced into Linux. Now ftrace has better infrastructure to debug such issues, and I found the problem function and labeled it with "notrace" and function tracing can now safely be activated all the way down into the guts of suspend and resume Other changes include clean ups of uprobe code, clean up of the trace_seq() code, and other various small fixes and clean ups to ftrace and tracing" * tag 'trace-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (57 commits) ftrace: Add warning if tramp hash does not match nr_trampolines ftrace: Fix trampoline hash update check on rec->flags ring-buffer: Use rb_page_size() instead of open coded head_page size ftrace: Rename ftrace_ops field from trampolines to nr_trampolines tracing: Convert local function_graph functions to static ftrace: Do not copy old hash when resetting tracing: let user specify tracing_thresh after selecting function_graph ring-buffer: Always run per-cpu ring buffer resize with schedule_work_on() tracing: Remove function_trace_stop and HAVE_FUNCTION_TRACE_MCOUNT_TEST s390/ftrace: remove check of obsolete variable function_trace_stop arm64, ftrace: Remove check of obsolete variable function_trace_stop Blackfin: ftrace: Remove check of obsolete variable function_trace_stop metag: ftrace: Remove check of obsolete variable function_trace_stop microblaze: ftrace: Remove check of obsolete variable function_trace_stop MIPS: ftrace: Remove check of obsolete variable function_trace_stop parisc: ftrace: Remove check of obsolete variable function_trace_stop sh: ftrace: Remove check of obsolete variable function_trace_stop sparc64,ftrace: Remove check of obsolete variable function_trace_stop tile: ftrace: Remove check of obsolete variable function_trace_stop ftrace: x86: Remove check of obsolete variable function_trace_stop ...
Diffstat (limited to 'kernel/trace/ring_buffer.c')
-rw-r--r--kernel/trace/ring_buffer.c26
1 files changed, 5 insertions, 21 deletions
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index ff7027199a9a..925f629658d6 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -1689,22 +1689,14 @@ int ring_buffer_resize(struct ring_buffer *buffer, unsigned long size,
1689 if (!cpu_buffer->nr_pages_to_update) 1689 if (!cpu_buffer->nr_pages_to_update)
1690 continue; 1690 continue;
1691 1691
1692 /* The update must run on the CPU that is being updated. */ 1692 /* Can't run something on an offline CPU. */
1693 preempt_disable(); 1693 if (!cpu_online(cpu)) {
1694 if (cpu == smp_processor_id() || !cpu_online(cpu)) {
1695 rb_update_pages(cpu_buffer); 1694 rb_update_pages(cpu_buffer);
1696 cpu_buffer->nr_pages_to_update = 0; 1695 cpu_buffer->nr_pages_to_update = 0;
1697 } else { 1696 } else {
1698 /*
1699 * Can not disable preemption for schedule_work_on()
1700 * on PREEMPT_RT.
1701 */
1702 preempt_enable();
1703 schedule_work_on(cpu, 1697 schedule_work_on(cpu,
1704 &cpu_buffer->update_pages_work); 1698 &cpu_buffer->update_pages_work);
1705 preempt_disable();
1706 } 1699 }
1707 preempt_enable();
1708 } 1700 }
1709 1701
1710 /* wait for all the updates to complete */ 1702 /* wait for all the updates to complete */
@@ -1742,22 +1734,14 @@ int ring_buffer_resize(struct ring_buffer *buffer, unsigned long size,
1742 1734
1743 get_online_cpus(); 1735 get_online_cpus();
1744 1736
1745 preempt_disable(); 1737 /* Can't run something on an offline CPU. */
1746 /* The update must run on the CPU that is being updated. */ 1738 if (!cpu_online(cpu_id))
1747 if (cpu_id == smp_processor_id() || !cpu_online(cpu_id))
1748 rb_update_pages(cpu_buffer); 1739 rb_update_pages(cpu_buffer);
1749 else { 1740 else {
1750 /*
1751 * Can not disable preemption for schedule_work_on()
1752 * on PREEMPT_RT.
1753 */
1754 preempt_enable();
1755 schedule_work_on(cpu_id, 1741 schedule_work_on(cpu_id,
1756 &cpu_buffer->update_pages_work); 1742 &cpu_buffer->update_pages_work);
1757 wait_for_completion(&cpu_buffer->update_done); 1743 wait_for_completion(&cpu_buffer->update_done);
1758 preempt_disable();
1759 } 1744 }
1760 preempt_enable();
1761 1745
1762 cpu_buffer->nr_pages_to_update = 0; 1746 cpu_buffer->nr_pages_to_update = 0;
1763 put_online_cpus(); 1747 put_online_cpus();
@@ -3775,7 +3759,7 @@ rb_iter_peek(struct ring_buffer_iter *iter, u64 *ts)
3775 if (rb_per_cpu_empty(cpu_buffer)) 3759 if (rb_per_cpu_empty(cpu_buffer))
3776 return NULL; 3760 return NULL;
3777 3761
3778 if (iter->head >= local_read(&iter->head_page->page->commit)) { 3762 if (iter->head >= rb_page_size(iter->head_page)) {
3779 rb_inc_iter(iter); 3763 rb_inc_iter(iter);
3780 goto again; 3764 goto again;
3781 } 3765 }