1. 04 Dec, 2013 26 commits
    • Jiri Olsa's avatar
      tools lib traceevent: Add kmem plugin · f8256288
      Jiri Olsa authored
      Backporting kmem plugin.
      
      Backported from Steven Rostedt's trace-cmd repo (HEAD 0f2c2fb):
      git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git
      
      This plugin adds call_site field resolving for following tracepoint
      events:
      
        kmem:kfree
        kmem:kmalloc
        kmem:kmalloc_node
        kmem:kmem_cache_alloc
        kmem:kmem_cache_alloc_node
        kmem:kmem_cache_free
      
      The diff of 'perf script' output generated by old and new code: (data
      was generated by 'perf record -e 'kmem:*' -a')
      
        --- script.kmem.old
        +++ script.kmem.new
        -            perf 27846 [001] 29643.403319: kmem:kfree: call_site=ffffffff810e64f6 ptr=(nil)
        +            perf 27846 [001] 29643.403238: kmem:kfree: (__audit_syscall_exit+0x1f6) call_site=ffffffff810e64f6 ptr=(nil)
        -            perf 27846 [001] 29643.403337: kmem:kmem_cache_alloc: call_site=ffffffff812ff0c5 ptr=0xffff88020e155630 bytes_req=560 bytes_alloc=568 gfp_flags=GFP_KERNEL
        +            perf 27846 [001] 29643.403337: kmem:kmem_cache_alloc: (radix_tree_preload+0x35) call_site=ffffffff812ff0c5 ptr=0xffff88020e155630 bytes_req=560 bytes_alloc=568 gfp_flags=GFP_KERNEL
        -            perf 27846 [001] 29643.403342: kmem:kmem_cache_free: call_site=ffffffff8126ec61 ptr=0xffff88020dffe750
        +            perf 27846 [001] 29643.403342: kmem:kmem_cache_free: (jbd2_journal_stop+0x221) call_site=ffffffff8126ec61 ptr=0xffff88020dffe750
        -         firefox   954 [000] 29643.445477: kmem:kmem_cache_alloc_node: call_site=ffffffff8153c64e ptr=0xffff8801cecb4000 bytes_req=256 bytes_alloc=256 gfp_flags=GFP_KERNEL|GFP_REPEAT node=-1
        +         firefox   954 [000] 29643.445477: kmem:kmem_cache_alloc_node: (__alloc_skb+0x4e) call_site=ffffffff8153c64e ptr=0xffff8801cecb4000 bytes_req=256 bytes_alloc=256 gfp_flags=GFP_KERNEL|GFP_REPEAT node=-1
        -            perf 27846 [001] 29643.445510: kmem:kmalloc: call_site=ffffffff81250642 ptr=0xffff88020fd6c300 bytes_req=96 bytes_alloc=96 gfp_flags=GFP_NOFS|GFP_ZERO
        +            perf 27846 [001] 29643.445510: kmem:kmalloc: (ext4_ext_find_extent+0x362) call_site=ffffffff81250642 ptr=0xffff88020fd6c300 bytes_req=96 bytes_alloc=96 gfp_flags=GFP_NOFS|GFP_ZERO
        -               X   888 [002] 29643.445546: kmem:kmalloc_node: call_site=ffffffff8153c67e ptr=0xffff880103828e00 bytes_req=384 bytes_alloc=512 gfp_flags=GFP_KERNEL|GFP_NOWARN|GFP_REPEAT|GFP_NOMEMALLOC node=-1
        +               X   888 [002] 29643.445546: kmem:kmalloc_node: (__alloc_skb+0x7e) call_site=ffffffff8153c67e ptr=0xffff880103828e00 bytes_req=384 bytes_alloc=512 gfp_flags=GFP_KERNEL|GFP_NOWARN|GFP_REPEAT|GFP_NOMEMALLOC node=-1
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1386076182-14484-15-git-send-email-jolsa@redhat.comSigned-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f8256288
    • Jiri Olsa's avatar
      tools lib traceevent: Add hrtimer plugin · d9d13f8b
      Jiri Olsa authored
      Backporting hrtimer plugin.
      
      Backported from Steven Rostedt's trace-cmd repo (HEAD 0f2c2fb):
      git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git
      
      This plugin adds function field resolving for following tracepoint
      events:
      
        timer:hrtimer_expire_entry
        timer:hrtimer_start
      
      The diff of 'perf script' output generated by old and new code: (data
      was generated by 'perf record -e 'timer:hrtimer*' -a')
      
        --- script.hrtimer.old
        +++ script.hrtimer.new
        -         swapper     0 [000] 27405.519092: timer:hrtimer_start: [FAILED TO PARSE] hrtimer=0xffff88021e20e800 function=0xffffffff810c0e10 expires=27398383000000 softexpires=27398383000000
        +         swapper     0 [000] 27405.519103: timer:hrtimer_start: hrtimer=0xffff88021e20e800 function=tick_sched_timer expires=27398383000000 softexpires=27398383000000
        -         swapper     0 [001] 27405.519544: timer:hrtimer_expire_entry: [FAILED TO PARSE] hrtimer=0xffff880211334058 now=27398294182491 function=0xffffffff81086f20
        +         swapper     0 [001] 27405.519544: timer:hrtimer_expire_entry: hrtimer=0xffff880211334058 now=27398294182491 function=posix_timer_fn/0x0
      
      Check the 'function' field is translated into the function name.
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1386076182-14484-14-git-send-email-jolsa@redhat.comSigned-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      d9d13f8b
    • Jiri Olsa's avatar
      tools lib traceevent: Add jbd2 plugin · e0549f11
      Jiri Olsa authored
      Backporting jbd2 plugin.
      
      Backported from Steven Rostedt's trace-cmd repo (HEAD 0f2c2fb):
      git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git
      
      This plugin adds field resolving functions for following tracepoint
      events:
      
        jbd2:jbd2_checkpoint_stats
        jbd2:jbd2_run_stats
      
      The diff of 'perf script' output generated by old and new code:
      (data was generated by 'perf record -e 'jbd2:jbd2_run_stats,jbd2:jbd2_checkpoint_stats' -a')
      
        --- script.jbd2.old
        +++ script.jbd2.new
        -     jbd2/dm-3-8   576 [000]  2983.748423: jbd2:jbd2_checkpoint_stats: [FAILED TO PARSE] dev=265289731 tid=0x3f2bbb chp_time=0x0 forced_to_close=0 written=0 dropped=2
        +     jbd2/dm-3-8   576 [000]  2983.748423: jbd2:jbd2_checkpoint_stats: dev 253,3 tid 4139963 chp_time 0 forced_to_close 0 written 0 dropped 2
        -     jbd2/dm-3-8   576 [000]  2983.852789: jbd2:jbd2_run_stats: [FAILED TO PARSE] dev=265289731 tid=0x3f2bc0 wait=0x0 request_delay=0x0 running=0x138d locked=0x0 flushing=0x0 logging=0x68 handle_count=2995 blocks=17 blocks_logged=18
        +     jbd2/dm-3-8   576 [000]  2983.852789: jbd2:jbd2_run_stats: dev 253,3 tid 4139968 wait 0 request_delay 0 running 5005 locked 0 flushing 0 logging 104 handle_count 2995 blocks 17 blocks_logged 18
      
      This plugin also adds jbd2_dev_to_name function, which was removed from
      jdb2 tracepoints recently. Keeping it in for backward compatibility
      reasons.
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1386076182-14484-13-git-send-email-jolsa@redhat.comSigned-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e0549f11
    • Jiri Olsa's avatar
      perf tools: Overload pr_stat traceevent print function · f772abc6
      Jiri Olsa authored
      The traceevent lib uses pr_stat to display all standard info. It's
      defined as __weak. Overloading it with perf version plugged into perf
      output system logic.
      
      Displaying the pr_stat stuff under '-v' option.
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1386076182-14484-12-git-send-email-jolsa@redhat.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f772abc6
    • Jiri Olsa's avatar
      perf tools: Add trace-event global object for tracepoint interface · 97978b3e
      Jiri Olsa authored
      In order to get the proper plugins processing we need to use full
      trace-event interface when creating tracepoint events. So far we were
      using shortcut to get the parsed format.
      
      Moving current 'event_format__new' function into trace-event object as
      'trace_event__tp_format'.
      
      This function uses properly initialized global trace-event object,
      ensuring proper plugins processing.
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1386076182-14484-11-git-send-email-jolsa@redhat.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      97978b3e
    • Jiri Olsa's avatar
      perf tools: Add trace-event object · 29f5ffd3
      Jiri Olsa authored
      Add trace-event object to keep together 'struct pevent' object with its
      loaded plugins with following interface:
      
      int trace_event__init(struct trace_event *t);
      
        - Initalizes 'struct pevent' object and loads plugins for it
      
      void trace_event__cleanup(struct trace_event *t);
      
        - Cleanups both 'struct pevent' and plugins
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1386076182-14484-10-git-send-email-jolsa@redhat.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      29f5ffd3
    • Jiri Olsa's avatar
      perf tools: Add filename__read_str util function · cef82c9f
      Jiri Olsa authored
      Adding filename__read_str util function to read
      text file and return it in the char array.
      
      The interface is:
        int filename__read_str(const char *filename, char **buf, size_t *sizep)
      
        Returns 0/-1 if the read suceeded/fail respectively.
      
        buf  - place to store the data pointer
        size - place to store data size
      
      v2 change:
        - better error handling suggested by Namhyung Kim.
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1386076182-14484-9-git-send-email-jolsa@redhat.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      cef82c9f
    • Jiri Olsa's avatar
      perf tools: Add build and install plugins targets · 3d7c0144
      Jiri Olsa authored
      Adding 'plugins' target along with the libtraceevent.a, so plugins are
      built together with traceevent library.
      
      Adding 'install-traceevent-plugins' Makefile install target, instructing
      perf to install plugins into:
      
        $(HOME)/.traceevent/plugins
          - If installed localy under $HOME
      
        $(DESTDIR)/$(prefix)/$(libdir)/traceevent/plugins
          - If installed globally
      
      Examples:
        $ make install
        ...
        $ find ~/.traceevent/plugins/
        /home/jolsa/.traceevent/plugins/
        /home/jolsa/.traceevent/plugins/plugin_mac80211.so
        /home/jolsa/.traceevent/plugins/plugin_kvm.so
        /home/jolsa/.traceevent/plugins/plugin_scsi.so
        /home/jolsa/.traceevent/plugins/plugin_sched_switch.so
        /home/jolsa/.traceevent/plugins/plugin_xen.so
        /home/jolsa/.traceevent/plugins/plugin_cfg80211.so
        /home/jolsa/.traceevent/plugins/plugin_function.so
        /home/jolsa/.traceevent/plugins/plugin_kmem.so
        /home/jolsa/.traceevent/plugins/plugin_hrtimer.so
        /home/jolsa/.traceevent/plugins/plugin_jbd2.so
      
        $ sudo make install DESTDIR=/opt/perf/
        ...
        $ find /opt/perf/lib64/traceevent/plugins/
        /opt/perf/lib64/traceevent/plugins/
        /opt/perf/lib64/traceevent/plugins/plugin_kvm.so
        /opt/perf/lib64/traceevent/plugins/plugin_scsi.so
        /opt/perf/lib64/traceevent/plugins/plugin_mac80211.so
        /opt/perf/lib64/traceevent/plugins/plugin_hrtimer.so
        /opt/perf/lib64/traceevent/plugins/plugin_kmem.so
        /opt/perf/lib64/traceevent/plugins/plugin_jbd2.so
        /opt/perf/lib64/traceevent/plugins/plugin_sched_switch.so
        /opt/perf/lib64/traceevent/plugins/plugin_function.so
        /opt/perf/lib64/traceevent/plugins/plugin_cfg80211.so
        /opt/perf/lib64/traceevent/plugins/plugin_xen.so
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1386076182-14484-8-git-send-email-jolsa@redhat.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      3d7c0144
    • Jiri Olsa's avatar
      tools lib traceevent: Harmonize the install messages in lib-traceevent · f33c5cd7
      Jiri Olsa authored
      Removing the 'to ...' part out of the install message, because it does
      not fit to the rest of the build messages we use.
      
      Before:
        INSTALL  plugin_hrtimer.so    to      /home/jolsa/libexec/perf-core/traceevent/plugins
        INSTALL  plugin_jbd2.so       to      /home/jolsa/libexec/perf-core/traceevent/plugins
        INSTALL  plugin_kmem.so       to      /home/jolsa/libexec/perf-core/traceevent/plugins
        INSTALL  plugin_kvm.so        to      /home/jolsa/libexec/perf-core/traceevent/plugins
        INSTALL  plugin_mac80211.so   to      /home/jolsa/libexec/perf-core/traceevent/plugins
        INSTALL  plugin_sched_switch.so       to      /home/jolsa/libexec/perf-core/traceevent/plugins
        INSTALL  plugin_function.so   to      /home/jolsa/libexec/perf-core/traceevent/plugins
        INSTALL  plugin_xen.so        to      /home/jolsa/libexec/perf-core/traceevent/plugins
        INSTALL  plugin_scsi.so       to      /home/jolsa/libexec/perf-core/traceevent/plugins
      
      Now:
        INSTALL  plugin_jbd2.so
        INSTALL  plugin_hrtimer.so
        INSTALL  plugin_kmem.so
        INSTALL  plugin_kvm.so
        INSTALL  plugin_mac80211.so
        INSTALL  plugin_sched_switch.so
        INSTALL  plugin_function.so
        INSTALL  plugin_xen.so
        INSTALL  plugin_scsi.so
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1386076182-14484-7-git-send-email-jolsa@redhat.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f33c5cd7
    • Jiri Olsa's avatar
      tools lib traceevent: Change pevent_parse_format to include pevent handle · 71ad9583
      Jiri Olsa authored
      Changing the pevent_parse_format interface to include the pevent handle.
      
      The goal is to always use pevent object when dealing with traceevent
      library. The reason is that we might need additional processing (like
      plugins), which is not possible otherwise.
      
      Patches follow to make this happen completely.
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1386076182-14484-6-git-send-email-jolsa@redhat.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      71ad9583
    • Jiri Olsa's avatar
      tools lib traceevent: Add traceevent_host_bigendian function · 91a058ad
      Jiri Olsa authored
      Adding traceevent_host_bigendian function to get host endianity. It's
      used in following patches.
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1386076182-14484-5-git-send-email-jolsa@redhat.comSigned-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      91a058ad
    • Jiri Olsa's avatar
      tools lib traceevent: Add plugin build support · e0e96d03
      Jiri Olsa authored
      Backporting missing pieces of plugin building infrastructure:
      
        - Adding Makefile 'plugins' target to build all
          defined plugins
      
        - Adding Makefile 'install_plugins' target as 'install_lib'
          target dependency
      
        - Link plugin objects with shared object building
      
      Backported from Steven Rostedt's trace-cmd repo (HEAD 0f2c2fb):
      git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git
      
      Plugins are by default installed into following locations:
      
        '$(HOME)/.traceevent/plugins'
           - If we are installing under $(HOME)
      
        '$(prefix)/lib/traceevent/plugins'
           - Otherwise
      
      This path is propagated to the plugin object as a plugins search path.
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1386076182-14484-4-git-send-email-jolsa@redhat.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e0e96d03
    • Jiri Olsa's avatar
      tools lib traceevent: Add plugin support · c877bbd8
      Jiri Olsa authored
      Backporting plugin support for traceevent lib.
      
      Backported from Steven Rostedt's trace-cmd repo (HEAD 0f2c2fb):
      git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git
      
      It's now possible to use following interface to load plugins
      (shared objects) to enhance pevent object functionality.
      
      The plugin interface/hooks are as follows:
      (taken from event-parse.h comments)
      
      - 'pevent_plugin_loader' (required)
          The function name to initialized the plugin.
      
          int pevent_plugin_loader(struct pevent *pevent)
      
      - 'pevent_plugin_unloader' (optional)
          The function called just before unloading
      
          int pevent_plugin_unloader(void)
      
      - 'pevent_plugin_options'  (optional)
          Plugin options that can be set before loading
      
          struct plugin_option pevent_plugin_options[] = {
             {
                     .name = "option-name",
                     .plugin_alias = "overide-file-name", (optional)
                     .description = "description of option to show users",
             },
             {
                     .name = NULL,
             },
          };
      
          Array must end with .name = NULL;
      
          The plugin_alias (below) can be used to give a shorter
          name to access the variable. Useful if a plugin handles
          more than one event.
      
          NOTE options support is not backported yet.
      
      - 'pevent_plugin_alias' (optional)
          The name to use for finding options (uses filename if not defined)
      
      New traceevent functions are added to search and load
      available plugins:
      
        struct plugin_list*
        traceevent_load_plugins(struct pevent *pevent)
          - loads plusing for 'struct pevent' object and returns
            loaded plugins list
      
        void traceevent_unload_plugins(struct plugin_list *plugin_list);
          - unload plugin list
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1386076182-14484-3-git-send-email-jolsa@redhat.comSigned-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      c877bbd8
    • Adrian Hunter's avatar
      perf script: Do not call perf_event__preprocess_sample() twice) · a2cb3cf2
      Adrian Hunter authored
      The perf_event__preprocess_sample() function is called in
      process_sample_event().  Instead of calling it again in
      perf_evsel__print_ip(), pass through the resultant addr_location.
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/529F3944.9050007@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      a2cb3cf2
    • Adrian Hunter's avatar
      perf symbols: Fix random fd closing with no libelf · 779e24e2
      Adrian Hunter authored
      When built without libelf, perf tools was failing to initialize a file
      descriptor, but nevertheless closing it.  That sometimes resulted in the
      output being truncated because the stdout file descriptor got closed.
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1386166981-30197-1-git-send-email-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      779e24e2
    • Dongsheng Yang's avatar
      perf kvm: Update the 'record' man page entry for new --guest/--host behavior · 8df0b4ad
      Dongsheng Yang authored
      As we have changed the default behavior of 'perf kvm' to --guest
      enabled, the parts of the man page that covers the 'record' subcommand
      are outdated.
      
      This patch updates it to show the correct output with
      --host/--guest/neither/both of them.
      Signed-off-by: default avatarDongsheng Yang <yangds.fnst@cn.fujitsu.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/3a3a9c1e05acb5a274d1d8369db5a4c6467d6276.1386197481.git.yangds.fnst@cn.fujitsu.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      8df0b4ad
    • Dongsheng Yang's avatar
      perf kvm: Fix spurious '=' use in man page · 316bd98a
      Dongsheng Yang authored
      As option --host and --guest request no input for it, there should not
      be a '=' after them in the man page sources.
      
      And --output expects a filename as the input, so there should be a '='
      after it.
      
      This patch removes the needless '=' after --guest and --host, and adds a
      '=' after --output in perf-kvm.txt.
      Signed-off-by: default avatarDongsheng Yang <yangds.fnst@cn.fujitsu.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/6124d9eb10a3f1f6b399d1db660110bc7a60fd6b.1386197481.git.yangds.fnst@cn.fujitsu.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      316bd98a
    • Dongsheng Yang's avatar
      perf kvm: Add more detail about buildid-list in man page · ed086d5b
      Dongsheng Yang authored
      As the buildid is read from /sys/kernel/notes, then if we use perf kvm
      buildid-list with a perf data file captured by perf kvm record with
      --guestkallsyms and --guestmodules, there is no result in output.
      
      This patch add a explanation about it and add a limit of using perf kvm
      buildid-list.
      Signed-off-by: default avatarDongsheng Yang <yangds.fnst@cn.fujitsu.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/d605a805486340b53bc261aa64d7632ad0a8cf53.1386197481.git.yangds.fnst@cn.fujitsu.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      ed086d5b
    • Dongsheng Yang's avatar
      perf target: Move the checking of which map function to call into function. · 9c105fbc
      Dongsheng Yang authored
      Check for cpu_map__dummy_new() or cpu_map__new() to be called in
      perf_evlist__create_maps() is more complicated.
      
      This patch moves the checking work into target.h, combining two
      conditions and making perf_evlist__create_maps() more readable.
      Signed-off-by: default avatarDongsheng Yang <yangds.fnst@cn.fujitsu.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/b8c41f1fd2c4f0df71eb7b19aea74fb64d46cdda.1386197481.git.yangds.fnst@cn.fujitsu.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      9c105fbc
    • Dongsheng Yang's avatar
      perf tools: Remove condition in machine__get_kernel_start_addr. · 2f375735
      Dongsheng Yang authored
      In machine__get_kernel_start_addr, the code, which is using
      machine->root_dir to build filename, works for both host and guests
      initialized from guestmount, as root_dir is set to "" for the host
      machine in the machine__init() function.
      
      So this patch remove the branch for machine__is_host.
      Signed-off-by: default avatarDongsheng Yang <yangds.fnst@cn.fujitsu.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/0a81645dd0b384a12cb4f962cf193ef8c3ce2010.1386197481.git.yangds.fnst@cn.fujitsu.com
      [ Clarified changeset mentioning root_dir setup in machine__init() ]
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      2f375735
    • Jiri Olsa's avatar
      perf tools: Remove stackprotector feature check · e6d7cee1
      Jiri Olsa authored
      We use -fstack-protector-all option to enable stack protecting for all
      available functions. There's no reason for enabling -Wstack-protector to
      get warning for unprotected functions.
      
      Removing stackprotector feature check which was used to enable the
      -Wstack-protector option.
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Link: http://lkml.kernel.org/r/1386076182-14484-2-git-send-email-jolsa@redhat.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e6d7cee1
    • Adrian Hunter's avatar
      perf tools: Do not disable source line lookup just because of 1 failure · 906049c8
      Adrian Hunter authored
      Looking up an ip's source file name and line number does not succeed
      always.  Current logic disables the lookup for a dso entirely on any
      failure.  Change it so that disabling never happens if there has ever
      been a successful lookup for that dso but disable if the first 123
      lookups fail.
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1386055390-13757-8-git-send-email-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      906049c8
    • Adrian Hunter's avatar
      perf symbols: Retain symbol source file name to lookup source line numbers · 0058aef6
      Adrian Hunter authored
      Currently, lookup of an ip's source file name and line number is done
      using the dso file name.
      
      Instead retain the file name used to lookup the dso's symbols and use
      that.
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1386055390-13757-6-git-send-email-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0058aef6
    • Adrian Hunter's avatar
      perf symbols: Retain bfd reference to lookup source line numbers · 454ff00f
      Adrian Hunter authored
      Closng and re-opening for every lookup when using libbfd to lookup
      source file name and line number is very very slow.  Instead keep the
      reference on struct dso.
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1386055390-13757-5-git-send-email-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      454ff00f
    • Adrian Hunter's avatar
      perf tools: Use asprintf instead of malloc plus snprintf · d88938eb
      Adrian Hunter authored
      The asprintf library function is equivalent to malloc plus snprintf so
      use it because it is simpler.
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/r/1386055390-13757-4-git-send-email-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      d88938eb
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo' of... · 89e3bbd5
      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/tools improvements and fixes from Arnaldo Carvalho de Melo:
      
        * Honour -m option in 'trace', the tool was offering the option to
          set the mmap size, but wasn't using it when doing the actual mmap
          on the events file descriptors, fix from Jiri Olsa.
      
        * Correct the message in feature-libnuma checking, swowing the right
          devel package names for various distros, from Dongsheng Yang.
      
        * Polish 'readn' function and introduce its counterpart, 'writen', from
          Jiri Olsa.
      
        * Start moving timechart state from global variables to a 'perf_tool' derived
          'timechart' struct.
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      89e3bbd5
  2. 02 Dec, 2013 12 commits
  3. 30 Nov, 2013 1 commit
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo' of... · 0ed1e0be
      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 and fixes from Arnaldo Carvalho de Melo:
      
        * Make per-cpu mmaps the default in 'perf record', from Adrian Hunter.
      
        * Default -t/--thread 'perf record' option to no inheritance,
          from Adrian Hunter.
      
        * Make 'perf top -g' refer to callchains, for consistency with other tools,
          from David Ahern.
      
        * Skip ignored symbols while printing callchain, from David Ahern.
      
        * Print callchains and symbols if they exist in 'perf script',
          from David Ahern.
      
        * Remove thread summary coloring in 'perf trace', from Pekka Enberg.
      
        * zsh completion support, from Ramkumar Ramachandra.
      
        * 'perf timechart' improvements, including backtrace support,
          from Stanislav Fomichev.
      
        * Fix using kcore files stored in the buildid cache when doing report/annotate
          in non-live sessions, from Adrian Hunter
      
        * Minor 'timechart' cleanups.
      
        * Fix tags/TAGS targets rebuilding, from Jiri Olsa.
      
        * Add options to show comm, fork, exit and mmap PERF_RECORD_ events in
          'perf script', from Namhyung Kim.
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      0ed1e0be
  4. 27 Nov, 2013 1 commit