1. 25 2月, 2009 3 次提交
    • S
      tracing: add schedule events to event trace · f3fe8e4a
      Steven Rostedt 提交于
      This patch changes the trace/sched.h to use the DECLARE_TRACE_FMT
      such that they are automatically registered with the event tracer.
      
      And it also adds the tracing sched headers to kernel/trace/events.c
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      f3fe8e4a
    • S
      tracing: add event trace infrastructure · b77e38aa
      Steven Rostedt 提交于
      This patch creates the event tracing infrastructure of ftrace.
      It will create the files:
      
       /debug/tracing/available_events
       /debug/tracing/set_event
      
      The available_events will list the trace points that have been
      registered with the event tracer.
      
      set_events will allow the user to enable or disable an event hook.
      
      example:
      
       # echo sched_wakeup > /debug/tracing/set_event
      
      Will enable the sched_wakeup event (if it is registered).
      
       # echo "!sched_wakeup" >> /debug/tracing/set_event
      
      Will disable the sched_wakeup event (and only that event).
      
       # echo > /debug/tracing/set_event
      
      Will disable all events (notice the '>')
      
       # cat /debug/tracing/available_events > /debug/tracing/set_event
      
      Will enable all registered event hooks.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      b77e38aa
    • S
      tracing: add DEFINE_TRACE_FMT to tracepoint.h · 7c37730c
      Steven Rostedt 提交于
      This patch creates a DEFINE_TRACE_FMT to map to DECLARE_TRACE.
      This allows for the developers to place format strings and
      args in with their tracepoint declaration. A tracer may now
      override the DEFINE_TRACE_FMT macro and use it to record
      a default format.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      7c37730c
  2. 23 2月, 2009 2 次提交
  3. 21 2月, 2009 5 次提交
    • S
      ftrace: break out modify loop immediately on detection of error · 4377245a
      Steven Rostedt 提交于
      Impact: added precaution on failure detection
      
      Break out of the modifying loop as soon as a failure is detected.
      This is just an added precaution found by code review and was not
      found by any bug chasing.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      4377245a
    • S
      ftrace: immediately stop code modification if failure is detected · 90c7ac49
      Steven Rostedt 提交于
      Impact: fix to prevent NMI lockup
      
      If the page fault handler produces a WARN_ON in the modifying of
      text, and the system is setup to have a high frequency of NMIs,
      we can lock up the system on a failure to modify code.
      
      The modifying of code with NMIs allows all NMIs to modify the code
      if it is about to run. This prevents a modifier on one CPU from
      modifying code running in NMI context on another CPU. The modifying
      is done through stop_machine, so only NMIs must be considered.
      
      But if the write causes the page fault handler to produce a warning,
      the print can slow it down enough that as soon as it is done
      it will take another NMI before going back to the process context.
      The new NMI will perform the write again causing another print and
      this will hang the box.
      
      This patch turns off the writing as soon as a failure is detected
      and does not wait for it to be turned off by the process context.
      This will keep NMIs from getting stuck in this back and forth
      of print outs.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      90c7ac49
    • S
      ftrace, x86: make kernel text writable only for conversions · 16239630
      Steven Rostedt 提交于
      Impact: keep kernel text read only
      
      Because dynamic ftrace converts the calls to mcount into and out of
      nops at run time, we needed to always keep the kernel text writable.
      
      But this defeats the point of CONFIG_DEBUG_RODATA. This patch converts
      the kernel code to writable before ftrace modifies the text, and converts
      it back to read only afterward.
      
      The kernel text is converted to read/write, stop_machine is called to
      modify the code, then the kernel text is converted back to read only.
      
      The original version used SYSTEM_STATE to determine when it was OK
      or not to change the code to rw or ro. Andrew Morton pointed out that
      using SYSTEM_STATE is a bad idea since there is no guarantee to what
      its state will actually be.
      
      Instead, I moved the check into the set_kernel_text_* functions
      themselves, and use a local variable to determine when it is
      OK to change the kernel text RW permissions.
      
      [ Update: Ingo Molnar suggested moving the prototypes to cacheflush.h ]
      Reviewed-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      16239630
    • F
      tracing/markers: make markers select tracepoints · 91f73f90
      Frederic Weisbecker 提交于
      Sometimes it happens that KConfig dependencies are not handled
      like in the following scenario:
      
      - config A
         bool
      
      - config B
         bool
         depends on A
      
      - config C
         bool
         select B
      
      If one selects C, then it will select B without checking its
      dependency to A, if A hasn't been selected elsewhere, it will
      result in a build failure.
      
      This is what happens on the following build error:
      
       kernel/built-in.o: In function `marker_update_probe_range':
       (.text+0x52f64): undefined reference to `tracepoint_probe_register_noupdate'
       kernel/built-in.o: In function `marker_update_probe_range':
       (.text+0x52f74): undefined reference to `tracepoint_probe_unregister_noupdate'
       kernel/built-in.o: In function `marker_update_probe_range':
       (.text+0x52fb9): undefined reference to `tracepoint_probe_unregister_noupdate'
       kernel/built-in.o: In function `marker_update_probes':
       marker.c:(.text+0x530ba): undefined reference to `tracepoint_probe_update_all'
      
      CONFIG_KVM_TRACE will select CONFIG_MARKER, but the latter
      depends on CONFIG_TRACEPOINTS which will not be selected.
      Reported-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      91f73f90
    • S
      ftrace: allow archs to preform pre and post process for code modification · 000ab691
      Steven Rostedt 提交于
      This patch creates the weak functions: ftrace_arch_code_modify_prepare
      and ftrace_arch_code_modify_post_process that are called before and
      after the stop machine is called to modify the kernel text.
      
      If the arch needs to do pre or post processing, it only needs to define
      these functions.
      
      [ Update: Ingo Molnar suggested using the name ftrace_arch_code_modify_*
                over using ftrace_arch_modify_* ]
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      000ab691
  4. 20 2月, 2009 12 次提交
  5. 19 2月, 2009 18 次提交