1. 05 12月, 2013 3 次提交
    • J
      tools lib traceevent: Remove malloc_or_die from plugin_function.c · d8e56c98
      Jiri Olsa 提交于
      Removing malloc_or_die calls from plugin_function.c, replacing them and
      factoring the code with standard realloc and error path.
      Suggested-by: NNamhyung Kim <namhyung@kernel.org>
      Signed-off-by: NJiri 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-27-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      d8e56c98
    • J
      tools lib traceevent: Several cleanups for function plugin · 39956e78
      Jiri Olsa 提交于
      Several cleanups suggested by Namhyung:
      
        * Remove index field from struct func_stack as it's not needed.
      
        * Rename get_index into add_and_get_index.
      
        * Use '%*X' format string capability instead of the loop
      Suggested-by: NNamhyung Kim <namhyung@kernel.org>
      Signed-off-by: NJiri 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-26-git-send-email-jolsa@redhat.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      39956e78
    • J
      tools lib traceevent: Add function plugin · 07a180a0
      Jiri Olsa 提交于
      Backporting function 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 and parent function fields resolving for
      ftrace:function tracepoint event.
      
      The diff of 'perf script' output generated by old and new code:
      (data was generated by 'perf record -e ftrace:function ls')
      
        --- script.function.old
        +++ script.function.new
        -              ls 10781 [001] 32667.291379: ftrace:function:  ffffffff811adb80 <-- ffffffff811afc48
        -              ls 10781 [001] 32667.291379: ftrace:function:  ffffffff811b35d0 <-- ffffffff811adb9b
        -              ls 10781 [001] 32667.291380: ftrace:function:  ffffffff811b3520 <-- ffffffff811b35e8
        -              ls 10781 [001] 32667.291380: ftrace:function:  ffffffff811b2720 <-- ffffffff811b3549
        -              ls 10781 [001] 32667.291381: ftrace:function:  ffffffff81297e10 <-- ffffffff811b356c
        -              ls 10781 [001] 32667.291381: ftrace:function:  ffffffff81298f40 <-- ffffffff81297e2c
        -              ls 10781 [001] 32667.291382: ftrace:function:  ffffffff81076160 <-- ffffffff811afbf0
        -              ls 10781 [001] 32667.291383: ftrace:function:  ffffffff811c3eb0 <-- ffffffff811afbfc
        -              ls 10781 [001] 32667.291383: ftrace:function:  ffffffff8164e100 <-- ffffffff811c3ed8
        -              ls 10781 [001] 32667.291384: ftrace:function:  ffffffff811a5d10 <-- ffffffff811c3f53
        -              ls 10781 [001] 32667.291384: ftrace:function:  ffffffff811e8e70 <-- ffffffff811a5d58
        -              ls 10781 [001] 32667.291385: ftrace:function:  ffffffff811f38e0 <-- ffffffff811a5d63
        -              ls 10781 [001] 32667.291385: ftrace:function:  ffffffff811a9ff0 <-- ffffffff811a5d6b
        -              ls 10781 [001] 32667.291386: ftrace:function:  ffffffff811a9fa0 <-- ffffffff811aa015
        -              ls 10781 [001] 32667.291387: ftrace:function:  ffffffff810851c0 <-- ffffffff811aa053
        -              ls 10781 [001] 32667.291387: ftrace:function:  ffffffff81090e00 <-- ffffffff81085211
        +              ls 10781 [001] 32667.291379: ftrace:function: would_dump <-- setup_new_exec
        +              ls 10781 [001] 32667.291379: ftrace:function:    inode_permission <-- would_dump
        +              ls 10781 [001] 32667.291380: ftrace:function:       __inode_permission <-- inode_permission
        +              ls 10781 [001] 32667.291380: ftrace:function:          generic_permission <-- __inode_permission
        +              ls 10781 [001] 32667.291381: ftrace:function:          security_inode_permission <-- __inode_permission
        +              ls 10781 [001] 32667.291381: ftrace:function:             cap_inode_permission <-- security_inode_permission
        +              ls 10781 [001] 32667.291382: ftrace:function: flush_signal_handlers <-- setup_new_exec
        +              ls 10781 [001] 32667.291383: ftrace:function: do_close_on_exec <-- setup_new_exec
        +              ls 10781 [001] 32667.291383: ftrace:function:    _raw_spin_lock <-- do_close_on_exec
        +              ls 10781 [001] 32667.291384: ftrace:function:    filp_close <-- do_close_on_exec
        +              ls 10781 [001] 32667.291384: ftrace:function:       dnotify_flush <-- filp_close
        +              ls 10781 [001] 32667.291385: ftrace:function:       locks_remove_posix <-- filp_close
        +              ls 10781 [001] 32667.291385: ftrace:function:       fput <-- filp_close
        +              ls 10781 [001] 32667.291386: ftrace:function:          file_sb_list_del <-- fput
        +              ls 10781 [001] 32667.291387: ftrace:function:          task_work_add <-- fput
        +              ls 10781 [001] 32667.291387: ftrace:function:             kick_process <-- task_work_add
      
      Removing options support as it's not backported yet.
      Currently this plugin supports 2 options:
       'parent' to display parent function
       'indent' to show function call indents
      
      Enabling both of them by default.
      Signed-off-by: NJiri 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-19-git-send-email-jolsa@redhat.comSigned-off-by: NSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      07a180a0