1. 04 Apr, 2011 4 commits
    • Jason Baron's avatar
      jump label: Introduce static_branch() interface · d430d3d7
      Jason Baron authored
      Introduce:
      
      static __always_inline bool static_branch(struct jump_label_key *key);
      
      instead of the old JUMP_LABEL(key, label) macro.
      
      In this way, jump labels become really easy to use:
      
      Define:
      
              struct jump_label_key jump_key;
      
      Can be used as:
      
              if (static_branch(&jump_key))
                      do unlikely code
      
      enable/disale via:
      
              jump_label_inc(&jump_key);
              jump_label_dec(&jump_key);
      
      that's it!
      
      For the jump labels disabled case, the static_branch() becomes an
      atomic_read(), and jump_label_inc()/dec() are simply atomic_inc(),
      atomic_dec() operations. We show testing results for this change below.
      
      Thanks to H. Peter Anvin for suggesting the 'static_branch()' construct.
      
      Since we now require a 'struct jump_label_key *key', we can store a pointer into
      the jump table addresses. In this way, we can enable/disable jump labels, in
      basically constant time. This change allows us to completely remove the previous
      hashtable scheme. Thanks to Peter Zijlstra for this re-write.
      
      Testing:
      
      I ran a series of 'tbench 20' runs 5 times (with reboots) for 3
      configurations, where tracepoints were disabled.
      
      jump label configured in
      avg: 815.6
      
      jump label *not* configured in (using atomic reads)
      avg: 800.1
      
      jump label *not* configured in (regular reads)
      avg: 803.4
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <20110316212947.GA8792@redhat.com>
      Signed-off-by: default avatarJason Baron <jbaron@redhat.com>
      Suggested-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      Tested-by: default avatarDavid Daney <ddaney@caviumnetworks.com>
      Acked-by: default avatarRalf Baechle <ralf@linux-mips.org>
      Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
      Acked-by: default avatarMathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      d430d3d7
    • Jiri Olsa's avatar
      tracing: Avoid soft lockup in trace_pipe · ee5e51f5
      Jiri Olsa authored
      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: default avatarJiri Olsa <jolsa@redhat.com>
      LKML-Reference: <20110325110518.GC1922@jolsa.brq.redhat.com>
      Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      ee5e51f5
    • Steven Rostedt's avatar
      tracing: Print trace_bprintk() formats for modules too · 1813dc37
      Steven Rostedt authored
      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: default avatarSteven Rostedt <rostedt@goodmis.org>
      1813dc37
    • Steven Rostedt's avatar
      tracing: Convert trace_printk() formats for module to const char * · 0588fa30
      Steven Rostedt authored
      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: default avatarSteven Rostedt <rostedt@goodmis.org>
      0588fa30
  2. 30 Mar, 2011 3 commits
    • Arnaldo Carvalho de Melo's avatar
      perf script: Add more documentation about the -f/--fields parameters · 176fcc5c
      Arnaldo Carvalho de Melo authored
      Using the commit log for 2c9e45f.
      
      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: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      176fcc5c
    • David Ahern's avatar
      perf script: If type not given fields apply to all event types · 2c9e45f7
      David Ahern authored
      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: default avatarDavid Ahern <daahern@cisco.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      2c9e45f7
    • Ingo Molnar's avatar
      Merge branch 'perf/core' of... · ae18cbfe
      Ingo Molnar authored
      Merge branch 'perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 into perf/core
      ae18cbfe
  3. 29 Mar, 2011 9 commits
  4. 28 Mar, 2011 24 commits