Skip to content
  1. Jun 02, 2008
    • Abhishek Sagar's avatar
      ftrace: export kretprobe_trampoline for function tracer · e0773410
      Abhishek Sagar authored
      Follow suit from kprobe implementations on other archs and make kretprobe_trampoline non-static. Ftrace implmentation (more specifically, kernel/trace/trace.c) requires access to it (see-> http://kerneltrap.org/mailarchive/linux-kernel/2008/5/27/1955234
      
      ).
      
      Signed-off-by: default avatarAbhishek Sagar <sagar.abhishek@gmail.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      e0773410
    • Steven Rostedt's avatar
      ftrace: user update and disable dynamic ftrace daemon · ad90c0e3
      Steven Rostedt authored
      
      
      In dynamic ftrace, the mcount function starts off pointing to a stub
      function that just returns.
      
      On start up, the call to the stub is modified to point to a "record_ip"
      function. The job of the record_ip function is to add the function to
      a pre-allocated hash list. If the function is already there, it simply is
      ignored, otherwise it is added to the list.
      
      Later, a ftraced daemon wakes up and calls kstop_machine if any functions
      have been recorded, and changes the calls to the recorded functions to
      a simple nop.  If no functions were recorded, the daemon goes back to sleep.
      
      The daemon wakes up once a second to see if it needs to update any newly
      recorded functions into nops.  Usually it does not, but if a lot of code
      has been executed for the first time in the kernel, the ftraced daemon
      will call kstop_machine to update those into nops.
      
      The problem currently is that there's no way to stop the daemon from doing
      this, and it can cause unneeded latencies (800us which for some is bothersome).
      
      This patch adds a new file /debugfs/tracing/ftraced_enabled. If the daemon
      is active, reading this will return "enabled\n" and "disabled\n" when the
      daemon is not running. To disable the daemon, the user can echo "0" or
      "disable" into this file, and "1" or "enable" to re-enable the daemon.
      
      Since the daemon is used to convert the functions into nops to increase
      the performance of the system, I also added that anytime something is
      written into the ftraced_enabled file, kstop_machine will run if there
      are new functions that have been detected that need to be converted.
      
      This way the user can disable the daemon but still be able to control the
      conversion of the mcount calls to nops by simply,
      
        "echo 0 > /debugfs/tracing/ftraced_enabled"
      
      when they need to do more conversions.
      
      To see the number of converted functions:
      
        "cat /debugfs/tracing/dyn_ftrace_total_info"
      
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      ad90c0e3
    • Abhishek Sagar's avatar
      ftrace: distinguish kretprobe'd functions in trace logs · 76094a2c
      Abhishek Sagar authored
      
      
      Tracing functions via ftrace which have a kretprobe installed on them, can produce misleading output in their trace logs. E.g, consider the correct trace of the following sequence:
      
      do_IRQ()
      {
      ~
        irq_enter();
      ~
      }
      
      Trace log (sample):
      <idle>-0     [00] 4154504455.781616: irq_enter <- do_IRQ
      
      But if irq_enter() has a kretprobe installed on it, the return value stored on the stack at each invocation is modified to divert the return to a kprobe trampoline function called kretprobe_trampoline(). So with this the trace would (currently) look like:
      
      <idle>-0     [00] 4154504455.781616: irq_enter <- kretprobe_trampoline
      
      Now this is quite misleading to the end user, as it suggests something that didn't actually happen. So just to avoid such misinterpretations, the inlined patch aims to output such a log as:
      
      <idle>-0     [00] 4154504455.781616: irq_enter <- [unknown/kretprobe'd]
      
      Signed-off-by: default avatarAbhishek Sagar <sagar.abhishek@gmail.com>
      Acked-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      76094a2c
    • Abhishek Sagar's avatar
      ftrace: core support for ARM · 014c257c
      Abhishek Sagar authored
      
      
      Core ftrace support for the ARM architecture, which includes support
      for dynamic function tracing.
      
      Signed-off-by: default avatarAbhishek Sagar <sagar.abhishek@gmail.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      014c257c
  2. May 28, 2008
  3. May 27, 2008
  4. May 25, 2008
  5. May 24, 2008