1. 15 11月, 2016 3 次提交
    • J
      perf report: Add branch flag to callchain cursor node · 410024db
      Jin Yao 提交于
      Since the branch ip has been added to call stack for easier browsing,
      this patch adds more branch information. For example, add a flag to
      indicate if this ip is a branch, and also add with the branch flag.
      
      Then we can know if the cursor node represents a branch and know what
      the branch flag it has.
      
      The branch history code has a loop detection pass that removes loops. It
      would be nice for knowing how many loops were removed then in next
      steps, we can compute out the average number of iterations.
      
      For example:
      
      Before remove_loops(),
      entry0: from = 0x100, to = 0x200
      entry1: from = 0x300, to = 0x250
      entry2: from = 0x300, to = 0x250
      entry3: from = 0x300, to = 0x250
      entry4: from = 0x700, to = 0x800
      
      After remove_loops()
      entry0: from = 0x100, to = 0x200
      entry1: from = 0x300, to = 0x250
      entry2: from = 0x700, to = 0x800
      
      The original entry2 and entry3 are removed. So the number of iterations
      (from = 0x300, to = 0x250) is equal to removed number + 1 (2 + 1).
      
      iterations = removed number + 1;
      average iteractions = Sum(iteractions) / number of samples
      
      This formula ignores other cases, for example, iterations cross multiple
      buffers and one buffer contains 2+ loops. Because in practice, it's good
      enough.
      Signed-off-by: NYao Jin <yao.jin@linux.intel.com>
      Acked-by: NAndi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Linux-kernel@vger.kernel.org
      Cc: Yao Jin <yao.jin@linux.intel.com>
      Link: http://lkml.kernel.org/n/1477876794-30749-2-git-send-email-yao.jin@linux.intel.com
      [ Renamed 'iter' to 'nr_loop_iter' for clarity ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      410024db
    • T
      perf config: Mark where are config items from (user or system) · 08d090cf
      Taeung Song 提交于
      To write config items to a particular config file, we should know where
      is each config section and item from.
      
      Current setting functionality of perf-config use autogenerating way by
      overwriting collected config items to a config file.
      
      For example, when collecting config items from user and system config
      files (i.e. ~/.perfconfig and $(sysconf)/perfconfig), perf_config_set
      can contain both user and system config items.  So we should know where
      each value is from to avoid merging user and system config items on user
      config file.
      Signed-off-by: NTaeung Song <treeze.taeung@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Nambong Ha <over3025@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Cc: Wookje Kwon <aweee0@gmail.com>
      Link: http://lkml.kernel.org/r/1478241862-31230-7-git-send-email-treeze.taeung@gmail.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      08d090cf
    • T
      perf config: Add support setting variables in a config file · c6fc018a
      Taeung Song 提交于
      Add setting feature that can add config variables with their values to a
      config file (i.e. user or system config file) or modify config key-value
      pairs in a config file.  For the syntax examples:
      
          perf config [<file-option>] [section.name[=value] ...]
      
      e.g. You can set the ui.show-headers to false with
      
          # perf config ui.show-headers=false
      
      If you want to add or modify several config items, you can do like
      
          # perf config annotate.show_nr_jumps=false kmem.default=slab
      
      Committer notes:
      
      Testing it:
      
        $ perf config -l
        top.children=true
        report.children=false
        $
        $ perf config top.children=false
        $ perf config -l
        top.children=false
        report.children=false
        $
        $ perf config kmem.default=slab
        $ perf config -l
        top.children=false
        report.children=false
        kmem.default=slab
        $
      Signed-off-by: NTaeung Song <treeze.taeung@gmail.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Nambong Ha <over3025@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Cc: Wookje Kwon <aweee0@gmail.com>
      Link: http://lkml.kernel.org/r/1478241862-31230-5-git-send-email-treeze.taeung@gmail.com
      [ Combined patch with docs update with this one ]
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      c6fc018a
  2. 08 11月, 2016 1 次提交
  3. 28 10月, 2016 5 次提交
    • A
      perf tools: Add missing object file to the python binding linkage list · 46cb25b1
      Arnaldo Carvalho de Melo 提交于
      In ac12f676 ("perf tools: Implement branch_type event parameter") we
      started using the parse_branch_str() function from one of the files used
      in the python binding, which caused this entry in 'perf test' to fail:
      
        # perf test -v python
        16: Try 'import perf' in python, checking link problems      :
        --- start ---
        test child forked, pid 16667
        Traceback (most recent call last):
          File "<stdin>", line 1, in <module>
        ImportError: /tmp/build/perf/python/perf.so: undefined symbol:
        parse_branch_str
        test child finished with -1
        ---- end ----
        Try 'import perf' in python, checking link problems: FAILED!
        #
      
      I must've commited some mistake when running 'perf test' to send the
      pull request for the perf-core-for-mingo-20161024 tag, to have let this
      regression to pass, sigh.
      
      Just add tools/perf/util/parse-branch-options.c and switch from using
      ui__warning(), that is not available in the python binding, use
      pr_warning() instead, which is good enough for this case.
      
      Now:
      
        # perf test python
        16: Try 'import perf' in python, checking link problems      : Ok
        #
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Fixes: ac12f676 ("perf tools: Implement branch_type event parameter")
      Link: http://lkml.kernel.org/n/tip-9kn1ct1cx9ppwqlmzl6z0xhs@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      46cb25b1
    • A
      perf scripting: Don't die if scripting can't be setup, disable it · 9a8860bb
      Arnaldo Carvalho de Melo 提交于
      Removing one more set of die() calls.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: http://lkml.kernel.org/n/tip-6pyil685m5i2tugg56gcy0tg@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      9a8860bb
    • A
      perf scripting: Avoid leaking the scripting_context variable · cf346d5b
      Arnaldo Carvalho de Melo 提交于
      Both register_perl_scripting() and register_python_scripting() allocate
      this variable, fix it by checking if it already was.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Tom Zanussi <tzanussi@gmail.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Fixes: 7e4b21b8 ("perf/scripts: Add Python scripting engine")
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      cf346d5b
    • A
      perf list: Support matching by topic · 67bdc35f
      Andi Kleen 提交于
      Add support in perf list topic to only show events belonging to a
      specific vendor events topic. For example the following works now:
      
        % perf list frontend
        List of pre-defined events (to be used in -e):
      
          stalled-cycles-frontend OR idle-cycles-frontend    [Hardware event]
      
          stalled-cycles-frontend OR cpu/stalled-cycles-frontend/ [Kernel PMU event]
      
        frontend:
          dsb2mite_switches.count
               [Decode Stream Buffer (DSB)-to-MITE switches]
          dsb2mite_switches.penalty_cycles
               [Decode Stream Buffer (DSB)-to-MITE switch true penalty cycles]
          dsb_fill.exceed_dsb_lines
               [Cycles when Decode Stream Buffer (DSB) fill encounter more than 3 Decode Stream Buffer (DSB)
                lines]
          icache.hit
               [Number of Instruction Cache, Streaming Buffer and Victim Cache Reads. both cacheable and
                noncacheable, including UC fetches]
        ...
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Link: http://lkml.kernel.org/r/1476902724-9586-2-git-send-email-andi@firstfloor.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      67bdc35f
    • N
      perf tools: Introduce timestamp__scnprintf_usec() · 99620a5d
      Namhyung Kim 提交于
      Joonwoo reported that there's a mismatch between timestamps in script
      and sched commands.  This was because of difference in printing the
      timestamp.  Factor out the code and share it so that they can be in
      sync.  Also I found that sched map has similar problem, fix it too.
      
      Committer notes:
      
      Fixed the max_lat_at bug introduced by Namhyung's original patch, as
      pointed out by Joonwoo, and made it a function following the scnprintf()
      model, i.e. returning the number of bytes formatted, and receiving as
      the first parameter the object from where the data to the formatting is
      obtained, renaming it from:
      
         char *timestamp_in_usec(char *bf, size_t size, u64 timestamp)
      
      to
      
         int timestamp__scnprintf_usec(u64 timestamp, char *bf, size_t size)
      Reported-by: NJoonwoo Park <joonwoop@codeaurora.org>
      Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/20161024020246.14928-3-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      99620a5d
  4. 24 10月, 2016 20 次提交
  5. 21 10月, 2016 1 次提交
  6. 20 10月, 2016 3 次提交
  7. 17 10月, 2016 1 次提交
    • W
      perf jevents: Handle events including .c and .o · 2d470b62
      Wang Nan 提交于
      This patch helps with Sukadev's vendor event tree where such events can happen.
      
      >From Andi Kleen:
       Any event including a .c/.o/.bpf currently triggers BPF compilation or loading
       and then an error. This can happen for some Intel vendor events, which cannot
       be used.
      
      This patch fixes this problem by forbidding BPF file patch containing '{', '}'
      and ',', make sure flex consumes the leading '{', instead of matching it using
      a BPF file path.
      
      Tested result:
      
        $ perf stat -e '{unc_p_clockticks,unc_p_power_state_occupancy.cores_c0}' -a -I 1000
        invalid or unsupported event: '{unc_p_clockticks,unc_p_power_state_occupancy.cores_c0}'
        Run 'perf list' for a list of valid events
        (as expected, interperted as event)
      
        $ perf stat -e 'aaa.c' -a -I 1000
        ERROR: problems with path aaa.c: No such file or directory
        (as expected, interpreted as BPF source)
      
        $ perf stat -e 'aaa.ccc' -a -I 1000
        invalid or unsupported event: 'aaa.ccc'
        (as expected, interpreted as event)
      
        $ perf stat -e '{aaa.c}' -a -I 1000
        ERROR: problems with path aaa.c: No such file or directory
        event syntax error: '{aaa.c}'
        <SKIP>
        (as expected, interpreted as BPF source)
      
        $ perf stat -e '{cycles,aaa.c}' -a -I 1000
        ERROR: problems with path aaa.c: No such file or directory
        event syntax error: '{cycles,aaa.c}'
        (as expected, interpreted as BPF source)
      Signed-off-by: NWang Nan <wangnan0@huawei.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Reported-by: NAndi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Cc: Zefan Li <lizefan@huawei.com>
      Cc: pi3orama@163.com
      Link: http://lkml.kernel.org/r/1475900185-37967-1-git-send-email-wangnan0@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2d470b62
  8. 13 10月, 2016 1 次提交
  9. 05 10月, 2016 2 次提交
  10. 04 10月, 2016 3 次提交