1. 03 12月, 2010 1 次提交
    • S
      tracing: Add TRACE_EVENT_CONDITIONAL() · 287050d3
      Steven Rostedt 提交于
      There are instances in the kernel that we only want to trace
      a tracepoint when a certain condition is set. But we do not
      want to test for that condition in the core kernel.
      If we test for that condition before calling the tracepoin, then
      we will be performing that test even when tracing is not enabled.
      This is 99.99% of the time.
      
      We currently can just filter out on that condition, but that happens
      after we write to the trace buffer. We just wasted time writing to
      the ring buffer for an event we never cared about.
      
      This patch adds:
      
         TRACE_EVENT_CONDITION() and DEFINE_EVENT_CONDITION()
      
      These have a new TP_CONDITION() argument that comes right after
      the TP_ARGS().  This condition can use the parameters of TP_ARGS()
      in the TRACE_EVENT() to determine if the tracepoint should be traced
      or not. The TP_CONDITION() will be placed in a if (cond) trace;
      
      For example, for the tracepoint sched_wakeup, it is useless to
      trace a wakeup event where the caller never actually wakes
      anything up (where success == 0). So adding:
      
      	TP_CONDITION(success),
      
      which uses the "success" parameter of the wakeup tracepoint
      will have it only trace when we have successfully woken up a
      task.
      Acked-by: NMathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Acked-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Arjan van de Ven <arjan@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      287050d3
  2. 19 11月, 2010 3 次提交
    • S
      tracing/events: Show real number in array fields · 04295780
      Steven Rostedt 提交于
      Currently we have in something like the sched_switch event:
      
        field:char prev_comm[TASK_COMM_LEN];	offset:12;	size:16;	signed:1;
      
      When a userspace tool such as perf tries to parse this, the
      TASK_COMM_LEN is meaningless. This is done because the TRACE_EVENT() macro
      simply uses a #len to show the string of the length. When the length is
      an enum, we get a string that means nothing for tools.
      
      By adding a static buffer and a mutex to protect it, we can store the
      string into that buffer with snprintf and show the actual number.
      Now we get:
      
        field:char prev_comm[16];       offset:12;      size:16;        signed:1;
      
      Something much more useful.
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      04295780
    • W
      ftrace: Speed up recordmcount · 45677454
      Wu Zhangjin 提交于
      cmd_record_mcount is used to locate the _mcount symbols in the object
      files, only the files compiled with -pg has the _mcount symbol, so, it
      is only needed for such files, but the current cmd_record_mcount is used
      for all of the object files, so, we need to fix it and speed it up.
      
      Since -pg may be removed by the method used in kernel/trace/Makefile:
      
      ORIG_CFLAGS := $(KBUILD_CFLAGS)
      KBUILD_CFLAGS = $(subst -pg,,$(ORIG_CFLAGS))
      
      Or may be removed by the method used in arch/x86/kernel/Makefile:
      
      CFLAGS_REMOVE_file.o = -pg
      
      So, we must check the last variable stores the compiling flags, that is
      c_flags(Please refer to cmd_cc_o_c and rule_cc_o_c defined in
      scripts/Makefile.build) and since the CFLAGS_REMOVE_file.o is already
      filtered in _c_flags(Please refer to scripts/Makefile.lib) and _c_flags
      has less symbols, therefore, we only need to check _c_flags.
      
      ---------------
      Changes from v1:
      
        o Don't touch Makefile for CONFIG_FTRACE_MCOUNT_RECORD is enough
        o Use _c_flags intead of KBUILD_CFLAGS to cover CONFIG_REMOVE_file.o = -pg
        (feedback from Steven Rostedt <rostedt@goodmis.org>)
      Acked-by: NMichal Marek <mmarek@suse.cz>
      Signed-off-by: NWu Zhangjin <wuzhangjin@gmail.com>
      LKML-Reference: <3dc8cddf022eb7024f9f2cf857529a15bee8999a.1288196498.git.wuzhangjin@gmail.com>
      
      [ changed if [ .. == .. ] to if [ .. = .. ] to handle dash environments ]
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      45677454
    • I
      Merge branch 'perf/core' of... · ae51ce90
      Ingo Molnar 提交于
      Merge branch 'perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing into perf/core
      ae51ce90
  3. 18 11月, 2010 9 次提交
    • F
      tracing: Remove useless syscall ftrace_event_call declaration · 423478cd
      Frederic Weisbecker 提交于
      It is defined right after, which makes the declaration completely
      useless.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Cc: Jason Baron <jbaron@redhat.com>
      423478cd
    • F
      tracing: Allow syscall trace events for non privileged users · 53cf810b
      Frederic Weisbecker 提交于
      As for the raw syscalls events, individual syscall events won't
      leak system wide information on task bound tracing. Allow non
      privileged users to use them in such workflow.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Cc: Jason Baron <jbaron@redhat.com>
      53cf810b
    • F
      tracing: Allow raw syscall trace events for non privileged users · fe554203
      Frederic Weisbecker 提交于
      This allows non privileged users to use the raw syscall trace events
      for task bound tracing in perf.
      
      It is safe because raw syscall trace events don't leak system wide
      informations.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Cc: Jason Baron <jbaron@redhat.com>
      fe554203
    • F
      tracing: New macro to set up initial event flags value · 1ed0c597
      Frederic Weisbecker 提交于
      This introduces the new TRACE_EVENT_FLAGS() macro in order
      to set up initial event flags value.
      
      This macro must simply follow the definition of a trace event
      and take the event name and the flag value as parameters:
      
      TRACE_EVENT(my_event, .....
      ....
      );
      
      TRACE_EVENT_FLAGS(my_event, 1)
      
      This will set up 1 as the initial my_event->flags value.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Cc: Jason Baron <jbaron@redhat.com>
      1ed0c597
    • F
      tracing: New flag to allow non privileged users to use a trace event · 61c32659
      Frederic Weisbecker 提交于
      This adds a new trace event internal flag that allows them to be
      used in perf by non privileged users in case of task bound tracing.
      
      This is desired for syscalls tracepoint because they don't leak
      global system informations, like some other tracepoints.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Li Zefan <lizf@cn.fujitsu.com>
      Cc: Jason Baron <jbaron@redhat.com>
      61c32659
    • S
      x86: Eliminate bp argument from the stack tracing routines · 9c0729dc
      Soeren Sandmann Pedersen 提交于
      The various stack tracing routines take a 'bp' argument in which the
      caller is supposed to provide the base pointer to use, or 0 if doesn't
      have one. Since bp is garbage whenever CONFIG_FRAME_POINTER is not
      defined, this means all callers in principle should either always pass
      0, or be conditional on CONFIG_FRAME_POINTER.
      
      However, there are only really three use cases for stack tracing:
      
      (a) Trace the current task, including IRQ stack if any
      (b) Trace the current task, but skip IRQ stack
      (c) Trace some other task
      
      In all cases, if CONFIG_FRAME_POINTER is not defined, bp should just
      be 0.  If it _is_ defined, then
      
      - in case (a) bp should be gotten directly from the CPU's register, so
        the caller should pass NULL for regs,
      
      - in case (b) the caller should should pass the IRQ registers to
        dump_trace(),
      
      - in case (c) bp should be gotten from the top of the task's stack, so
        the caller should pass NULL for regs.
      
      Hence, the bp argument is not necessary because the combination of
      task and regs is sufficient to determine an appropriate value for bp.
      
      This patch introduces a new inline function stack_frame(task, regs)
      that computes the desired bp. This function is then called from the
      two versions of dump_stack().
      Signed-off-by: NSoren Sandmann <ssp@redhat.com>
      Acked-by: NSteven Rostedt <rostedt@goodmis.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arjan van de Ven <arjan@infradead.org>,
      Cc: Frederic Weisbecker <fweisbec@gmail.com>,
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>,
      LKML-Reference: <m3oc9rop28.fsf@dhcp-100-3-82.bos.redhat.com>>
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      9c0729dc
    • D
      x86, nmi_watchdog: Remove all stub function calls from old nmi_watchdog · 072b198a
      Don Zickus 提交于
      Now that the bulk of the old nmi_watchdog is gone, remove all
      the stub variables and hooks associated with it.
      
      This touches lots of files mainly because of how the io_apic
      nmi_watchdog was implemented.  Now that the io_apic nmi_watchdog
      is forever gone, remove all its fingers.
      
      Most of this code was not being exercised by virtue of
      nmi_watchdog != NMI_IO_APIC, so there shouldn't be anything to
      risky here.
      Signed-off-by: NDon Zickus <dzickus@redhat.com>
      Cc: fweisbec@gmail.com
      Cc: gorcunov@openvz.org
      LKML-Reference: <1289578944-28564-3-git-send-email-dzickus@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      072b198a
    • D
      x86, nmi_watchdog: Remove the old nmi_watchdog · 5f2b0ba4
      Don Zickus 提交于
      Now that we have a new nmi_watchdog that is more generic and
      sits on top of the perf subsystem, we really do not need the old
      nmi_watchdog any more.
      
      In addition, the old nmi_watchdog doesn't really work if you are
      using the default clocksource, hpet.  The old nmi_watchdog code
      relied on local apic interrupts to determine if the cpu is still
      alive.  With hpet as the clocksource, these interrupts don't
      increment any more and the old nmi_watchdog triggers false
      postives.
      
      This piece removes the old nmi_watchdog code and stubs out any
      variables and functions calls.  The stubs are the same ones used
      by the new nmi_watchdog code, so it should be well tested.
      Signed-off-by: NDon Zickus <dzickus@redhat.com>
      Cc: fweisbec@gmail.com
      Cc: gorcunov@openvz.org
      LKML-Reference: <1289578944-28564-2-git-send-email-dzickus@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      5f2b0ba4
    • I
      Merge branch 'tip/perf/urgent-3' of... · a89d4bd0
      Ingo Molnar 提交于
      Merge branch 'tip/perf/urgent-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into perf/urgent
      a89d4bd0
  4. 16 11月, 2010 27 次提交