1. 27 Oct, 2021 12 commits
  2. 26 Oct, 2021 17 commits
  3. 22 Oct, 2021 7 commits
  4. 21 Oct, 2021 4 commits
    • Sven Schnelle's avatar
      kprobes: convert tests to kunit · e44e81c5
      Sven Schnelle authored
      This converts the kprobes testcases to use the kunit framework.
      It adds a dependency on CONFIG_KUNIT, and the output will change
      to TAP:
      
      TAP version 14
      1..1
          # Subtest: kprobes_test
          1..4
      random: crng init done
          ok 1 - test_kprobe
          ok 2 - test_kprobes
          ok 3 - test_kretprobe
          ok 4 - test_kretprobes
      ok 1 - kprobes_test
      
      Note that the kprobes testcases are no longer run immediately after
      kprobes initialization, but as a late initcall when kunit is
      initialized. kprobes itself is initialized with an early initcall,
      so the order is still correct.
      Signed-off-by: default avatarSven Schnelle <svens@linux.ibm.com>
      Acked-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      e44e81c5
    • Arnd Bergmann's avatar
      tracing: use %ps format string to print symbols · 8720aeec
      Arnd Bergmann authored
      clang started warning about excessive stack usage in
      hist_trigger_print_key()
      
      kernel/trace/trace_events_hist.c:4723:13: error: stack frame size (1336) exceeds limit (1024) in function 'hist_trigger_print_key' [-Werror,-Wframe-larger-than]
      
      The problem is that there are two 512-byte arrays on the stack if
      hist_trigger_stacktrace_print() gets inlined. I don't think this has
      changed in the past five years, but something probably changed the
      inlining decisions made by the compiler, so the problem is now made
      more obvious.
      
      Rather than printing the symbol names into separate buffers, it
      seems we can simply use the special %ps format string modifier
      to print the pointers symbolically and get rid of both buffers.
      
      Marking hist_trigger_stacktrace_print() would be a simpler
      way of avoiding the warning, but that would not address the
      excessive stack usage.
      
      Link: https://lkml.kernel.org/r/20211019153337.294790-1-arnd@kernel.org
      
      Fixes: 69a0200c ("tracing: Add hist trigger support for stacktraces as keys")
      Link: https://lore.kernel.org/all/20211015095704.49a99859@gandalf.local.home/Reviewed-by: default avatarTom Zanussi <zanussi@kernel.org>
      Tested-by: default avatarTom Zanussi <zanussi@kernel.org>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      8720aeec
    • Steven Rostedt (VMware)'s avatar
      tracing: Explain the trace recursion transition bit better · bce5c81c
      Steven Rostedt (VMware) authored
      The current text of the explanation of the transition bit in the trace
      recursion protection is not very clear. Improve the text, so that when all
      the archs no longer have the issue of tracing between a start of a new
      (interrupt) context and updating the preempt_count to reflect the new
      context, that it may be removed.
      
      Link: https://lore.kernel.org/all/20211018220203.064a42ed@gandalf.local.home/Suggested-by: default avatarPetr Mladek <pmladek@suse.com>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      bce5c81c
    • Steven Rostedt (VMware)'s avatar
      ftrace/direct: Do not disable when switching direct callers · ed292718
      Steven Rostedt (VMware) authored
      Currently to switch a set of "multi" direct trampolines from one
      trampoline to another, a full shutdown of the current set needs to be
      done, followed by an update to what trampoline the direct callers would
      call, and then re-enabling the callers. This leaves a time when the
      functions will not be calling anything, and events may be missed.
      
      Instead, use a trick to allow all the functions with direct trampolines
      attached will always call either the new or old trampoline while the
      switch is happening. To do this, first attach a "dummy" callback via
      ftrace to all the functions that the current direct trampoline is attached
      to. This will cause the functions to call the "list func" instead of the
      direct trampoline. The list function will call the direct trampoline
      "helper" that will set the function it should call as it returns back to
      the ftrace trampoline.
      
      At this moment, the direct caller descriptor can safely update the direct
      call trampoline. The list function will pick either the new or old
      function (depending on the memory coherency model of the architecture).
      
      Now removing the dummy function from each of the locations of the direct
      trampoline caller, will put back the direct call, but now to the new
      trampoline.
      
      A better visual is:
      
      [ Changing direct call from my_direct_1 to my_direct_2 ]
      
        <traced_func>:
           call my_direct_1
      
       ||||||||||||||||||||
       vvvvvvvvvvvvvvvvvvvv
      
        <traced_func>:
           call ftrace_caller
      
        <ftrace_caller>:
          [..]
          call ftrace_ops_list_func
      
      	ftrace_ops_list_func()
      	{
      		ops->func() -> direct_helper -> set rax to my_direct_1 or my_direct_2
      	}
      
         call rax (to either my_direct_1 or my_direct_2
      
       ||||||||||||||||||||
       vvvvvvvvvvvvvvvvvvvv
      
        <traced_func>:
           call my_direct_2
      
      Link: https://lore.kernel.org/all/20211014162819.5c85618b@gandalf.local.home/Acked-by: default avatarJiri Olsa <jolsa@redhat.com>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      ed292718