1. 06 Sep, 2009 2 commits
  2. 05 Sep, 2009 31 commits
  3. 04 Sep, 2009 7 commits
    • Steven Rostedt's avatar
      ring-buffer: only enable ring_buffer_swap_cpu when needed · 85bac32c
      Steven Rostedt authored
      Since the ability to swap the cpu buffers adds a small overhead to
      the recording of a trace, we only want to add it when needed.
      
      Only the irqsoff and preemptoff tracers use this feature, and both are
      not recommended for production kernels. This patch disables its use
      when neither irqsoff nor preemptoff is configured.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      85bac32c
    • Steven Rostedt's avatar
      ring-buffer: check for swapped buffers in start of committing · 62f0b3eb
      Steven Rostedt authored
      Because the irqsoff tracer can swap an internal CPU buffer, it is possible
      that a swap happens between the start of the write and before the committing
      bit is set (the committing bit will disable swapping).
      
      This patch adds a check for this and will fail the write if it detects it.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      62f0b3eb
    • Steven Rostedt's avatar
      tracing: report error in trace if we fail to swap latency buffer · e8165dbb
      Steven Rostedt authored
      The irqsoff tracer will fail to swap the cpu buffer with the max
      buffer if it preempts a commit. Instead of ignoring this, this patch
      makes the tracer report it if the last max latency failed due to preempting
      a current commit.
      
      The output of the latency tracer will look like this:
      
       # tracer: irqsoff
       #
       # irqsoff latency trace v1.1.5 on 2.6.31-rc5
       # --------------------------------------------------------------------
       # latency: 112 us, #1/1, CPU#1 | (M:preempt VP:0, KP:0, SP:0 HP:0 #P:4)
       #    -----------------
       #    | task: -4281 (uid:0 nice:0 policy:0 rt_prio:0)
       #    -----------------
       #  => started at: save_args
       #  => ended at:   __do_softirq
       #
       #
       #                  _------=> CPU#
       #                 / _-----=> irqs-off
       #                | / _----=> need-resched
       #                || / _---=> hardirq/softirq
       #                ||| / _--=> preempt-depth
       #                |||| /
       #                |||||     delay
       #  cmd     pid   ||||| time  |   caller
       #     \   /      |||||   \   |   /
          bash-4281    1d.s6  265us : update_max_tr_single: Failed to swap buffers due to commit in progress
      
      Note the latency time and the functions that disabled the irqs or preemption
      will still be listed.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      e8165dbb
    • Steven Rostedt's avatar
      tracing: add trace_array_printk for internal tracers to use · 659372d3
      Steven Rostedt authored
      This patch adds a trace_array_printk to allow a tracer to use the
      trace_printk on its own trace array.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      659372d3
    • Steven Rostedt's avatar
      tracing: pass around ring buffer instead of tracer · e77405ad
      Steven Rostedt authored
      The latency tracers (irqsoff and wakeup) can swap trace buffers
      on the fly. If an event is happening and has reserved data on one of
      the buffers, and the latency tracer swaps the global buffer with the
      max buffer, the result is that the event may commit the data to the
      wrong buffer.
      
      This patch changes the API to the trace recording to be recieve the
      buffer that was used to reserve a commit. Then this buffer can be passed
      in to the commit.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      e77405ad
    • Steven Rostedt's avatar
      tracing: make tracing_reset safe for external use · f633903a
      Steven Rostedt authored
      Reseting the trace buffer without first disabling the buffer and
      waiting for any writers to complete, can corrupt the ring buffer.
      
      This patch makes the external version of tracing_reset safe from
      corruption by disabling the ring buffer and calling synchronize_sched.
      
      This version can no longer be called from interrupt context. But all those
      callers have been removed.
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      f633903a
    • Steven Rostedt's avatar
      tracing: use timestamp to determine start of latency traces · 2f26ebd5
      Steven Rostedt authored
      Currently the latency tracers reset the ring buffer. Unfortunately
      if a commit is in process (due to a trace event), this can corrupt
      the ring buffer. When this happens, the ring buffer will detect
      the corruption and then permanently disable the ring buffer.
      
      The bug does not crash the system, but it does prevent further tracing
      after the bug is hit.
      
      Instead of reseting the trace buffers, the timestamp of the start of
      the trace is used instead. The buffers will still contain the previous
      data, but the output will not count any data that is before the
      timestamp of the trace.
      
      Note, this only affects the static trace output (trace) and not the
      runtime trace output (trace_pipe). The runtime trace output does not
      make sense for the latency tracers anyway.
      Reported-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      2f26ebd5