1. 02 3月, 2021 2 次提交
  2. 01 12月, 2020 2 次提交
  3. 31 7月, 2020 1 次提交
    • W
      perf tools: Fix record failure when mixed with ARM SPE event · bd3c628f
      Wei Li 提交于
      When recording with cache-misses and arm_spe_x event, I found that it
      will just fail without showing any error info if i put cache-misses
      after 'arm_spe_x' event.
      
        [root@localhost 0620]# perf record -e cache-misses \
      				-e arm_spe_0/ts_enable=1,pct_enable=1,pa_enable=1,load_filter=1,jitter=1,store_filter=1,min_latency=0/ sleep 1
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.067 MB perf.data ]
        [root@localhost 0620]#
        [root@localhost 0620]# perf record -e arm_spe_0/ts_enable=1,pct_enable=1,pa_enable=1,load_filter=1,jitter=1,store_filter=1,min_latency=0/ \
      				     -e  cache-misses sleep 1
        [root@localhost 0620]#
      
      The current code can only work if the only event to be traced is an
      'arm_spe_x', or if it is the last event to be specified. Otherwise the
      last event type will be checked against all the arm_spe_pmus[i]->types,
      none will match and an out of bound 'i' index will be used in
      arm_spe_recording_init().
      
      We don't support concurrent multiple arm_spe_x events currently, that
      is checked in arm_spe_recording_options(), and it will show the relevant
      info. So add the check and record of the first found 'arm_spe_pmu' to
      fix this issue here.
      
      Fixes: ffd3d18c ("perf tools: Add ARM Statistical Profiling Extensions (SPE) support")
      Signed-off-by: NWei Li <liwei391@huawei.com>
      Reviewed-by: NMathieu Poirier <mathieu.poirier@linaro.org>
      Tested-by-by: NLeo Yan <leo.yan@linaro.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Hanjun Guo <guohanjun@huawei.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Kim Phillips <kim.phillips@arm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: http://lore.kernel.org/lkml/20200724071111.35593-2-liwei391@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      bd3c628f
  4. 30 7月, 2020 2 次提交
    • W
      perf tools: No need to cache the PMUs in ARM SPE auxtrace init routine · 3e43d79d
      Wei Li 提交于
      - auxtrace_record__init() is called only once, so there is no point in
        using a static variable to cache the results of
        find_all_arm_spe_pmus(), make it local and free the results after use.
      
      - Another reason is, even though SPE is micro-architecture dependent,
        but so far it only supports "statistical-profiling-extension-v1" and
        we have no chance to use multiple SPE's PMU events in Perf command.
      
      So remove the useless check code to make it clear.
      Signed-off-by: NWei Li <liwei391@huawei.com>
      Reviewed-by: NMathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Hanjun Guo <guohanjun@huawei.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Kim Phillips <kim.phillips@arm.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: http://lore.kernel.org/lkml/20200724071111.35593-3-liwei391@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      3e43d79d
    • W
      perf tools: Fix record failure when mixed with ARM SPE event · 31e81e0b
      Wei Li 提交于
      When recording with cache-misses and arm_spe_x event, I found that it
      will just fail without showing any error info if i put cache-misses
      after 'arm_spe_x' event.
      
        [root@localhost 0620]# perf record -e cache-misses \
      				-e arm_spe_0/ts_enable=1,pct_enable=1,pa_enable=1,load_filter=1,jitter=1,store_filter=1,min_latency=0/ sleep 1
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.067 MB perf.data ]
        [root@localhost 0620]#
        [root@localhost 0620]# perf record -e arm_spe_0/ts_enable=1,pct_enable=1,pa_enable=1,load_filter=1,jitter=1,store_filter=1,min_latency=0/ \
      				     -e  cache-misses sleep 1
        [root@localhost 0620]#
      
      The current code can only work if the only event to be traced is an
      'arm_spe_x', or if it is the last event to be specified. Otherwise the
      last event type will be checked against all the arm_spe_pmus[i]->types,
      none will match and an out of bound 'i' index will be used in
      arm_spe_recording_init().
      
      We don't support concurrent multiple arm_spe_x events currently, that
      is checked in arm_spe_recording_options(), and it will show the relevant
      info. So add the check and record of the first found 'arm_spe_pmu' to
      fix this issue here.
      
      Fixes: ffd3d18c ("perf tools: Add ARM Statistical Profiling Extensions (SPE) support")
      Signed-off-by: NWei Li <liwei391@huawei.com>
      Reviewed-by: NMathieu Poirier <mathieu.poirier@linaro.org>
      Tested-by-by: NLeo Yan <leo.yan@linaro.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Hanjun Guo <guohanjun@huawei.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Kim Phillips <kim.phillips@arm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: http://lore.kernel.org/lkml/20200724071111.35593-2-liwei391@huawei.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      31e81e0b
  5. 23 6月, 2020 1 次提交
  6. 28 5月, 2020 2 次提交
    • A
      perf record: Respect --no-switch-events · 16b4b4e1
      Adrian Hunter 提交于
      Context switch events are added automatically by Intel PT and Coresight.
      
      Make it possible to suppress them. That is useful for tracing the
      scheduler without the disturbance that the switch event processing
      creates.
      
      Example:
      
        Prerequisites:
      
          $ which perf
          ~/bin/perf
          $ sudo setcap "cap_sys_rawio,cap_sys_admin,cap_sys_ptrace,cap_syslog,cap_ipc_lock=ep" ~/bin/perf
          $ sudo chmod +r /proc/kcore
      
        Before:
      
          $ perf record --no-switch-events --kcore -a -e intel_pt//k -- sleep 0.001
          [ perf record: Woken up 1 times to write data ]
          [ perf record: Captured and wrote 0.938 MB perf.data ]
          $ perf script -D | grep PERF_RECORD_SWITCH | wc -l
          572
      
        After:
      
          $ perf record --no-switch-events --kcore -a -e intel_pt//k -- sleep 0.001
          Warning:
          Intel Processor Trace decoding will not be possible except for kernel tracing!
          [ perf record: Woken up 1 times to write data ]
          [ perf record: Captured and wrote 0.838 MB perf.data ]
          $ perf script -D | grep PERF_RECORD_SWITCH | wc -l
          0
      
          $ sudo chmod go-r /proc/kcore
          $ sudo setcap -r ~/bin/perf
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Tested-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Link: http://lore.kernel.org/lkml/20200528120859.21604-1-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      16b4b4e1
    • A
      perf evsel: Rename *perf_evsel__get_config_term() & friends to evsel__env() · 35ac0cad
      Arnaldo Carvalho de Melo 提交于
      As it is a 'struct evsel' method, not part of tools/lib/perf/, aka
      libperf, to whom the perf_ prefix belongs.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      35ac0cad
  7. 06 5月, 2020 3 次提交
  8. 18 2月, 2020 2 次提交
  9. 30 1月, 2020 1 次提交
    • L
      perf parse: Refactor 'struct perf_evsel_config_term' · e884602b
      Leo Yan 提交于
      The struct perf_evsel_config_term::val is a union which contains fields
      'callgraph', 'drv_cfg' and 'branch' as string pointers.  This leads to
      the complex code logic for handling every type's string separately, and
      it's hard to release string as a general way.
      
      This patch refactors the structure to add a common field 'str' in the
      'val' union as string pointer and remove the other three fields
      'callgraph', 'drv_cfg' and 'branch'.  Without passing field name, the
      patch simplifies the string handling with macro ADD_CONFIG_TERM_STR()
      for string pointer assignment.
      
      This patch fixes multiple warnings of line over 80 characters detected
      by checkpatch tool.
      Signed-off-by: NLeo Yan <leo.yan@linaro.org>
      Reviewed-by: NAndi Kleen <ak@linux.intel.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Mike Leach <mike.leach@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: http://lore.kernel.org/lkml/20200117055251.24058-1-leo.yan@linaro.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      e884602b
  10. 10 10月, 2019 1 次提交
    • I
      perf tools: Avoid 'sample_reg_masks' being const + weak · 42466b9f
      Ian Rogers 提交于
      Being const + weak breaks with some compilers that constant-propagate
      from the weak symbol. This behavior is outside of the specification, but
      in LLVM is chosen to match GCC's behavior.
      
      LLVM's implementation was set in this patch:
      
        https://github.com/llvm/llvm-project/commit/f49573d1eedcf1e44893d5a062ac1b72c8419646
      
      A const + weak symbol is set to be weak_odr:
      
        https://llvm.org/docs/LangRef.html
      
      ODR is one definition rule, and given there is one constant definition
      constant-propagation is possible. It is possible to get this code to
      miscompile with LLVM when applying link time optimization. As compilers
      become more aggressive, this is likely to break in more instances.
      
      Move the definition of sample_reg_masks to the conditional part of
      perf_regs.h and guard usage with HAVE_PERF_REGS_SUPPORT. This avoids the
      weak symbol.
      
      Fix an issue when HAVE_PERF_REGS_SUPPORT isn't defined from patch v1.
      In v3, add perf_regs.c for architectures that HAVE_PERF_REGS_SUPPORT but
      don't declare sample_regs_masks.
      
      Further notes:
      
      Jiri asked:
      
        "Is this just a precaution or you actualy saw some breakage?"
      
      Ian answered:
      
        "We saw a breakage with clang with thinlto enabled for linking. Our
         compiler team had recently seen, and were surprised by, a similar issue
         and were able to dig out the weak ODR issue."
      Signed-off-by: NIan Rogers <irogers@google.com>
      Reviewed-by: NNick Desaulniers <ndesaulniers@google.com>
      Acked-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Albert Ou <aou@eecs.berkeley.edu>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: clang-built-linux@googlegroups.com
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: linux-riscv@lists.infradead.org
      Cc: Mao Han <han_mao@c-sky.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Palmer Dabbelt <palmer@sifive.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lore.kernel.org/lkml/20191001003623.255186-1-irogers@google.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      42466b9f
  11. 26 9月, 2019 1 次提交
  12. 25 9月, 2019 3 次提交
  13. 20 9月, 2019 1 次提交
  14. 01 9月, 2019 3 次提交
  15. 30 8月, 2019 1 次提交
  16. 29 8月, 2019 2 次提交
  17. 26 8月, 2019 1 次提交
  18. 22 8月, 2019 2 次提交
  19. 30 7月, 2019 9 次提交