1. 13 Nov, 2012 1 commit
  2. 02 Nov, 2012 8 commits
    • Steven Rostedt's avatar
      tracing: Add trace_options kernel command line parameter · 7bcfaf54
      Steven Rostedt authored
      
      
      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: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      7bcfaf54
    • Steven Rostedt's avatar
      tracing: Use irq_work for wake ups and remove *_nowake_*() functions · 0d5c6e1c
      Steven Rostedt authored
      
      
      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: default avatarSteven Rostedt <rostedt@goodmis.org>
      0d5c6e1c
    • Steven Rostedt's avatar
      tracing: Remove deprecated tracing_enabled file · 02404baf
      Steven Rostedt authored
      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: default avatarSteven Rostedt <rostedt@goodmis.org>
      02404baf
    • Steven Rostedt's avatar
      tracing: Make tracing_enabled be equal to tracing_on · 0fb9656d
      Steven Rostedt authored
      
      
      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: default avatarSteven Rostedt <rostedt@goodmis.org>
      0fb9656d
    • Steven Rostedt's avatar
      tracing: Remove unused function unregister_tracer() · c7b84eca
      Steven Rostedt authored
      
      
      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: default avatarSteven Rostedt <rostedt@goodmis.org>
      c7b84eca
    • Steven Rostedt's avatar
      tracing: Separate open function from set_event and available_events · 15075cac
      Steven Rostedt authored
      
      
      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: default avatarSteven Rostedt <rostedt@goodmis.org>
      15075cac
    • Yoshihiro YUNOMAE's avatar
      ring-buffer: Change unsigned long type of ring_buffer_oldest_event_ts() to u64 · 50ecf2c3
      Yoshihiro YUNOMAE authored
      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: default avatarYoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>
      Signed-off-by: default avatarDavid Sharp <dhsharp@google.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      50ecf2c3
    • David Sharp's avatar
      tracing: Reset ring buffer when changing trace_clocks · 60303ed3
      David Sharp authored
      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: default avatarDavid Sharp <dhsharp@google.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      60303ed3
  3. 31 Oct, 2012 11 commits
    • Michal Hocko's avatar
      linux/kernel.h: Remove duplicate trace_printk declaration · 60efc15a
      Michal Hocko authored
      !CONFIG_TRACING both declares and defines (empty) trace_printk.
      The first one is not redundant so it can be removed.
      
      Link: http://lkml.kernel.org/r/1351172511-18125-1-git-send-email-mhocko@suse.cz
      
      
      
      Signed-off-by: default avatarMichal Hocko <mhocko@suse.cz>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      60efc15a
    • Vaibhav Nagarnaik's avatar
      tracing: Cleanup unnecessary function declarations · 6f86ab9f
      Vaibhav Nagarnaik authored
      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.com
      
      
      
      Signed-off-by: default avatarVaibhav Nagarnaik <vnagarnaik@google.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      6f86ab9f
    • David Sharp's avatar
      tracing: Trivial cleanup · 01e3e710
      David Sharp authored
      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.com
      
      
      
      Signed-off-by: default avatarDavid Sharp <dhsharp@google.com>
      Signed-off-by: default avatarVaibhav Nagarnaik <vnagarnaik@google.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      01e3e710
    • Steven Rostedt's avatar
      tracing: Cache comms only after an event occurred · 7ffbd48d
      Steven Rostedt authored
      
      
      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: default avatarSteven Rostedt <rostedt@goodmis.org>
      7ffbd48d
    • Steven Rostedt's avatar
      tracing: Have tracing_sched_wakeup_trace() use standard unlock_commit · 2b70e590
      Steven Rostedt authored
      
      
      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: default avatarSteven Rostedt <rostedt@goodmis.org>
      2b70e590
    • Steven Rostedt's avatar
      tracing: Enable comm recording if trace_printk() is used · 81698831
      Steven Rostedt authored
      
      
      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: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      81698831
    • Steven Rostedt's avatar
      tracing: Expand ring buffer when trace_printk() is used · b382ede6
      Steven Rostedt authored
      
      
      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: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      b382ede6
    • Slava Pestov's avatar
      ring-buffer: Add a 'dropped events' counter · 884bfe89
      Slava Pestov authored
      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.com
      
      
      
      Signed-off-by: default avatarSlava Pestov <slavapestov@google.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      884bfe89
    • Hiraku Toyooka's avatar
      tracing: Change tracer's integer flags to bool · f43c738b
      Hiraku Toyooka authored
      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@falsita
      
      
      
      Signed-off-by: default avatarHiraku Toyooka <hiraku.toyooka.gu@hitachi.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      f43c738b
    • Steven Rostedt's avatar
      tracing: Allow tracers to start at core initcall · 6f415672
      Steven Rostedt authored
      
      
      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: default avatarSteven Rostedt <rostedt@goodmis.org>
      6f415672
    • Daniel Walter's avatar
      tracing: Replace strict_strto* with kstrto* · bcd83ea6
      Daniel Walter authored
       * remove old string conversions with kstrto*
      
      Link: http://lkml.kernel.org/r/20120926200838.GC1244@0x90.at
      
      
      
      Signed-off-by: default avatarDaniel Walter <sahne@0x90.at>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      bcd83ea6
  4. 30 Oct, 2012 2 commits
    • Peter Huewe's avatar
      perf/x86: Fix sparse warnings · 95d18aa2
      Peter Huewe authored
      
      
      FYI, there are new sparse warnings:
      
       arch/x86/kernel/cpu/perf_event.c:1356:18: sparse: symbol 'events_attr' was not declared. Should it be static?
      
      This patch makes it static and also adds the static keyword to
      fix arch/x86/kernel/cpu/perf_event.c:1344:9: warning: symbol
      'events_sysfs_show' was not declared.
      
      Signed-off-by: default avatarPeter Huewe <peterhuewe@gmx.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Yuanhan Liu <yuanhan.liu@linux.intel.com>
      Cc: fengguang.wu@intel.com
      Cc: Jiri Olsa <jolsa@redhat.com>
      Link: http://lkml.kernel.org/n/tip-lerdpXlnruh0yvWs2owwuizl@git.kernel.org
      
      
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      95d18aa2
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo' of... · 8748dd9b
      Ingo Molnar authored
      Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
      
       into perf/core
      
      Pull perf/core improvements, fixes and code move from Arnaldo Carvalho de Melo:
      
       * Initialize 'page_size' variable in the python binding, this was sent
         for perf/urgent by mistake, then when merging Ingo removed it, fixing
         the problem for perf/urgent, but when perf/urgent was merged with
         perf/core, where that initialization is needed, made the python
         binding mmap call to fail, fix it by initializing page_size again.
      
       * Add a browser for 'perf script' and make it available from the report
         and annotate browsers. It does filtering to find the scripts that
         handle events found in the perf.data file used. From Feng Tang
      
       * Move some functions from symbol.c to more appropriate files, creating
         dso.[ch] in the process, no code changes. From Jiri Olsa
      
       * Fix mmap error output message for when perf_mmap fails and returns
         !-EPERM, where the default for mmap_pages, INT_MAX, was causing a
         !power of 2 error message, fix from Jiri Olsa.
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      8748dd9b
  5. 29 Oct, 2012 13 commits
  6. 28 Oct, 2012 1 commit
  7. 26 Oct, 2012 4 commits