1. 13 3月, 2009 25 次提交
  2. 12 3月, 2009 4 次提交
    • S
      ring-buffer: only allocate buffers for online cpus · 554f786e
      Steven Rostedt 提交于
      Impact: save on memory
      
      Currently, a ring buffer was allocated for each "possible_cpus". On
      some systems, this is the same as NR_CPUS. Thus, if a system defined
      NR_CPUS = 64 but it only had 1 CPU, we could have possibly 63 useless
      ring buffers taking up space. With a default buffer of 3 megs, this
      could be quite drastic.
      
      This patch changes the ring buffer code to only allocate ring buffers
      for online CPUs.  If a CPU goes off line, we do not free the buffer.
      This is because the user may still have trace data in that buffer
      that they would like to look at.
      
      Perhaps in the future we could add code to delete a ring buffer if
      the CPU is offline and the ring buffer becomes empty.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      554f786e
    • S
      tracing: fix trace_wait to know to wait on all cpus or just one · 9aba60fe
      Steven Rostedt 提交于
      Impact: fix to task live locking on reading trace_pipe on one CPU
      
      The same code is used for both trace_pipe (all CPUS) and the per_cpu
      trace_pipe file. When there is no data to read, it will check for
      signals and wait on the trace wait queue.
      
      The problem happens with the per_cpu wait. The trace_wait code checks
      all CPUs. Thus, if there's data in another CPU buffer, then it will
      exit the wait, without checking for signals or waiting on the wait queue.
      
      It would then try to read the empty buffer, and since that will just
      return nothing, then it will try to wait again. Unfortunately, that will
      again fail due to there still being data in the other buffers. This
      ends up with a live lock for the task.
      
      This patch fixes the trace_wait to be aware that the iterator may only
      be waiting on a single buffer.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      9aba60fe
    • S
      tracing: expand the ring buffers when an event is activated · 1852fcce
      Steven Rostedt 提交于
      To save memory, the tracer ring buffers are set to a minimum.
      The activating of a trace expands the ring buffer size. This patch
      adds this expanding, when an event is activated.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      1852fcce
    • S
      tracing: keep ring buffer to minimum size till used · 73c5162a
      Steven Rostedt 提交于
      Impact: less memory impact on systems not using tracer
      
      When the kernel boots up that has tracing configured, it allocates
      the default size of the ring buffer. This currently happens to be
      1.4Megs per possible CPU. This is quite a bit of wasted memory if
      the system is never using the tracer.
      
      The current solution is to keep the ring buffers to a minimum size
      until the user uses them. Once a tracer is piped into the current_tracer
      the ring buffer will be expanded to the default size. If the user
      changes the size of the ring buffer, it will take the size given
      by the user immediately.
      
      If the user adds a "ftrace=" to the kernel command line, then the ring
      buffers will be set to the default size on initialization.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      73c5162a
  3. 11 3月, 2009 7 次提交
  4. 10 3月, 2009 4 次提交