Commit d2d8b146 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull tracing updates from Steven Rostedt:
 "The major changes in this tracing update includes:

   - Removal of non-DYNAMIC_FTRACE from 32bit x86

   - Removal of mcount support from x86

   - Emulating a call from int3 on x86_64, fixes live kernel patching

   - Consolidated Tracing Error logs file

  Minor updates:

   - Removal of klp_check_compiler_support()

   - kdb ftrace dumping output changes

   - Accessing and creating ftrace instances from inside the kernel

   - Clean up of #define if macro

   - Introduction of TRACE_EVENT_NOP() to disable trace events based on
     config options

  And other minor fixes and clean ups"

* tag 'trace-v5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (44 commits)
  x86: Hide the int3_emulate_call/jmp functions from UML
  livepatch: Remove klp_check_compiler_support()
  ftrace/x86: Remove mcount support
  ftrace/x86_32: Remove support for non DYNAMIC_FTRACE
  tracing: Simplify "if" macro code
  tracing: Fix documentation about disabling options using trace_options
  tracing: Replace kzalloc with kcalloc
  tracing: Fix partial reading of trace event's id file
  tracing: Allow RCU to run between postponed startup tests
  tracing: Fix white space issues in parse_pred() function
  tracing: Eliminate const char[] auto variables
  ring-buffer: Fix mispelling of Calculate
  tracing: probeevent: Fix to make the type of $comm string
  tracing: probeevent: Do not accumulate on ret variable
  tracing: uprobes: Re-enable $comm support for uprobe events
  ftrace/x86_64: Emulate call function while updating in breakpoint handler
  x86_64: Allow breakpoints to emulate call instructions
  x86_64: Add gap to int3 to allow for call emulation
  tracing: kdb: Allow ftdump to skip all but the last few entries
  tracing: Add trace_total_entries() / trace_total_entries_cpu()
  ...
parents 2bbacd1a 693713cb
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
@@ -765,6 +765,37 @@ Here is the list of current tracers that may be configured.
	tracers from tracing simply echo "nop" into
	current_tracer.

Error conditions
----------------

  For most ftrace commands, failure modes are obvious and communicated
  using standard return codes.

  For other more involved commands, extended error information may be
  available via the tracing/error_log file.  For the commands that
  support it, reading the tracing/error_log file after an error will
  display more detailed information about what went wrong, if
  information is available.  The tracing/error_log file is a circular
  error log displaying a small number (currently, 8) of ftrace errors
  for the last (8) failed commands.

  The extended error information and usage takes the form shown in
  this example::

    # echo xxx > /sys/kernel/debug/tracing/events/sched/sched_wakeup/trigger
    echo: write error: Invalid argument

    # cat /sys/kernel/debug/tracing/error_log
    [ 5348.887237] location: error: Couldn't yyy: zzz
      Command: xxx
               ^
    [ 7517.023364] location: error: Bad rrr: sss
      Command: ppp qqq
                   ^

  To clear the error log, echo the empty string into it::

    # echo > /sys/kernel/debug/tracing/error_log

Examples of using the tracer
----------------------------
+2 −14
Original line number Diff line number Diff line
@@ -199,20 +199,8 @@ Extended error information

  For some error conditions encountered when invoking a hist trigger
  command, extended error information is available via the
  corresponding event's 'hist' file.  Reading the hist file after an
  error will display more detailed information about what went wrong,
  if information is available.  This extended error information will
  be available until the next hist trigger command for that event.

  If available for a given error condition, the extended error
  information and usage takes the following form::

    # echo xxx > /sys/kernel/debug/tracing/events/sched/sched_wakeup/trigger
    echo: write error: Invalid argument

    # cat /sys/kernel/debug/tracing/events/sched/sched_wakeup/hist
    ERROR: Couldn't yyy: zzz
      Last command: xxx
  tracing/error_log file.  See Error Conditions in
  :file:`Documentation/trace/ftrace.rst` for details.

6.2 'hist' trigger examples
---------------------------
+0 −1
Original line number Diff line number Diff line
@@ -7,7 +7,6 @@
#ifndef CONFIG_DYNAMIC_FTRACE
extern void (*ftrace_trace_function)(unsigned long, unsigned long,
				     struct ftrace_ops*, struct pt_regs*);
extern int ftrace_graph_entry_stub(struct ftrace_graph_ent *trace);
extern void ftrace_graph_caller(void);

noinline void __naked ftrace_stub(unsigned long ip, unsigned long parent_ip,
+0 −1
Original line number Diff line number Diff line
@@ -51,7 +51,6 @@ void notrace __hot ftrace_function_trampoline(unsigned long parent,
				unsigned long org_sp_gr3)
{
	extern ftrace_func_t ftrace_trace_function;  /* depends on CONFIG_DYNAMIC_FTRACE */
	extern int ftrace_graph_entry_stub(struct ftrace_graph_ent *trace);

	if (ftrace_trace_function != ftrace_stub) {
		/* struct ftrace_ops *op, struct pt_regs *regs); */
+0 −5
Original line number Diff line number Diff line
@@ -24,11 +24,6 @@
#include <linux/sched/task_stack.h>

#ifdef CONFIG_LIVEPATCH
static inline int klp_check_compiler_support(void)
{
	return 0;
}

static inline void klp_arch_set_pc(struct pt_regs *regs, unsigned long ip)
{
	regs->nip = ip;
Loading