1. 07 Jan, 2009 17 commits
  2. 30 Dec, 2008 1 commit
  3. 29 Dec, 2008 8 commits
  4. 16 Dec, 2008 1 commit
  5. 12 Dec, 2008 2 commits
  6. 10 Dec, 2008 11 commits
    • Robert Richter's avatar
      oprofile: fix lost sample counter · 211117ff
      Robert Richter authored
      The number of lost samples could be greater than the number of
      received samples. This patches fixes this. The implementation
      introduces return values for add_sample() and add_code().
      Signed-off-by: default avatarRobert Richter <robert.richter@amd.com>
      211117ff
    • Robert Richter's avatar
      oprofile: remove nr_available_slots() · 1d7503b5
      Robert Richter authored
      This function is no longer available after the port to the new ring
      buffer. Its removal can lead to incomplete sampling sequences since
      IBS samples and backtraces are transfered in multiple samples. Due to
      a full buffer, samples could be lost any time. The userspace daemon
      has to live with such incomplete sampling sequences as long as the
      data within one sample is consistent.
      
      This will be fixed by changing the internal buffer data there all data
      of one IBS sample or a backtrace is packed in a single ring buffer
      entry. This is possible since the new ring buffer supports variable
      data size.
      Signed-off-by: default avatarRobert Richter <robert.richter@amd.com>
      1d7503b5
    • Robert Richter's avatar
      oprofile: port to the new ring_buffer · 6dad828b
      Robert Richter authored
      This patch replaces the current oprofile cpu buffer implementation
      with the ring buffer provided by the tracing framework. The motivation
      here is to leave the pain of implementing ring buffers to others. Oh,
      no, there are more advantages. Main reason is the support of different
      sample sizes that could be stored in the buffer. Use cases for this
      are IBS and Cell spu profiling. Using the new ring buffer ensures
      valid and complete samples and allows copying the cpu buffer stateless
      without knowing its content. Second it will use generic kernel API and
      also reduce code size. And hopefully, there are less bugs.
      
      Since the new tracing ring buffer implementation uses spin locks to
      protect the buffer during read/write access, it is difficult to use
      the buffer in an NMI handler. In this case, writing to the buffer by
      the NMI handler (x86) could occur also during critical sections when
      reading the buffer. To avoid this, there are 2 buffers for independent
      read and write access. Read access is in process context only, write
      access only in the NMI handler. If the read buffer runs empty, both
      buffers are swapped atomically. There is potentially a small window
      during swapping where the buffers are disabled and samples could be
      lost.
      
      Using 2 buffers is a little bit overhead, but the solution is clear
      and does not require changes in the ring buffer implementation. It can
      be changed to a single buffer solution when the ring buffer access is
      implemented as non-locking atomic code.
      
      The new buffer requires more size to store the same amount of samples
      because each sample includes an u32 header. Also, there is more code
      to execute for buffer access. Nonetheless, the buffer implementation
      is proven in the ftrace environment and worth to use also in oprofile.
      
      Patches that changes the internal IBS buffer usage will follow.
      
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarRobert Richter <robert.richter@amd.com>
      6dad828b
    • Robert Richter's avatar
      ring_buffer: add remaining cpu functions to ring_buffer.h · e09373f2
      Robert Richter authored
      These functions are not yet in ring_buffer.h though they seems to be
      part of the API.
      
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarRobert Richter <robert.richter@amd.com>
      e09373f2
    • Robert Richter's avatar
      oprofile: moving cpu_buffer_reset() to cpu_buffer.h · fbc9bf9f
      Robert Richter authored
      This is in preparation for changes in the cpu buffer implementation.
      Signed-off-by: default avatarRobert Richter <robert.richter@amd.com>
      fbc9bf9f
    • Robert Richter's avatar
      oprofile: adding cpu_buffer_entries() · bf589e32
      Robert Richter authored
      This is in preparation for changes in the cpu buffer implementation.
      Signed-off-by: default avatarRobert Richter <robert.richter@amd.com>
      bf589e32
    • Robert Richter's avatar
      oprofile: adding cpu_buffer_write_commit() · 229234ae
      Robert Richter authored
      This is in preparation for changes in the cpu buffer implementation.
      Signed-off-by: default avatarRobert Richter <robert.richter@amd.com>
      229234ae
    • Robert Richter's avatar
      oprofile: adding cpu buffer r/w access functions · 7d468abe
      Robert Richter authored
      This is in preparation for changes in the cpu buffer implementation.
      Signed-off-by: default avatarRobert Richter <robert.richter@amd.com>
      7d468abe
    • Robert Richter's avatar
      ftrace: remove unused function arg in trace_iterator_increment() · e2ac8ef5
      Robert Richter authored
      This removes the unused cpu function parameter.
      
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarRobert Richter <robert.richter@amd.com>
      e2ac8ef5
    • Robert Richter's avatar
      ring_buffer: update description for ring_buffer_alloc() · 68814b58
      Robert Richter authored
      Trivial patch.
      
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarRobert Richter <robert.richter@amd.com>
      68814b58
    • Robert Richter's avatar
      oprofile: set values to default when creating oprofilefs · 37ca5eb3
      Robert Richter authored
      This patch restores default values for:
      
      /dev/oprofile/cpu_buffer_size
      /dev/oprofile/buffer_watershed
      /dev/oprofile/buffer_size
      
      when creating the oprofilefs:
      
       # opcontrol --deinit
       # opcontrol --init
       # cat /dev/oprofile/cpu_buffer_size
       8192
       # echo 5123 > /dev/oprofile/cpu_buffer_size
       # cat /dev/oprofile/cpu_buffer_size
       5123
       # opcontrol --deinit
       # opcontrol --init
       # cat /dev/oprofile/cpu_buffer_size
       8192
       # opcontrol --deinit
      
      This sets the values in a defined state. Before, there was no way to
      restore the defaults without rebooting the system or reloading the
      module.
      Signed-off-by: default avatarRobert Richter <robert.richter@amd.com>
      37ca5eb3