1. 22 1月, 2013 3 次提交
    • S
      tracing: Use this_cpu_ptr per-cpu helper · d8a0349c
      Shan Wei 提交于
      typeof(&buffer) is a pointer to array of 1024 char, or char (*)[1024].
      But, typeof(&buffer[0]) is a pointer to char which match the return type of get_trace_buf().
      As well-known, the value of &buffer is equal to &buffer[0].
      so return this_cpu_ptr(&percpu_buffer->buffer[0]) can avoid type cast.
      
      Link: http://lkml.kernel.org/r/50A1A800.3020102@gmail.comReviewed-by: NChristoph Lameter <cl@linux.com>
      Signed-off-by: NShan Wei <davidshan@tencent.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      d8a0349c
    • S
      ring-buffer: Remove unnecessary recusive call in rb_advance_iter() · 771e0384
      Steven Rostedt 提交于
      The original ring-buffer code had special checks at the start
      of rb_advance_iter() and instead of repeating them again at the
      end of the function if a certain condition existed, I just did
      a recursive call to rb_advance_iter() because the special condition
      would cause rb_advance_iter() to return early (after the checks).
      
      But as things have changed, the special checks no longer exist
      and the only thing done for the special_condition is to call
      rb_inc_iter() and return. Instead of doing a confusing recursive call,
      just call rb_inc_iter instead.
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      771e0384
    • S
      ftrace: Be first to run code modification on modules · c1bf08ac
      Steven Rostedt 提交于
      If some other kernel subsystem has a module notifier, and adds a kprobe
      to a ftrace mcount point (now that kprobes work on ftrace points),
      when the ftrace notifier runs it will fail and disable ftrace, as well
      as kprobes that are attached to ftrace points.
      
      Here's the error:
      
       WARNING: at kernel/trace/ftrace.c:1618 ftrace_bug+0x239/0x280()
       Hardware name: Bochs
       Modules linked in: fat(+) stap_56d28a51b3fe546293ca0700b10bcb29__8059(F) nfsv4 auth_rpcgss nfs dns_resolver fscache xt_nat iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack lockd sunrpc ppdev parport_pc parport microcode virtio_net i2c_piix4 drm_kms_helper ttm drm i2c_core [last unloaded: bid_shared]
       Pid: 8068, comm: modprobe Tainted: GF            3.7.0-0.rc8.git0.1.fc19.x86_64 #1
       Call Trace:
        [<ffffffff8105e70f>] warn_slowpath_common+0x7f/0xc0
        [<ffffffff81134106>] ? __probe_kernel_read+0x46/0x70
        [<ffffffffa0180000>] ? 0xffffffffa017ffff
        [<ffffffffa0180000>] ? 0xffffffffa017ffff
        [<ffffffff8105e76a>] warn_slowpath_null+0x1a/0x20
        [<ffffffff810fd189>] ftrace_bug+0x239/0x280
        [<ffffffff810fd626>] ftrace_process_locs+0x376/0x520
        [<ffffffff810fefb7>] ftrace_module_notify+0x47/0x50
        [<ffffffff8163912d>] notifier_call_chain+0x4d/0x70
        [<ffffffff810882f8>] __blocking_notifier_call_chain+0x58/0x80
        [<ffffffff81088336>] blocking_notifier_call_chain+0x16/0x20
        [<ffffffff810c2a23>] sys_init_module+0x73/0x220
        [<ffffffff8163d719>] system_call_fastpath+0x16/0x1b
       ---[ end trace 9ef46351e53bbf80 ]---
       ftrace failed to modify [<ffffffffa0180000>] init_once+0x0/0x20 [fat]
        actual: cc:bb:d2:4b:e1
      
      A kprobe was added to the init_once() function in the fat module on load.
      But this happened before ftrace could have touched the code. As ftrace
      didn't run yet, the kprobe system had no idea it was a ftrace point and
      simply added a breakpoint to the code (0xcc in the cc:bb:d2:4b:e1).
      
      Then when ftrace went to modify the location from a call to mcount/fentry
      into a nop, it didn't see a call op, but instead it saw the breakpoint op
      and not knowing what to do with it, ftrace shut itself down.
      
      The solution is to simply give the ftrace module notifier the max priority.
      This should have been done regardless, as the core code ftrace modification
      also happens very early on in boot up. This makes the module modification
      closer to core modification.
      
      Link: http://lkml.kernel.org/r/20130107140333.593683061@goodmis.org
      
      Cc: stable@vger.kernel.org
      Acked-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Reported-by: NFrank Ch. Eigler <fche@redhat.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      c1bf08ac
  2. 15 1月, 2013 1 次提交
  3. 12 1月, 2013 1 次提交
    • S
      tracing: Fix regression with irqsoff tracer and tracing_on file · 2df8f8a6
      Steven Rostedt 提交于
      Commit 02404baf "tracing: Remove deprecated tracing_enabled file"
      removed the tracing_enabled file as it never worked properly and
      the tracing_on file should be used instead. But the tracing_on file
      didn't call into the tracers start/stop routines like the
      tracing_enabled file did. This caused trace-cmd to break when it
      enabled the irqsoff tracer.
      
      If you just did "echo irqsoff > current_tracer" then it would work
      properly. But the tool trace-cmd disables tracing first by writing
      "0" into the tracing_on file. Then it writes "irqsoff" into
      current_tracer and then writes "1" into tracing_on. Unfortunately,
      the above commit changed the irqsoff tracer to check the tracing_on
      status instead of the tracing_enabled status. If it's disabled then
      it does not start the tracer internals.
      
      The problem is that writing "1" into tracing_on does not call the
      tracers "start" routine like writing "1" into tracing_enabled did.
      This makes the irqsoff tracer not start when using the trace-cmd
      tool, and is a regression for userspace.
      
      Simple fix is to have the tracing_on file call the tracers start()
      method when being enabled (and the stop() method when disabled).
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      2df8f8a6
  4. 10 1月, 2013 1 次提交
    • S
      tracing: Fix regression of trace_options file setting · a8dd2176
      Steven Rostedt 提交于
      The latest change to allow trace options to be set on the command
      line also broke the trace_options file.
      
      The zeroing of the last byte of the option name that is echoed into
      the trace_option file was removed with the consolidation of some
      of the code. The compare between the option and what was written to
      the trace_options file fails because the string holding the data
      written doesn't terminate with a null character.
      
      A zero needs to be added to the end of the string copied from
      user space.
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      a8dd2176
  5. 18 12月, 2012 2 次提交
  6. 06 12月, 2012 1 次提交
  7. 01 12月, 2012 2 次提交
    • S
      ring-buffer: Fix race between integrity check and readers · 9366c1ba
      Steven Rostedt 提交于
      The function rb_check_pages() was added to make sure the ring buffer's
      pages were sane. This check is done when the ring buffer size is modified
      as well as when the iterator is released (closing the "trace" file),
      as that was considered a non fast path and a good place to do a sanity
      check.
      
      The problem is that the check does not have any locks around it.
      If one process were to read the trace file, and another were to read
      the raw binary file, the check could happen while the reader is reading
      the file.
      
      The issues with this is that the check requires to clear the HEAD page
      before doing the full check and it restores it afterward. But readers
      require the HEAD page to exist before it can read the buffer, otherwise
      it gives a nasty warning and disables the buffer.
      
      By adding the reader lock around the check, this keeps the race from
      happening.
      
      Cc: stable@vger.kernel.org # 3.6
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      9366c1ba
    • S
      ring-buffer: Fix NULL pointer if rb_set_head_page() fails · 54f7be5b
      Steven Rostedt 提交于
      The function rb_set_head_page() searches the list of ring buffer
      pages for a the page that has the HEAD page flag set. If it does
      not find it, it will do a WARN_ON(), disable the ring buffer and
      return NULL, as this should never happen.
      
      But if this bug happens to happen, not all callers of this function
      can handle a NULL pointer being returned from it. That needs to be
      fixed.
      
      Cc: stable@vger.kernel.org # 3.0+
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      54f7be5b
  8. 20 11月, 2012 2 次提交
  9. 16 11月, 2012 2 次提交
  10. 14 11月, 2012 3 次提交
    • Y
      tracing: Show raw time stamp on stats per cpu using counter or tsc mode for trace_clock · 11043d8b
      Yoshihiro YUNOMAE 提交于
      Show raw time stamp values for stats per cpu if you choose counter or tsc mode
      for trace_clock. Although a unit of tracing time stamp is nsec in local or global mode,
      the units in counter and TSC mode are tracing counter and cycles respectively.
      Link: http://lkml.kernel.org/r/1352837903-32191-3-git-send-email-dhsharp@google.com
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Signed-off-by: NYoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>
      Signed-off-by: NDavid Sharp <dhsharp@google.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      11043d8b
    • D
      tracing: Format non-nanosec times from tsc clock without a decimal point. · 8be0709f
      David Sharp 提交于
      With the addition of the "tsc" clock, formatting timestamps to look like
      fractional seconds is misleading. Mark clocks as either in nanoseconds or
      not, and format non-nanosecond timestamps as decimal integers.
      
      Tested:
      $ cd /sys/kernel/debug/tracing/
      $ cat trace_clock
      [local] global tsc
      $ echo sched_switch > set_event
      $ echo 1 > tracing_on ; sleep 0.0005 ; echo 0 > tracing_on
      $ cat trace
                <idle>-0     [000]  6330.555552: sched_switch: prev_comm=swapper prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=bash next_pid=29964 next_prio=120
                 sleep-29964 [000]  6330.555628: sched_switch: prev_comm=bash prev_pid=29964 prev_prio=120 prev_state=S ==> next_comm=swapper next_pid=0 next_prio=120
        ...
      $ echo 1 > options/latency-format
      $ cat trace
        <idle>-0       0 4104553247us+: sched_switch: prev_comm=swapper prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=bash next_pid=29964 next_prio=120
         sleep-29964   0 4104553322us+: sched_switch: prev_comm=bash prev_pid=29964 prev_prio=120 prev_state=S ==> next_comm=swapper next_pid=0 next_prio=120
        ...
      $ echo tsc > trace_clock
      $ cat trace
      $ echo 1 > tracing_on ; sleep 0.0005 ; echo 0 > tracing_on
      $ echo 0 > options/latency-format
      $ cat trace
                <idle>-0     [000] 16490053398357: sched_switch: prev_comm=swapper prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=bash next_pid=31128 next_prio=120
                 sleep-31128 [000] 16490053588518: sched_switch: prev_comm=bash prev_pid=31128 prev_prio=120 prev_state=S ==> next_comm=swapper next_pid=0 next_prio=120
        ...
      echo 1 > options/latency-format
      $ cat trace
        <idle>-0       0 91557653238+: sched_switch: prev_comm=swapper prev_pid=0 prev_prio=120 prev_state=R ==> next_comm=bash next_pid=31128 next_prio=120
         sleep-31128   0 91557843399+: sched_switch: prev_comm=bash prev_pid=31128 prev_prio=120 prev_state=S ==> next_comm=swapper next_pid=0 next_prio=120
        ...
      
      v2:
      Move arch-specific bits out of generic code.
      v4:
      Fix x86_32 build due to 64-bit division.
      
      Google-Bug-Id: 6980623
      Link: http://lkml.kernel.org/r/1352837903-32191-2-git-send-email-dhsharp@google.com
      
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: NDavid Sharp <dhsharp@google.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      8be0709f
    • D
      tracing,x86: Add a TSC trace_clock · 8cbd9cc6
      David Sharp 提交于
      In order to promote interoperability between userspace tracers and ftrace,
      add a trace_clock that reports raw TSC values which will then be recorded
      in the ring buffer. Userspace tracers that also record TSCs are then on
      exactly the same time base as the kernel and events can be unambiguously
      interlaced.
      
      Tested: Enabled a tracepoint and the "tsc" trace_clock and saw very large
      timestamp values.
      
      v2:
      Move arch-specific bits out of generic code.
      v3:
      Rename "x86-tsc", cleanups
      v7:
      Generic arch bits in Kbuild.
      
      Google-Bug-Id: 6980623
      Link: http://lkml.kernel.org/r/1352837903-32191-1-git-send-email-dhsharp@google.comAcked-by: NIngo Molnar <mingo@kernel.org>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: "H. Peter Anvin" <hpa@linux.intel.com>
      Signed-off-by: NDavid Sharp <dhsharp@google.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      8cbd9cc6
  11. 02 11月, 2012 8 次提交
    • S
      tracing: Add trace_options kernel command line parameter · 7bcfaf54
      Steven Rostedt 提交于
      Add trace_options to the kernel command line parameter to be able to
      set options at early boot. For example, to enable stack dumps of
      events, add the following:
      
        trace_options=stacktrace
      
      This along with the trace_event option, you can get not only
      traces of the events but also the stack dumps with them.
      Requested-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      7bcfaf54
    • S
      tracing: Use irq_work for wake ups and remove *_nowake_*() functions · 0d5c6e1c
      Steven Rostedt 提交于
      Have the ring buffer commit function use the irq_work infrastructure to
      wake up any waiters waiting on the ring buffer for new data. The irq_work
      was created for such a purpose, where doing the actual wake up at the
      time of adding data is too dangerous, as an event or function trace may
      be in the midst of the work queue locks and cause deadlocks. The irq_work
      will either delay the action to the next timer interrupt, or trigger an IPI
      to itself forcing an interrupt to do the work (in a safe location).
      
      With irq_work, all ring buffer commits can safely do wakeups, removing
      the need for the ring buffer commit "nowake" variants, which were used
      by events and function tracing. All commits can now safely use the
      normal commit, and the "nowake" variants can be removed.
      
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      0d5c6e1c
    • S
      tracing: Remove deprecated tracing_enabled file · 02404baf
      Steven Rostedt 提交于
      The tracing_enabled file was used as a quick way to stop
      tracers, and try to bring down overhead for things like
      the latency tracers (irqsoff, wakeup, etc). But it didn't
      work that well.
      
      The tracing_on file was created as a really fast way to
      stop recording into the ftrace ring buffer and can interact
      with the kernel. That is a tracing_off() call in the kernel
      can disable recording of events, and then from userspace one
      could echo 1 into the tracing_on file to continue it. The
      tracing_enabled function did too much to allow for this.
      
      The tracing_on has taken over as a way to start and stop tracing
      and the tracing_enabled file should not be used. But because of
      its existance, it still confuses people. Over a year ago the
      following commit was added:
      
       commit 6752ab4a
       Author: Steven Rostedt <srostedt@redhat.com>
       Date:   Tue Feb 8 13:54:06 2011 -0500
      
          tracing: Deprecate tracing_enabled for tracing_on
      
      This commit added a WARN_ON() if the tracing_enabled file's variable
      was changed. After this was added, only LatencyTop complained, and
      they soon fixed their tool as there was no reason that LatencyTop
      should touch this file as it was using the perf ring buffers which
      this file does not interact with. But since that time no one else
      has complained about this WARN_ON(). Thus it is safe to assume that
      this file is no longer needed. Time to get rid of it.
      
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      02404baf
    • S
      tracing: Make tracing_enabled be equal to tracing_on · 0fb9656d
      Steven Rostedt 提交于
      The tracing_enabled file has been deprecated as it never was able
      to serve its purpose well. The tracing_on file has taken over.
      Instead of having code to keep tracing_enabled, have the tracing_enabled
      file just set tracing_on, and remove the tracing_enabled variable.
      
      This allows us to remove the tracing_enabled file. The reason that
      the remove is in a different change set and not removed here is
      in case we find some lonely userspace tool that requires the file
      to exist. Then the removal patch will get reverted, but this one
      will not.
      
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      0fb9656d
    • S
      tracing: Remove unused function unregister_tracer() · c7b84eca
      Steven Rostedt 提交于
      The function register_tracer() is only used by kernel core code,
      that never needs to remove the tracer. As trace_events have become
      the main way to add new tracing to the kernel, the need to
      unregister a tracer has diminished. Remove the unused function
      unregister_tracer(). If a need arises where we need it, then we
      can always add it back.
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      c7b84eca
    • S
      tracing: Separate open function from set_event and available_events · 15075cac
      Steven Rostedt 提交于
      The open function used by available_events is the same as set_event even
      though it uses different seq functions. This causes a side effect of
      writing into available_events clearing all events, even though
      available_events is suppose to be read only.
      
      There's no reason to keep a single function for just the open and have
      both use different functions for everything else. It is a little
      confusing and causes strange behavior. Just have each have their own
      function.
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      15075cac
    • Y
      ring-buffer: Change unsigned long type of ring_buffer_oldest_event_ts() to u64 · 50ecf2c3
      Yoshihiro YUNOMAE 提交于
      ring_buffer_oldest_event_ts() should return a value of u64 type, because
      ring_buffer_per_cpu->buffer_page->buffer_data_page->time_stamp is u64 type.
      
      Link: http://lkml.kernel.org/r/1349998076-15495-5-git-send-email-dhsharp@google.com
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Vaibhav Nagarnaik <vnagarnaik@google.com>
      Signed-off-by: NYoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>
      Signed-off-by: NDavid Sharp <dhsharp@google.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      50ecf2c3
    • D
      tracing: Reset ring buffer when changing trace_clocks · 60303ed3
      David Sharp 提交于
      Because the "tsc" clock isn't in nanoseconds, the ring buffer must be
      reset when changing clocks so that incomparable timestamps don't end up
      in the same trace.
      
      Tested: Confirmed switching clocks resets the trace buffer.
      
      Google-Bug-Id: 6980623
      Link: http://lkml.kernel.org/r/1349998076-15495-3-git-send-email-dhsharp@google.com
      
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Signed-off-by: NDavid Sharp <dhsharp@google.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      60303ed3
  12. 01 11月, 2012 10 次提交
    • V
      tracing: Cleanup unnecessary function declarations · 6f86ab9f
      Vaibhav Nagarnaik 提交于
      The functions defined in include/trace/syscalls.h are not used directly
      since struct ftrace_event_class was introduced. Remove them from the
      header file and rearrange the ftrace_event_class declarations in
      trace_syscalls.c.
      
      Link: http://lkml.kernel.org/r/1339112785-21806-2-git-send-email-vnagarnaik@google.comSigned-off-by: NVaibhav Nagarnaik <vnagarnaik@google.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      6f86ab9f
    • D
      tracing: Trivial cleanup · 01e3e710
      David Sharp 提交于
      Remove ftrace_format_syscall() declaration; it is neither defined nor
      used. Also update a comment and formatting.
      
      Link: http://lkml.kernel.org/r/1339112785-21806-1-git-send-email-vnagarnaik@google.comSigned-off-by: NDavid Sharp <dhsharp@google.com>
      Signed-off-by: NVaibhav Nagarnaik <vnagarnaik@google.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      01e3e710
    • S
      tracing: Cache comms only after an event occurred · 7ffbd48d
      Steven Rostedt 提交于
      Whenever an event is registered, the comm of tasks are saved at
      every task switch instead of saving them at every event. But if
      an event isn't executed much, the comm cache will be filled up
      by tasks that did not record the event and you lose out on the comms
      that did.
      
      Here's an example, if you enable the following events:
      
      echo 1 > /debug/tracing/events/kvm/kvm_cr/enable
      echo 1 > /debug/tracing/events/net/net_dev_xmit/enable
      
      Note, there's no kvm running on this machine so the first event will
      never be triggered, but because it is enabled, the storing of comms
      will continue. If we now disable the network event:
      
      echo 0 > /debug/tracing/events/net/net_dev_xmit/enable
      
      and look at the trace:
      
      cat /debug/tracing/trace
                  sshd-2672  [001] ..s2   375.731616: net_dev_xmit: dev=eth0 skbaddr=ffff88005cbb6de0 len=242 rc=0
                  sshd-2672  [001] ..s1   375.731617: net_dev_xmit: dev=br0 skbaddr=ffff88005cbb6de0 len=242 rc=0
                  sshd-2672  [001] ..s2   375.859356: net_dev_xmit: dev=eth0 skbaddr=ffff88005cbb6de0 len=242 rc=0
                  sshd-2672  [001] ..s1   375.859357: net_dev_xmit: dev=br0 skbaddr=ffff88005cbb6de0 len=242 rc=0
                  sshd-2672  [001] ..s2   375.947351: net_dev_xmit: dev=eth0 skbaddr=ffff88005cbb6de0 len=242 rc=0
                  sshd-2672  [001] ..s1   375.947352: net_dev_xmit: dev=br0 skbaddr=ffff88005cbb6de0 len=242 rc=0
                  sshd-2672  [001] ..s2   376.035383: net_dev_xmit: dev=eth0 skbaddr=ffff88005cbb6de0 len=242 rc=0
                  sshd-2672  [001] ..s1   376.035383: net_dev_xmit: dev=br0 skbaddr=ffff88005cbb6de0 len=242 rc=0
                  sshd-2672  [001] ..s2   377.563806: net_dev_xmit: dev=eth0 skbaddr=ffff88005cbb6de0 len=226 rc=0
                  sshd-2672  [001] ..s1   377.563807: net_dev_xmit: dev=br0 skbaddr=ffff88005cbb6de0 len=226 rc=0
                  sshd-2672  [001] ..s2   377.563834: net_dev_xmit: dev=eth0 skbaddr=ffff88005cbb6be0 len=114 rc=0
                  sshd-2672  [001] ..s1   377.563842: net_dev_xmit: dev=br0 skbaddr=ffff88005cbb6be0 len=114 rc=0
      
      We see that process 2672 which triggered the events has the comm "sshd".
      But if we run hackbench for a bit and look again:
      
      cat /debug/tracing/trace
                 <...>-2672  [001] ..s2   375.731616: net_dev_xmit: dev=eth0 skbaddr=ffff88005cbb6de0 len=242 rc=0
                 <...>-2672  [001] ..s1   375.731617: net_dev_xmit: dev=br0 skbaddr=ffff88005cbb6de0 len=242 rc=0
                 <...>-2672  [001] ..s2   375.859356: net_dev_xmit: dev=eth0 skbaddr=ffff88005cbb6de0 len=242 rc=0
                 <...>-2672  [001] ..s1   375.859357: net_dev_xmit: dev=br0 skbaddr=ffff88005cbb6de0 len=242 rc=0
                 <...>-2672  [001] ..s2   375.947351: net_dev_xmit: dev=eth0 skbaddr=ffff88005cbb6de0 len=242 rc=0
                 <...>-2672  [001] ..s1   375.947352: net_dev_xmit: dev=br0 skbaddr=ffff88005cbb6de0 len=242 rc=0
                 <...>-2672  [001] ..s2   376.035383: net_dev_xmit: dev=eth0 skbaddr=ffff88005cbb6de0 len=242 rc=0
                 <...>-2672  [001] ..s1   376.035383: net_dev_xmit: dev=br0 skbaddr=ffff88005cbb6de0 len=242 rc=0
                 <...>-2672  [001] ..s2   377.563806: net_dev_xmit: dev=eth0 skbaddr=ffff88005cbb6de0 len=226 rc=0
                 <...>-2672  [001] ..s1   377.563807: net_dev_xmit: dev=br0 skbaddr=ffff88005cbb6de0 len=226 rc=0
                 <...>-2672  [001] ..s2   377.563834: net_dev_xmit: dev=eth0 skbaddr=ffff88005cbb6be0 len=114 rc=0
                 <...>-2672  [001] ..s1   377.563842: net_dev_xmit: dev=br0 skbaddr=ffff88005cbb6be0 len=114 rc=0
      
      The stored "sshd" comm has been flushed out and we get a useless "<...>".
      
      But by only storing comms after a trace event occurred, we can run
      hackbench all day and still get the same output.
      
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      7ffbd48d
    • S
      tracing: Have tracing_sched_wakeup_trace() use standard unlock_commit · 2b70e590
      Steven Rostedt 提交于
      The functon tracing_sched_wakeup_trace() does an open coded unlock
      commit and save stack. This is what the trace_nowake_buffer_unlock_commit()
      is for.
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      2b70e590
    • S
      tracing: Enable comm recording if trace_printk() is used · 81698831
      Steven Rostedt 提交于
      If comm recording is not enabled when trace_printk() is used then
      you just get this type of output:
      
      [ adding trace_printk("hello! %d", irq); in do_IRQ ]
      
                 <...>-2843  [001] d.h.    80.812300: do_IRQ: hello! 14
                 <...>-2734  [002] d.h2    80.824664: do_IRQ: hello! 14
                 <...>-2713  [003] d.h.    80.829971: do_IRQ: hello! 14
                 <...>-2814  [000] d.h.    80.833026: do_IRQ: hello! 14
      
      By enabling the comm recorder when trace_printk is enabled:
      
             hackbench-6715  [001] d.h.   193.233776: do_IRQ: hello! 21
                  sshd-2659  [001] d.h.   193.665862: do_IRQ: hello! 21
                <idle>-0     [001] d.h1   193.665996: do_IRQ: hello! 21
      Suggested-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      81698831
    • S
      tracing: Expand ring buffer when trace_printk() is used · b382ede6
      Steven Rostedt 提交于
      Since tracing is not used by 99% of Linux users, even though tracing
      may be configured in, it does not make sense to allocate 1.4 Megs
      per CPU for the ring buffers if they are not used. Thus, on boot up
      the ring buffers are set to a minimal size until something needs the
      and they are expanded.
      
      This works well for events and tracers (function, etc), but for the
      asynchronous use of trace_printk() which can write to the ring buffer
      at any time, does not expand the buffers.
      
      On boot up a check is made to see if any trace_printk() is used to
      see if the trace_printk() temp buffer pages should be allocated. This
      same code can be used to expand the buffers as well.
      Suggested-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      b382ede6
    • S
      ring-buffer: Add a 'dropped events' counter · 884bfe89
      Slava Pestov 提交于
      The existing 'overrun' counter is incremented when the ring
      buffer wraps around, with overflow on (the default). We wanted
      a way to count requests lost from the buffer filling up with
      overflow off, too. I decided to add a new counter instead
      of retro-fitting the existing one because it seems like a
      different statistic to count conceptually, and also because
      of how the code was structured.
      
      Link: http://lkml.kernel.org/r/1310765038-26399-1-git-send-email-slavapestov@google.comSigned-off-by: NSlava Pestov <slavapestov@google.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      884bfe89
    • H
      tracing: Change tracer's integer flags to bool · f43c738b
      Hiraku Toyooka 提交于
      print_max and use_max_tr in struct tracer are "int" variables and
      used like flags. This is wasteful, so change the type to "bool".
      
      Link: http://lkml.kernel.org/r/20121002082710.9807.86393.stgit@falsitaSigned-off-by: NHiraku Toyooka <hiraku.toyooka.gu@hitachi.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      f43c738b
    • S
      tracing: Allow tracers to start at core initcall · 6f415672
      Steven Rostedt 提交于
      There's times during debugging that it is helpful to see traces of early
      boot functions. But the tracers are initialized at device_initcall()
      which is quite late during the boot process. Setting the kernel command
      line parameter ftrace=function will not show anything until the function
      tracer is initialized. This prevents being able to trace functions before
      device_initcall().
      
      There's no reason that the tracers need to be initialized so late in the
      boot process. Move them up to core_initcall() as they still need to come
      after early_initcall() which initializes the tracing buffers.
      
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      6f415672
    • D
      tracing: Replace strict_strto* with kstrto* · bcd83ea6
      Daniel Walter 提交于
       * remove old string conversions with kstrto*
      
      Link: http://lkml.kernel.org/r/20120926200838.GC1244@0x90.atSigned-off-by: NDaniel Walter <sahne@0x90.at>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      bcd83ea6
  13. 25 10月, 2012 1 次提交
  14. 12 10月, 2012 1 次提交
  15. 28 9月, 2012 1 次提交
  16. 25 9月, 2012 1 次提交