1. 05 4月, 2011 3 次提交
    • J
      tracing: Avoid soft lockup in trace_pipe · ee5e51f5
      Jiri Olsa 提交于
      running following commands:
      
        # enable the binary option
        echo 1 > ./options/bin
        # disable context info option
        echo 0 > ./options/context-info
        # tracing only events
        echo 1 > ./events/enable
        cat trace_pipe
      
      plus forcing system to generate many tracing events,
      is causing lockup (in NON preemptive kernels) inside
      tracing_read_pipe function.
      
      The issue is also easily reproduced by running ltp stress test.
      (ftrace_stress_test.sh)
      
      The reasons are:
       - bin/hex/raw output functions for events are set to
         trace_nop_print function, which prints nothing and
         returns TRACE_TYPE_HANDLED value
       - LOST EVENT trace do not handle trace_seq overflow
      
      These reasons force the while loop in tracing_read_pipe
      function never to break.
      
      The attached patch fixies handling of lost event trace, and
      changes trace_nop_print to print minimal info, which is needed
      for the correct tracing_read_pipe processing.
      
      v2 changes:
       - omit the cond_resched changes by trace_nop_print changes
       - WARN changed to WARN_ONCE and added info to be able
         to find out the culprit
      
      v3 changes:
       - make more accurate patch comment
      Signed-off-by: NJiri Olsa <jolsa@redhat.com>
      LKML-Reference: <20110325110518.GC1922@jolsa.brq.redhat.com>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      ee5e51f5
    • S
      tracing: Print trace_bprintk() formats for modules too · 1813dc37
      Steven Rostedt 提交于
      The file debugfs/tracing/printk_formats maps the addresses
      to the formats that are used by trace_bprintk() so that userspace
      tools can read the buffer and be able to decode trace_bprintk events
      to get the format saved when reading the ring buffer directly.
      
      This is because trace_bprintk() does not store the format into the
      buffer, but just the address of the format, which is hidden in
      the kernel memory.
      
      But currently it only exports trace_bprintk()s from the kernel core
      and not for modules. The modules need their formats exported
      as well.
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      1813dc37
    • S
      tracing: Convert trace_printk() formats for module to const char * · 0588fa30
      Steven Rostedt 提交于
      The trace_printk() formats for modules do not show up in the
      debugfs/tracing/printk_formats file. Only the formats that are
      for trace_printk()s that are in the kernel core.
      
      To facilitate the change to add trace_printk() formats from modules
      into that file as well, we need to convert the structure that
      holds the formats from char fmt[], into const char *fmt,
      and allocate them separately.
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      0588fa30
  2. 31 3月, 2011 2 次提交
    • A
      perf script: Add more documentation about the -f/--fields parameters · 176fcc5c
      Arnaldo Carvalho de Melo 提交于
      Using the commit log for 2c9e45f7.
      
      Cc: David Ahern <daahern@cisco.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      176fcc5c
    • D
      perf script: If type not given fields apply to all event types · 2c9e45f7
      David Ahern 提交于
      Allow:
        perf script -f <fields>
      
      to be equivalent to:
        perf script -f trace:<fields> -f sw:<fields> -f hw:<fields>
      
      i.e., the specified fields apply to all event types if the type string
      is not given.
      
      The field (-f) arguments are processed in the order received. A later
      usage can reset a prior request. e.g.,
      
        -f trace: -f comm,tid,time,sym
      
      The first -f suppresses trace events (field list is ""), but then the second
      invocation sets the fields to comm,tid,time,sym. In this case a warning is
      given to the user:
      
        "Overriding previous field request for all events."
      
      Alternativey, consider the order:
      
        -f comm,tid,time,sym -f trace:
      
      The first -f sets the fields for all events and the second -f suppresses trace
      events. The user is given a warning message about the override, and the result
      of the above is that only S/W and H/W events are displayed with the given
      fields.
      
      For the 'wildcard' option if a user selected field is invalid for an event
      type, a message is displayed to the user that the option is ignored for that
      type. For example:
      
        perf script -f comm,tid,trace 2>&1 | less
        'trace' not valid for hardware events. Ignoring.
        'trace' not valid for software events. Ignoring.
      
      Alternatively, if the type is given an invalid field is specified it is an
      error. For example:
      
          perf script -v -f sw:comm,tid,trace 2>&1 | less
          'trace' not valid for software events.
      
      At this point usage is displayed, and perf-script exits.
      
      Finally, a user may not set fields to none for all event types.
      i.e., -f "" is not allowed.
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: linux-kernel@vger.kernel.org
      LPU-Reference: <1300377801-27246-1-git-send-email-daahern@cisco.com>
      Signed-off-by: NDavid Ahern <daahern@cisco.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2c9e45f7
  3. 30 3月, 2011 4 次提交
    • I
      Merge branch 'perf/core' of... · ae18cbfe
      Ingo Molnar 提交于
      Merge branch 'perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 into perf/core
      ae18cbfe
    • L
      perf probe: Add fastpath to do lookup by function name · cd25f8bc
      Lin Ming 提交于
      v3 -> v2:
      - Make pubname_search_cb more generic
      - Add fastpath to find_probes also
      
      v2 -> v1:
      - Don't compare file names with cu_find_realpath(...), instead, compare
        them with the name returned by dwarf_decl_file(sp_die)
      
      The vmlinux file may have thousands of CUs.
      We can lookup function name from .debug_pubnames section
      to avoid the slow loop on CUs.
      
      1. Improvement data for find_line_range
      
      ./perf stat -e cycles -r 10 -- ./perf probe -k /home/mlin/vmlinux \
              -s /home/mlin/linux-2.6 \
              --line csum_partial_copy_to_user > tmp.log
      
      before patch applied
      =====================
             847,988,276 cycles
      
              0.355075856  seconds time elapsed
      
      after patch applied
      =====================
             206,102,622 cycles
      
              0.086883555  seconds time elapsed
      
      2. Improvement data for find_probes
      
      ./perf stat -e cycles -r 10 -- ./perf probe -k /home/mlin/vmlinux \
              -s /home/mlin/linux-2.6 \
              --vars csum_partial_copy_to_user > tmp.log
      
      before patch applied
      =====================
             848,490,844 cycles
      
              0.355307901  seconds time elapsed
      
      after patch applied
      =====================
             205,684,469 cycles
      
              0.086694010  seconds time elapsed
      Acked-by: NMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: linux-kernel <linux-kernel@vger.kernel.org>
      LKML-Reference: <1301041668.14111.52.camel@minggr.sh.intel.com>
      Signed-off-by: NLin Ming <ming.m.lin@intel.com>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      cd25f8bc
    • D
      perf tools: Emit clearer message for sys_perf_event_open ENOENT return · ca6a4258
      David Ahern 提交于
      Resend of patch sent back in January 2011 in light of recent confusion around
      unsupported events for a given platform.
      
      Improve sys_perf_event_open ENOENT return handling in top and record, just
      like 5a3446bc does for stat.
      
      Retry of Arnaldo's patch using ui_warning instead of die which allows the
      fallback from hardware cycles to software clock.
      
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      LKML-Reference: <1301080271-20945-1-git-send-email-daahern@cisco.com>
      Signed-off-by: NDavid Ahern <daahern@cisco.com>
      [ committer note: Some adjustments to make it apply to newer codebase ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      ca6a4258
    • A
      perf tools: Fixup exit path when not able to open events · c286c419
      Arnaldo Carvalho de Melo 提交于
      We have to deal with the TUI mode in perf top, so that we don't end up
      with a garbled screen when, say, a non root user on a machine with a
      paranoid setting (the default) tries to use 'perf top'.
      
      Introduce a ui__warning_paranoid() routine shared by top and record that
      tells the user the valid values for /proc/sys/kernel/perf_event_paranoid.
      
      Cc: David Ahern <daahern@cisco.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      LKML-Reference: <new-submission>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c286c419
  4. 29 3月, 2011 28 次提交
  5. 28 3月, 2011 3 次提交