New features for this release:

 o Pretty much a full rewrite of the processing of function plugins.
   i.e. echo do_IRQ:stacktrace > set_ftrace_filter

 o The rewrite was needed to add plugins to be unique to tracing instances.
   i.e. mkdir instance/foo; cd instances/foo; echo do_IRQ:stacktrace > set_ftrace_filter
   The old way was written very hacky. This removes a lot of those hacks.

 o New "function-fork" tracing option. When set, pids in the set_ftrace_pid
   will have their children added when the processes with their pids
   listed in the set_ftrace_pid file forks.

 o Exposure of "maxactive" for kretprobe in kprobe_events

 o Allow for builtin init functions to be traced by the function tracer
   (via the kernel command line). Module init function tracing will come
   in the next release.

 o Added more selftests, and have selftests also test in an instance.
ring-buffer: Return reader page back into existing ring buffer

When reading the ring buffer for consuming, it is optimized for splice,
where a page is taken out of the ring buffer (zero copy) and sent to the
reading consumer. When the read is finished with the page, it calls
ring_buffer_free_read_page(), which simply frees the page. The next time the
reader needs to get a page from the ring buffer, it must call
ring_buffer_alloc_read_page() which allocates and initializes a reader page
for the ring buffer to be swapped into the ring buffer for a new filled page
for the reader.

The problem is that there's no reason to actually free the page when it is
passed back to the ring buffer. It can hold it off and reuse it for the next
iteration. This completely removes the interaction with the page_alloc
mechanism.

Using the trace-cmd utility to record all events (causing trace-cmd to
require reading lots of pages from the ring buffer, and calling
ring_buffer_alloc/free_read_page() several times), and also assigning a
stack trace trigger to the mm_page_alloc event, we can see how many times
the ring_buffer_alloc_read_page() needed to allocate a page for the ring
buffer.

Before this change:

  # trace-cmd record -e all -e mem_page_alloc -R stacktrace sleep 1
  # trace-cmd report |grep ring_buffer_alloc_read_page | wc -l
  9968

After this change:

  # trace-cmd record -e all -e mem_page_alloc -R stacktrace sleep 1
  # trace-cmd report |grep ring_buffer_alloc_read_page | wc -l
  4

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
4 files changed