1. 24 Mar, 2015 6 commits
  2. 23 Mar, 2015 7 commits
  3. 22 Mar, 2015 2 commits
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo-2' of... · 963a70b8
      Ingo Molnar authored
      Merge tag 'perf-core-for-mingo-2' 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:
      
        - Handle legacy syscalls tracepoints (David Ahern, Arnaldo Carvalho de Melo)
      
        - Indicate which callchain entries are annotated in the
          TUI hists browser (report/top) (Arnaldo Carvalho de Melo)
      
        - Fix failure to add multiple probes without debuginfo (He Kuang)
      
        - Fix 'trace' summary_only option (David Ahern)
      
        - Fix race in build_id_cache__add_s() in 'buildid-cache' (Milos Vyletel)
      
        - Don't allow empty argument for field-separator, fixing segfault (Wang Nan)
      
      Infrastructure:
      
        - Add destructor for format_field in libtraceevent (David Ahern)
      
        - Prep work for support lzma compressed kernel modules (Jiri Olsa)
      
        - Update .gitignore with recently added/renamed feature detection files (Yunlong Song)
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      963a70b8
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo' of... · 08b3f913
      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:
      
      User visible changes:
      
        - Bash completion for subcommands (Yunlong Song)
      
        - Allow annotating entries in callchains in the hists browser (top/report).
          TODO: give some visual cue to what entries in callchains have samples and thus
          can be annotated and/or allow showing the source code for functions without
          samples (Arnaldo Carvalho de Melo)
      
        - Don't allow empty argument for '-t' in perf report, fixing segfault (Wang Nan)
      
      Infrastructure:
      
        - Prep work for moving the perf feature tests build system to tools/build (Jiri Olsa)
      
        - Fix perf-read-vdsox32 not building and lib64 install dir (H.J. Lu)
      
        - ARM64: fix building error and eh/debug frame offset cache fixes (Wang Nan)
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      08b3f913
  4. 21 Mar, 2015 15 commits
  5. 20 Mar, 2015 4 commits
  6. 19 Mar, 2015 6 commits
    • Wang Nan's avatar
      perf report: Don't allow empty argument for '-t'. · 0c8c2077
      Wang Nan authored
      Without this patch, perf report cause segfault if pass "" as '-t':
      
        $ perf report -t ""
      
         # To display the perf.data header info, please use --header/--header-only options.
         #
         # Samples: 37  of event 'syscalls:sys_enter_write'
         # Event count (approx.): 37
         #
         # Children    SelfCommand   Shared Object         Symbol
         Segmentation fault
      
      Since -t is used to add field-separator for generate table, -t "" is
      actually meanless. This patch defines a new OPT_STRING_NOEMPTY() option
      generator to ensure user never pass empty string to that option.
      Signed-off-by: default avatarWang Nan <wangnan0@huawei.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: pi3orama@163.com
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Zefan Li <lizefan@huawei.com>
      Link: http://lkml.kernel.org/r/1426251114-198991-1-git-send-email-wangnan0@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0c8c2077
    • Wang Nan's avatar
      perf callchain: Separate eh/debug frame offset cache. · 303cb89a
      Wang Nan authored
      Commit f1f13af9 ("perf callchain: Cache eh/debug frame offset for
      dwarf unwind") introduces a cache for .debug_frame and .eh_frame_hdr.
      Unfortunately, it makes them share a same cache (dso->frame_offset).
      Which causes unwind failure on ARM:
      
         $ perf test unwind
        Test dwarf unwind: FAILED!
      
      The reason is that, if a dso has '.debug_frame' but doesn't have
      '.eh_frame_hdr' (like ARM), dso->frame_offset will be filled by offset
      of '.debug_frame' during the first time calling of find_proc_info() ->
      read_unwind_spec_debug_frame(), and be regarded to '.eh_frame_hdr' when
      the second time calling of find_proc_info() ->
      read_unwind_spec_eh_frame(), since '.eh_frame_hdr' is checked prior to
      '.debug_frame'.
      
      This patch solves the problem by creating two cache fields for
      '.eh_frame_hdr' and '.debug_frame'.
      Signed-off-by: default avatarWang Nan <wangnan0@huawei.com>
      Acked-by: default avatarJiri Olsa <jolsa@redhat.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Li Zefan <lizefan@huawei.com>
      Link: http://lkml.kernel.org/r/55028BA0.1030701@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      303cb89a
    • Yunlong Song's avatar
      perf tools: Avoid confusion with preloaded bash function for perf bash completion · 1312c8a8
      Yunlong Song authored
      Since some functions (e.g. '_get_comp_words_by_ref()') in perf bash
      completion script are originally taken from git bash completion script,
      these functions may be preloaded before perf bash completion script
      runs.
      
      In order to avoid repeating loading the same function twice, some test
      constraints are used before these function definitions in the perf bash
      completion script (e.g. 'type _get_comp_words_by_ref &>/dev/null ||').
      
      The problem is that, if these functions in perf bash completion script
      are changed for some reason, perf will still use the preloaded bash
      functions rather than the customized functions of its own.
      
      As a result, the perf bash completion will behave incorrectly. To get
      rid of this problem, a flag can be defined to determine the proper
      situation.
      
      And to avoid overwriting the preloaded functions, the names of these
      functions in perf bash completion script should be renamed to the
      perf-customized ones.
      
      Example:
      
      Before this patch:
      
       $ type _get_comp_words_by_ref
       _get_comp_words_by_ref is a function
       _get_comp_words_by_ref ()
       {
           local exclude flag i OPTIND=1;
           local cur cword words=();
           local upargs=() upvars=() vcur vcword vprev vwords;
           while getopts "c:i:n:p:w:" flag "$@"; do
               case $flag in
                   c)
                       vcur=$OPTARG
                   ;;
                   i)
                       vcword=$OPTARG
                   ;;
                   n)
                       exclude=$OPTARG
                   ;;
                   p)
                       vprev=$OPTARG
                   ;;
                   w)
                       vwords=$OPTARG
                   ;;
               esac;
           done;
           while [[ $# -ge $OPTIND ]]; do
               case ${!OPTIND} in
                   cur)
                       vcur=cur
                   ;;
                   prev)
                       vprev=prev
                   ;;
                   cword)
                       vcword=cword
                   ;;
                   words)
                       vwords=words
                   ;;
                   *)
                       echo "bash: $FUNCNAME(): \`${!OPTIND}': unknown argument" 1>&2;
                       return 1
                   ;;
               esac;
               let "OPTIND += 1";
           done;
           __get_cword_at_cursor_by_ref "$exclude" words cword cur;
           [[ -n $vcur ]] && {
               upvars+=("$vcur");
               upargs+=(-v $vcur "$cur")
           };
           [[ -n $vcword ]] && {
               upvars+=("$vcword");
               upargs+=(-v $vcword "$cword")
           };
           [[ -n $vprev && $cword -ge 1 ]] && {
               upvars+=("$vprev");
               upargs+=(-v $vprev "${words[cword - 1]}")
           };
           [[ -n $vwords ]] && {
               upvars+=("$vwords");
               upargs+=(-a${#words[@]} $vwords "${words[@]}")
           };
           (( ${#upvars[@]} )) && local "${upvars[@]}" && _upvars "${upargs[@]}"
       }
      
      As shown above, the _get_comp_words_by_ref is the preloaded function in
      fact, rather than the function defined in perf-completion.sh. So if we
      happen to change the function for some reason, the result will behave in
      a wrong state.
      
      After this patch:
      
      We can set preload_get_comp_words_by_ref="false" to not use the preloaded
      function. Instead, it will use the function defined in perf-completion.sh,
      which is renamed as __perf_get_comp_words_by_ref to avoid overwriting
      the preloaded function _get_comp_words_by_ref.
      
       $ type __perf_get_comp_words_by_ref
       __perf_get_comp_words_by_ref is a function
       __perf_get_comp_words_by_ref ()
       {
           local exclude cur_ words_ cword_;
           if [ "$1" = "-n" ]; then
               exclude=$2;
               shift 2;
           fi;
           __my_reassemble_comp_words_by_ref "$exclude";
           cur_=${words_[cword_]};
           while [ $# -gt 0 ]; do
               case "$1" in
                   cur)
                       cur=$cur_
                   ;;
                   prev)
                       prev=${words_[$cword_-1]}
                   ;;
                   words)
                       words=("${words_[@]}")
                   ;;
                   cword)
                       cword=$cword_
                   ;;
               esac;
               shift;
           done
       }
      
      As shown above, the function __perf_get_comp_words_by_ref is loaded and
      can work this time.
      
      Note that we do not change the original behavior when those functions are
      not preloaded before perf bash completion script runs. In this case,
      although the flag is set to "true", the code will still change it to
      "false" to use the function defined in perf-completion.sh.
      Signed-off-by: default avatarYunlong Song <yunlong.song@huawei.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/1426685758-25488-14-git-send-email-yunlong.song@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      1312c8a8
    • Yunlong Song's avatar
      perf tools: Add the bash completion for listing subsubcommands of perf trace · 6fdd9cb7
      Yunlong Song authored
      The bash completion does not support listing subsubcommands for 'perf
      trace <TAB>', so fix it.
      
      Example:
      
      Before this patch:
      
       $ perf trace <TAB>
       $
      
      As shown above, the subsubcommands of perf trace does not come out.
      
      After this patch:
      
       $ perf trace <TAB>
       record
      
      As shown above, the subsubcommands of perf trace can come out now.
      Signed-off-by: default avatarYunlong Song <yunlong.song@huawei.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/1426685758-25488-13-git-send-email-yunlong.song@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      6fdd9cb7
    • Yunlong Song's avatar
      perf tools: Add the bash completion for listing subsubcommands of perf timechart · 33ec0caf
      Yunlong Song authored
      The bash completion does not support listing subsubcommands for 'perf
      timechart <TAB>', so fix it.
      
      Example:
      
      Before this patch:
      
       $ perf timechart <TAB>
       $
      
      As shown above, the subsubcommands of perf timechart does not come out.
      
      After this patch:
      
       $ perf timechart <TAB>
       record
      
      As shown above, the subsubcommands of perf timechart can come out now.
      Signed-off-by: default avatarYunlong Song <yunlong.song@huawei.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/1426685758-25488-12-git-send-email-yunlong.song@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      33ec0caf
    • Yunlong Song's avatar
      perf tools: Add the bash completion for listing subsubcommands of perf test · 1f9975f1
      Yunlong Song authored
      The bash completion does not support listing subsubcommands for 'perf
      test <TAB>', so fix it.
      
      Example:
      
      Before this patch:
      
       $ perf test <TAB>
       $
      
      As shown above, the subsubcommands of perf test does not come out.
      
      After this patch:
      
       $ perf test <TAB>
       list
      
      As shown above, the subsubcommands of perf test can come out now.
      Signed-off-by: default avatarYunlong Song <yunlong.song@huawei.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/r/1426685758-25488-11-git-send-email-yunlong.song@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      1f9975f1