1. 26 12月, 2008 1 次提交
  2. 25 12月, 2008 1 次提交
  3. 24 12月, 2008 2 次提交
  4. 19 12月, 2008 3 次提交
    • P
      ftrace: introduce tracing_reset_online_cpus() helper · 213cc060
      Pekka J Enberg 提交于
      Impact: cleanup
      
      This patch factors out common code from multiple tracers into a
      tracing_reset_online_cpus() function and converts the tracers to use it.
      Signed-off-by: NPekka Enberg <penberg@cs.helsinki.fi>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      213cc060
    • I
      tracing: fix warnings in kernel/trace/trace_sched_switch.c · c71dd42d
      Ingo Molnar 提交于
      these warnings:
      
        kernel/trace/trace_sched_switch.c: In function ‘tracing_sched_register’:
        kernel/trace/trace_sched_switch.c:96: warning: passing argument 1 of ‘register_trace_sched_wakeup_new’ from incompatible pointer type
        kernel/trace/trace_sched_switch.c:112: warning: passing argument 1 of ‘unregister_trace_sched_wakeup_new’ from incompatible pointer type
        kernel/trace/trace_sched_switch.c: In function ‘tracing_sched_unregister’:
        kernel/trace/trace_sched_switch.c:121: warning: passing argument 1 of ‘unregister_trace_sched_wakeup_new’ from incompatible pointer type
      
      Trigger because sched_wakeup_new tracepoints need the same trace
      signature as sched_wakeup - which was changed recently.
      
      Fix it.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      c71dd42d
    • I
      tracing: fix warning in kernel/trace/trace.c · 3bddb9a3
      Ingo Molnar 提交于
      this warning:
      
        kernel/trace/trace.c: In function ‘print_lat_fmt’:
        kernel/trace/trace.c:1826: warning: unused variable ‘state’
      
      Triggers because 'state' has become unused - remove it.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      3bddb9a3
  5. 18 12月, 2008 5 次提交
    • L
      tracing/ring-buffer: remove unused ring_buffer size · 6d102bc6
      Lai Jiangshan 提交于
      Impact: remove dead code
      
      struct ring_buffer.size is not set after ring_buffer is initialized
      or resized. it is always 0.
      
      we can use "buffer->pages * PAGE_SIZE" to get ring_buffer's size
      Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      6d102bc6
    • T
      trace: fix task state printout · 3d9101e9
      Thomas Gleixner 提交于
      Impact: fix occasionally incorrect trace output
      
      The tracing code has interesting varieties of printing out task state.
      
      Unfortunalely only one of the instances is correct as it copies the
      code from sched.c:sched_show_task(). The others are plain wrong as
      they treatthe bitfield as an integer offset into the character
      array. Also the size check of the character array is wrong as it
      includes the trailing \0.
      
      Use a common state decoder inline which does the Right Thing.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Acked-by: NSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      3d9101e9
    • S
      ftrace: add not to regex on filtering functions · ea3a6d6d
      Steven Rostedt 提交于
      Impact: enhancement
      
      Ingo Molnar has asked about a way to remove items from the filter
      lists. Currently, you can only add or replace items. The way
      items are added to the list is through opening one of the list
      files (set_ftrace_filter or set_ftrace_notrace) via append.
      If the file is opened for truncate, the list is cleared.
      
        echo spin_lock > /debug/tracing/set_ftrace_filter
      
      The above will replace the list with only spin_lock
      
        echo spin_lock >> /debug/tracing/set_ftrace_filter
      
      The above will add spin_lock to the list.
      
      Now this patch adds:
      
        echo '!spin_lock' >> /debug/tracing/set_ftrace_filter
      
      This will remove spin_lock from the list.
      
      The limited glob features of these lists also can be notted.
      
        echo '!spin_*' >> /debug/tracing/set_ftrace_filter
      
      This will remove all functions that start with 'spin_'
      
      Note:
      
        echo '!spin_*' > /debug/tracing/set_ftrace_filter
      
      will simply clear out the list (notice the '>' instead of '>>')
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ea3a6d6d
    • S
      trace: better use of stack_trace_enabled for boot up code · e05a43b7
      Steven Rostedt 提交于
      Impact: clean up
      
      Andrew Morton suggested to use the stack_tracer_enabled variable
      to decide whether or not to start stack tracing on bootup.
      This lets us remove the start_stack_trace variable.
      Reported-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      e05a43b7
    • S
      trace: add a way to enable or disable the stack tracer · f38f1d2a
      Steven Rostedt 提交于
      Impact: enhancement to stack tracer
      
      The stack tracer currently is either on when configured in or
      off when it is not. It can not be disabled when it is configured on.
      (besides disabling the function tracer that it uses)
      
      This patch adds a way to enable or disable the stack tracer at
      run time. It defaults off on bootup, but a kernel parameter 'stacktrace'
      has been added to enable it on bootup.
      
      A new sysctl has been added "kernel.stack_tracer_enabled" to let
      the user enable or disable the stack tracer at run time.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f38f1d2a
  6. 17 12月, 2008 2 次提交
    • F
      tracing/ftrace: add the printk-msg-only option · 66896a85
      Frederic Weisbecker 提交于
      Impact: display ftrace_printk messages "as is"
      
      By default, ftrace_printk() messages find their output with some other
      informations like pid, caller, ...
      Sometimes a developer just want to have the ftrace_printk left "as is", without
      other information.
      
      This is done by providing a default-off option called printk-msg-only.
      To enable it, just do `echo printk-msg-only > /debugfs/tracing/trace_options`
      
      Before the patch:
      
                 <...>-2739  [000]   145.692153: __might_sleep: I'm an ftrace_printk msg in __might_sleep
                 <...>-2739  [000]   145.692155: __might_sleep: I'm another ftrace_printk msg in __might_sleep
      
      After the patch and the printk-msg-only option enabled:
      
      I'm an ftrace_printk msg in __might_sleep
      I'm another ftrace_printk msg in __might_sleep
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      66896a85
    • F
      tracing/ftrace: use preempt_enable_no_resched_notrace in ring_buffer_time_stamp() · 2c2d7329
      Frederic Weisbecker 提交于
      Impact: prevent a trace recursion
      
      After some tests with function graph tracer under x86-32, I saw some recursions
      caused by ring_buffer_time_stamp() that calls preempt_enable_no_notrace() which
      calls preempt_schedule() which is traced itself.
      
      This patch re-enables preemption without rescheduling.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2c2d7329
  7. 12 12月, 2008 2 次提交
    • F
      tracing/function-graph-tracer: Output arrows signal on hardirq call/return · f8b755ac
      Frederic Weisbecker 提交于
      Impact: make more obvious the hardirq calls in the output
      
      When a hardirq is triggered inside the codeflow on output, we have
      now two arrows that indicate the entry and return of the hardirq.
      
       0)               |          bit_waitqueue() {
       0)   0.880 us    |            __phys_addr();
       0)   2.699 us    |          }
       0)               |          __wake_up_bit() {
       0)   ==========> |          smp_apic_timer_interrupt() {
       0)   0.797 us    |            native_apic_mem_write();
       0)   0.715 us    |            exit_idle();
       0)               |            irq_enter() {
       0)   0.722 us    |              idle_cpu();
       0)   5.519 us    |            }
       0)               |            hrtimer_interrupt() {
       0)               |              ktime_get() {
       0)               |                ktime_get_ts() {
       0)   0.805 us    |                  getnstimeofday();
      
       [...]
      
       0) ! 108.528 us  |            }
       0)               |            irq_exit() {
       0)               |              do_softirq() {
       0)               |                __do_softirq() {
       0)   0.895 us    |                  __local_bh_disable();
       0)               |                  run_timer_softirq() {
       0)   0.827 us    |                    hrtimer_run_pending();
       0)   1.226 us    |                    _spin_lock_irq();
       0)               |                    _spin_unlock_irq() {
       0)   6.550 us    |                  }
       0)   0.924 us    |                  _local_bh_enable();
       0) + 12.129 us   |                }
       0) + 13.911 us   |              }
       0)   0.707 us    |              idle_cpu();
       0) + 17.009 us   |            }
       0) ! 137.419 us  |          }
       0)   <========== |
       0)   1.045 us    |          }
       0) ! 148.908 us  |        }
       0) ! 151.022 us  |      }
       0) ! 153.022 us  |    }
       0)   0.963 us    |    journal_mark_dirty();
       0)   0.925 us    |    __brelse();
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f8b755ac
    • M
      x86, bts, ftrace: adapt the hw-branch-tracer to the ds.c interface · a93751ca
      Markus Metzger 提交于
      Impact: restructure code, cleanup
      
      Remove BTS bits from the hw-branch-tracer (renamed from bts-tracer) and
      use the ds interface.
      Signed-off-by: NMarkus Metzger <markut.t.metzger@intel.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a93751ca
  8. 08 12月, 2008 4 次提交
  9. 05 12月, 2008 4 次提交
  10. 04 12月, 2008 9 次提交
    • F
      tracing/function-graph-tracer: handle ftrace_printk entries · 1fd8f2a3
      Frederic Weisbecker 提交于
      Handle the TRACE_PRINT entries from the function grapg tracer
      and output them as a C comment just below the function that called
      it, as if it was a comment inside this function.
      
      Example with an ftrace_printk inside might_sleep() function:
      
      void __might_sleep(char *file, int line)
      {
      	static unsigned long prev_jiffy;	/* ratelimiting */
      
      	ftrace_printk("Hi I'm a comment in might_sleep() :-)");
      
      A chunk of a resulting trace:
      
       0)               |        _reiserfs_free_block() {
       0)               |          reiserfs_read_bitmap_block() {
       0)               |            __bread() {
       0)               |              __getblk() {
       0)               |                __find_get_block() {
       0)   0.698 us    |                  mark_page_accessed();
       0)   2.267 us    |                }
       0)               |                __might_sleep() {
       0)               |                  /* Hi I'm a comment in might_sleep() :-) */
       0)   1.321 us    |                }
       0)   5.872 us    |              }
       0)   7.313 us    |            }
       0)   8.718 us    |          }
      
      And this patch brings two minor fixes:
      
      - The newline after a switch-out task has disappeared
      - The "|" sign just before the cpu number on task-switch has been deleted.
      
       0)   0.616 us    |                pick_next_task_rt();
       0)   1.457 us    |                _spin_trylock();
       0)   0.653 us    |                _spin_unlock();
       0)   0.728 us    |                _spin_trylock();
       0)   0.631 us    |                _spin_unlock();
       0)   0.729 us    |                native_load_sp0();
       0)   0.593 us    |                native_load_tls();
       ------------------------------------------
       0)    cat-2834    =>   migrati-3
       ------------------------------------------
      
       0)               |    finish_task_switch() {
       0)   0.841 us    |      _spin_unlock_irq();
       0)   0.616 us    |      post_schedule_rt();
       0)   3.882 us    |    }
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Acked-by: NSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      1fd8f2a3
    • L
      ftrace: avoid duplicated function when writing set_graph_function · faec2ec5
      Liming Wang 提交于
      Impact: fix a bug in function filter setting
      
      when writing function to set_graph_function, we should check whether it
      has existed in set_graph_function to avoid duplicating.
      Signed-off-by: NLiming Wang <liming.wang@windriver.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      faec2ec5
    • I
      tracing: fix typo and missing inline function · 6b253930
      Ingo Molnar 提交于
      Impact: fix build bugs
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      6b253930
    • S
      ftrace: add ability to only trace swapper tasks · e32d8956
      Steven Rostedt 提交于
      Impact: new feature
      
      This patch lets the swapper tasks of all CPUS be filtered by the
      set_ftrace_pid file.
      
      If '0' is echoed into this file, then all the idle tasks (aka swapper)
      is flagged to be traced.  This affects all CPU idle tasks.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      e32d8956
    • S
      ftrace: use struct pid · 978f3a45
      Steven Rostedt 提交于
      Impact: clean up, extend PID filtering to PID namespaces
      
      Eric Biederman suggested using the struct pid for filtering on
      pids in the kernel. This patch is based off of a demonstration
      of an implementation that Eric sent me in an email.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      978f3a45
    • S
      ftrace: trace single pid for function graph tracer · 804a6851
      Steven Rostedt 提交于
      Impact: New feature
      
      This patch makes the changes to set_ftrace_pid apply to the function
      graph tracer.
      
        # echo $$ > /debugfs/tracing/set_ftrace_pid
        # echo function_graph > /debugfs/tracing/current_tracer
      
      Will cause only the current task to be traced. Note, the trace flags are
      also inherited by child processes, so the children of the shell
      will also be traced.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      804a6851
    • S
      ftrace: use task struct trace flag to filter on pid · 0ef8cde5
      Steven Rostedt 提交于
      Impact: clean up
      
      Use the new task struct trace flags to determine if a process should be
      traced or not.
      
      Note: this moves the searching of the pid to the slow path of setting
      the pid field. This needs to be converted to the pid name space.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      0ef8cde5
    • S
      ftrace: graph of a single function · ea4e2bc4
      Steven Rostedt 提交于
      This patch adds the file:
      
         /debugfs/tracing/set_graph_function
      
      which can be used along with the function graph tracer.
      
      When this file is empty, the function graph tracer will act as
      usual. When the file has a function in it, the function graph
      tracer will only trace that function.
      
      For example:
      
       # echo blk_unplug > /debugfs/tracing/set_graph_function
       # cat /debugfs/tracing/trace
       [...]
       ------------------------------------------
       | 2)  make-19003  =>  kjournald-2219
       ------------------------------------------
      
       2)               |  blk_unplug() {
       2)               |    dm_unplug_all() {
       2)               |      dm_get_table() {
       2)      1.381 us |        _read_lock();
       2)      0.911 us |        dm_table_get();
       2)      1. 76 us |        _read_unlock();
       2) +   12.912 us |      }
       2)               |      dm_table_unplug_all() {
       2)               |        blk_unplug() {
       2)      0.778 us |          generic_unplug_device();
       2)      2.409 us |        }
       2)      5.992 us |      }
       2)      0.813 us |      dm_table_put();
       2) +   29. 90 us |    }
       2) +   34.532 us |  }
      
      You can add up to 32 functions into this file. Currently we limit it
      to 32, but this may change with later improvements.
      
      To add another function, use the append '>>':
      
        # echo sys_read >> /debugfs/tracing/set_graph_function
        # cat /debugfs/tracing/set_graph_function
        blk_unplug
        sys_read
      
      Using the '>' will clear out the function and write anew:
      
        # echo sys_write > /debug/tracing/set_graph_function
        # cat /debug/tracing/set_graph_function
        sys_write
      
      Note, if you have function graph running while doing this, the small
      time between clearing it and updating it will cause the graph to
      record all functions. This should not be an issue because after
      it sets the filter, only those functions will be recorded from then on.
      If you need to only record a particular function then set this
      file first before starting the function graph tracer. In the future
      this side effect may be corrected.
      
      The set_graph_function file is similar to the set_ftrace_filter but
      it does not take wild cards nor does it allow for more than one
      function to be set with a single write. There is no technical reason why
      this is the case, I just do not have the time yet to implement that.
      
      Note, dynamic ftrace must be enabled for this to appear because it
      uses the dynamic ftrace records to match the name to the mcount
      call sites.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      ea4e2bc4
    • S
      trace: fix output of stack trace · 0a37119d
      Steven Rostedt 提交于
      Impact: fix to output of stack trace
      
      If a function is not found in the stack of the stack tracer, the
      number printed is quite strange. This fixes the algorithm to handle
      missing functions better.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      0a37119d
  11. 03 12月, 2008 7 次提交
    • I
      tracing/function-graph-tracer: enabled by default · 764f3b95
      Ingo Molnar 提交于
      CONFIG_FUNCTION_GRAPH_TRACER depends on FUNCTION_TRACER already,
      (turning it non-default) so it so making it default-n is pointless.
      
      So enable it by default - it's a nice extension of the function tracer.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      764f3b95
    • F
      tracing/function-graph-tracer: improve duration output · 166d3c79
      Frederic Weisbecker 提交于
      Impact: better trace output of duration for long calls
      
      The old duration output didn't exceeded 9999.999 us to fit the column
      and the nanosecs were always 3 numbers. As Ingo suggested, it's better
      to have the whole microseconds elapsed time and shift the nanosecs precision
      if needed to fit the maximum 7 numbers. And usec need more number, the case
      should be rare and important enough to break a bit the column alignment to
      show it.
      
      So, depending of the duration value, we now have these patterns:
      
          u.nnn us
         uu.nnn us
        uuu.nnn us
       uuuu.nnn us
       uuuuu.nn us
       uuuuuu.n us
       uuuuuuuu..... us
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      166d3c79
    • F
      tracing/function-graph-tracer: display unified style cmdline and pid · 11e84acc
      Frederic Weisbecker 提交于
      Impact: extend function-graph output: let one know which thread called a function
      
      This patch implements a helper function to print the couple cmdline/pid.
      Its output is provided during task switching and on each row if the new
      "funcgraph-proc" defualt-off option is set through trace_options file.
      
      The output is center aligned and never exceeds 14 characters. The cmdline
      is truncated over 7 chars.
      But note that if the pid exceeds 6 characters, the column will overflow (but
      the situation is abnormal).
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      11e84acc
    • S
      ftrace: function graph return for function entry · e49dc19c
      Steven Rostedt 提交于
      Impact: feature, let entry function decide to trace or not
      
      This patch lets the graph tracer entry function decide if the tracing
      should be done at the end as well. This requires all function graph
      entry functions return 1 if it should trace, or 0 if the return should
      not be traced.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      e49dc19c
    • S
      ring-buffer: change "page" variable names to "bpage" · 044fa782
      Steven Rostedt 提交于
      Impact: clean up
      
      Andrew Morton pointed out that the kernel convention of a variable
      named page should be of type page struct. The ring buffer uses
      a variable named "page" for a pointer to something else.
      
      This patch converts those to be called "bpage" (as in "buffer page").
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      044fa782
    • S
      ftrace: add ftrace_graph_stop() · 14a866c5
      Steven Rostedt 提交于
      Impact: new ftrace_graph_stop function
      
      While developing more features of function graph, I hit a bug that
      caused the WARN_ON to trigger in the prepare_ftrace_return function.
      Well, it was hard for me to find out that was happening because the
      bug would not print, it would just cause a hard lockup or reboot.
      The reason is that it is not safe to call printk from this function.
      
      Looking further, I also found that it calls unregister_ftrace_graph,
      which grabs a mutex and calls kstop machine. This would definitely
      lock the box up if it were to trigger.
      
      This patch adds a fast and safe ftrace_graph_stop() which will
      stop the function tracer. Then it is safe to call the WARN ON.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      14a866c5
    • S
      ring-buffer: read page interface · 8789a9e7
      Steven Rostedt 提交于
      Impact: new API to ring buffer
      
      This patch adds a new interface into the ring buffer that allows a
      page to be read from the ring buffer on a given CPU. For every page
      read, one must also be given to allow for a "swap" of the pages.
      
       rpage = ring_buffer_alloc_read_page(buffer);
       if (!rpage)
      	goto err;
       ret = ring_buffer_read_page(buffer, &rpage, cpu, full);
       if (!ret)
      	goto empty;
       process_page(rpage);
       ring_buffer_free_read_page(rpage);
      
      The caller of these functions must handle any waits that are
      needed to wait for new data. The ring_buffer_read_page will simply
      return 0 if there is no data, or if "full" is set and the writer
      is still on the current page.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      8789a9e7