Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b8c0aa46 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
  ...
parents c7ed326f dc6f03f2
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -1097,6 +1097,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
			that can be changed at run time by the
			that can be changed at run time by the
			set_graph_function file in the debugfs tracing directory.
			set_graph_function file in the debugfs tracing directory.


	ftrace_graph_notrace=[function-list]
			[FTRACE] Do not trace from the functions specified in
			function-list.  This list is a comma separated list of
			functions that can be changed at run time by the
			set_graph_notrace file in the debugfs tracing directory.

	gamecon.map[2|3]=
	gamecon.map[2|3]=
			[HW,JOY] Multisystem joystick and NES/SNES/PSX pad
			[HW,JOY] Multisystem joystick and NES/SNES/PSX pad
			support via parallel port (up to 5 devices per port)
			support via parallel port (up to 5 devices per port)
+0 −26
Original line number Original line Diff line number Diff line
@@ -102,30 +102,6 @@ extern void mcount(void);
EXPORT_SYMBOL(mcount);
EXPORT_SYMBOL(mcount);




HAVE_FUNCTION_TRACE_MCOUNT_TEST
-------------------------------

This is an optional optimization for the normal case when tracing is turned off
in the system.  If you do not enable this Kconfig option, the common ftrace
code will take care of doing the checking for you.

To support this feature, you only need to check the function_trace_stop
variable in the mcount function.  If it is non-zero, there is no tracing to be
done at all, so you can return.

This additional pseudo code would simply be:
void mcount(void)
{
	/* save any bare state needed in order to do initial checking */

+	if (function_trace_stop)
+		return;

	extern void (*ftrace_trace_function)(unsigned long, unsigned long);
	if (ftrace_trace_function != ftrace_stub)
...


HAVE_FUNCTION_GRAPH_TRACER
HAVE_FUNCTION_GRAPH_TRACER
--------------------------
--------------------------


@@ -328,8 +304,6 @@ void mcount(void)


void ftrace_caller(void)
void ftrace_caller(void)
{
{
	/* implement HAVE_FUNCTION_TRACE_MCOUNT_TEST if you desire */

	/* save all state needed by the ABI (see paragraph above) */
	/* save all state needed by the ABI (see paragraph above) */


	unsigned long frompc = ...;
	unsigned long frompc = ...;
+0 −5
Original line number Original line Diff line number Diff line
@@ -96,11 +96,6 @@
 *     - ftrace_graph_caller to set up an exit hook
 *     - ftrace_graph_caller to set up an exit hook
 */
 */
ENTRY(_mcount)
ENTRY(_mcount)
#ifdef CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST
	ldr	x0, =ftrace_trace_stop
	ldr	x0, [x0]		// if ftrace_trace_stop
	ret				//   return;
#endif
	mcount_enter
	mcount_enter


	ldr	x0, =ftrace_trace_function
	ldr	x0, =ftrace_trace_function
+0 −1
Original line number Original line Diff line number Diff line
@@ -18,7 +18,6 @@ config BLACKFIN
	select HAVE_FTRACE_MCOUNT_RECORD
	select HAVE_FTRACE_MCOUNT_RECORD
	select HAVE_FUNCTION_GRAPH_TRACER
	select HAVE_FUNCTION_GRAPH_TRACER
	select HAVE_FUNCTION_TRACER
	select HAVE_FUNCTION_TRACER
	select HAVE_FUNCTION_TRACE_MCOUNT_TEST
	select HAVE_IDE
	select HAVE_IDE
	select HAVE_KERNEL_GZIP if RAMKERNEL
	select HAVE_KERNEL_GZIP if RAMKERNEL
	select HAVE_KERNEL_BZIP2 if RAMKERNEL
	select HAVE_KERNEL_BZIP2 if RAMKERNEL
+0 −18
Original line number Original line Diff line number Diff line
@@ -33,15 +33,6 @@ ENDPROC(__mcount)
 * function will be waiting there.  mmmm pie.
 * function will be waiting there.  mmmm pie.
 */
 */
ENTRY(_ftrace_caller)
ENTRY(_ftrace_caller)
# ifdef CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST
	/* optional micro optimization: return if stopped */
	p1.l = _function_trace_stop;
	p1.h = _function_trace_stop;
	r3 = [p1];
	cc = r3 == 0;
	if ! cc jump _ftrace_stub (bp);
# endif

	/* save first/second/third function arg and the return register */
	/* save first/second/third function arg and the return register */
	[--sp] = r2;
	[--sp] = r2;
	[--sp] = r0;
	[--sp] = r0;
@@ -83,15 +74,6 @@ ENDPROC(_ftrace_caller)


/* See documentation for _ftrace_caller */
/* See documentation for _ftrace_caller */
ENTRY(__mcount)
ENTRY(__mcount)
# ifdef CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST
	/* optional micro optimization: return if stopped */
	p1.l = _function_trace_stop;
	p1.h = _function_trace_stop;
	r3 = [p1];
	cc = r3 == 0;
	if ! cc jump _ftrace_stub (bp);
# endif

	/* save third function arg early so we can do testing below */
	/* save third function arg early so we can do testing below */
	[--sp] = r2;
	[--sp] = r2;


Loading