1. 16 Jan, 2009 7 commits
  2. 15 Jan, 2009 6 commits
    • Ingo Molnar's avatar
      tracing: trace_stat.c cleanup · 55922173
      Ingo Molnar authored
      Impact: cleanup
      
      - whitespace / code alignment cleanups
      - avoid unnecessary forward prototype by reordering functions
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      55922173
    • Li Zefan's avatar
      tracing/ftrace: add missing unlock in register_stat_tracer() · 42fab4b2
      Li Zefan authored
      We should unlock all_stat_sessions_mutex before returning failure.
      Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      42fab4b2
    • Frederic Weisbecker's avatar
      tracing/function-graph-tracer: fix a regression while suspend to disk · 4a2b8dda
      Frederic Weisbecker authored
      Impact: fix a crash while kernel image restore
      
      When the function graph tracer is running and while suspend to disk, some racy
      and dangerous things happen against this tracer.
      
      The current task will save its registers including the stack pointer which
      contains the return address hooked by the tracer. But the current task will
      continue to enter other functions after that to save the memory, and then
      it will store other return addresses, and finally loose the old depth which
      matches the return address saved in the old stack (during the registers saving).
      
      So on image restore, the code will return to wrong addresses.
      And there are other things: on restore, the task will have it's "current"
      pointer overwritten during registers restoring....switching from one task to
      another... That would be insane to try to trace function graphs at these
      stages.
      
      This patch makes the function graph tracer listening on power events, making
      it's tracing disabled for the current task (the one that performs the
      hibernation work) while suspend/resume to disk, making the tracing safe
      during hibernation.
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      4a2b8dda
    • Steven Rostedt's avatar
      trace: stop all recording to ring buffer on ftrace_dump · 0ee6b6cf
      Steven Rostedt authored
      Impact: limit ftrace dump output
      
      Currently ftrace_dump only calls ftrace_kill that is a fast way
      to prevent the function tracer functions from being called (just sets
      a flag and clears the function to call, nothing else). It is better
      to also turn off any recording to the ring buffers as well.
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      0ee6b6cf
    • Lai Jiangshan's avatar
      ring_buffer: reset write when reserve buffer fail · 6f3b3440
      Lai Jiangshan authored
      Impact: reset struct buffer_page.write when interrupt storm
      
      if struct buffer_page.write is not reset, any succedent committing
      will corrupted ring_buffer:
      
      static inline void
      rb_set_commit_to_write(struct ring_buffer_per_cpu *cpu_buffer)
      {
      	......
      		cpu_buffer->commit_page->commit =
      			cpu_buffer->commit_page->write;
      	......
      }
      
      when "if (RB_WARN_ON(cpu_buffer, next_page == reader_page))", ring_buffer
      is disabled, but some reserved buffers may haven't been committed.
      we need reset struct buffer_page.write.
      
      when "if (unlikely(next_page == cpu_buffer->commit_page))", ring_buffer
      is still available, we should not corrupt it.
      Signed-off-by: default avatarLai Jiangshan <laijs@cn.fujitsu.com>
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      6f3b3440
    • Steven Rostedt's avatar
      trace: print ftrace_dump at KERN_EMERG log level · 428aee14
      Steven Rostedt authored
      Impact: fix to print out ftrace_dump when expected
      
      I was debugging a hard race condition to only find out that
      after I hit the race, my log level was not at level to show
      KERN_INFO. The time it took to trigger the race was wasted because
      I did not capture the trace.
      
      Since ftrace_dump is only called from kernel oops (and only when
      it is set in the kernel command line to do so), or when a
      developer adds it to their own local tree, the log level of
      the print should be at KERN_EMERG to make sure the print appears.
      
      ftrace_dump is not called by a normal user setup, and will not
      add extra unwanted print out to the console. There is no reason
      it should be at KERN_INFO.
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      428aee14
  3. 14 Jan, 2009 9 commits
  4. 11 Jan, 2009 7 commits
    • Pekka Paalanen's avatar
      mmiotrace: count events lost due to not recording · 173ed24e
      Pekka Paalanen authored
      Impact: enhances lost events counting in mmiotrace
      
      The tracing framework, or the ring buffer facility it uses, has a switch
      to stop recording data. When recording is off, the trace events will be
      lost. The framework does not count these, so mmiotrace has to count them
      itself.
      Signed-off-by: default avatarPekka Paalanen <pq@iki.fi>
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      173ed24e
    • Pekka Paalanen's avatar
      trace: mmiotrace to the tracer menu in Kconfig · fe6f90e5
      Pekka Paalanen authored
      Impact: cosmetic change in Kconfig menu layout
      
      This patch was originally suggested by Peter Zijlstra, but seems it
      was forgotten.
      
      CONFIG_MMIOTRACE and CONFIG_MMIOTRACE_TEST were selectable
      directly under the Kernel hacking / debugging menu in the kernel
      configuration system. They were present only for x86 and x86_64.
      
      Other tracers that use the ftrace tracing framework are in their own
      sub-menu. This patch moves the mmiotrace configuration options there.
      Since the Kconfig file, where the tracer menu is, is not architecture
      specific, HAVE_MMIOTRACE_SUPPORT is introduced and provided only by
      x86/x86_64. CONFIG_MMIOTRACE now depends on it.
      Signed-off-by: default avatarPekka Paalanen <pq@iki.fi>
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      fe6f90e5
    • Pekka Paalanen's avatar
      doc: mmiotrace.txt, buffer size control change · 5d2ad331
      Pekka Paalanen authored
      Impact: prevents confusing the user when buffer size is inadequate
      
      The tracing framework offers a resizeable buffer, which mmiotrace uses
      to record events. If the buffer is full, the following events will be
      lost. Events should not be lost, so the documentation instructs the user
      to increase the buffer size. The buffer size is set via a debugfs file.
      
      Mmiotrace documentation was not updated the same time the debugfs file
      was changed. The old file was tracing/trace_entries and first contained
      the number of entries the buffer had space for, per cpu. Nowadays this
      file is replaced with the file tracing/buffer_size_kb, which tells the
      amount of memory reserved for the buffer, per cpu, in kilobytes.
      
      Previously, a flag had to be toggled via the debugfs file
      tracing/tracing_enabled when the buffer size was changed. This is no
      longer necessary.
      
      The mmiotrace documentation is updated to reflect the current state of
      the tracing framework.
      Signed-off-by: default avatarPekka Paalanen <pq@iki.fi>
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      5d2ad331
    • Frederic Weisbecker's avatar
      tracing/ftrace: handle more than one stat file per tracer · 034939b6
      Frederic Weisbecker authored
      Impact: new API for tracers
      
      Make the stat tracing API reentrant. And also provide the new directory
      /debugfs/tracing/trace_stat which will contain all the stat files for the
      current active tracer.
      
      Now a tracer will, if desired, want to provide a zero terminated array of
      tracer_stat structures.
      Each one contains the callbacks necessary for one stat file.
      It have to provide at least a name for its stat file, an iterator with
      stat_start/start_next callback and an output callback for one stat entry.
      
      Also adapt the branch tracer to this new API.
      We create two files "all" and "annotated" inside the /debugfs/tracing/trace_stat
      directory, making the both stats simultaneously available instead of needing
      to change an option to switch from one stat file to another.
      
      The output of these stats haven't changed.
      
      Changes in v2:
      
      _ Apply the previous memory leak fix (rebase against tip/master)
      
      Changes in v3:
      
      _ Merge the patch that adapted the branch tracer to this Api in this patch to
        not break the kernel build.
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      034939b6
    • Andrew Morton's avatar
      kernel/trace/ring_buffer.c: use DIV_ROUND_UP · 67d34724
      Andrew Morton authored
      Instead of open-coding it.
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      67d34724
    • Andrew Morton's avatar
      kernel/trace/ring_buffer.c: reduce inlining · 34a148bf
      Andrew Morton authored
      text    data     bss     dec     hex filename
      before:  11320     228       8   11556    2d24 kernel/trace/ring_buffer.o
      after:   10592     228       8   10828    2a4c kernel/trace/ring_buffer.o
      
      Also: free_page(0) is legal.
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      34a148bf
    • Ingo Molnar's avatar
      99cd7074
  5. 10 Jan, 2009 11 commits