1. 02 7月, 2021 1 次提交
    • L
      perf cs-etm: Remove callback cs_etm_find_snapshot() · 2f01c200
      Leo Yan 提交于
      The callback cs_etm_find_snapshot() is invoked for snapshot mode, its
      main purpose is to find the correct AUX trace data and returns "head"
      and "old" (we can call "old" as "old head") to the caller, the caller
      __auxtrace_mmap__read() uses these two pointers to decide the AUX trace
      data size.
      
      This patch removes cs_etm_find_snapshot() with below reasons:
      
      - The first thing in cs_etm_find_snapshot() is to check if the head has
        wrapped around, if it is not, directly bails out.  The checking is
        pointless, this is because the "head" and "old" pointers both are
        monotonical increasing so they never wrap around.
      
      - cs_etm_find_snapshot() adjusts the "head" and "old" pointers and
        assumes the AUX ring buffer is fully filled with the hardware trace
        data, so it always subtracts the difference "mm->len" from "head" to
        get "old".  Let's imagine the snapshot is taken in very short
        interval, the tracers only fill a small chunk of the trace data into
        the AUX ring buffer, in this case, it's wrongly to copy the whole the
        AUX ring buffer to perf file.
      
      - As the "head" and "old" pointers are monotonically increased, the
        function __auxtrace_mmap__read() handles these two pointers properly.
        It calculates the reminders for these two pointers, and the size is
        clamped to be never more than "snapshot_size".  We can simply reply on
        the function __auxtrace_mmap__read() to calculate the correct result
        for data copying, it's not necessary to add Arm CoreSight specific
        callback.
      Signed-off-by: NLeo Yan <leo.yan@linaro.org>
      Reviewed-by: NJames Clark <james.clark@arm.com>
      Tested-by: NJames Clark <james.clark@arm.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Daniel Kiss <daniel.kiss@arm.com>
      Cc: Denis Nikitin <denik@google.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: John Garry <john.garry@huawei.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: Will Deacon <will@kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: coresight@lists.linaro.org
      Link: http://lore.kernel.org/lkml/20210701093537.90759-3-leo.yan@linaro.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      2f01c200
  2. 24 3月, 2021 1 次提交
  3. 07 3月, 2021 1 次提交
    • S
      perf cs-etm: Fix bitmap for option · 6fc5baf5
      Suzuki K Poulose 提交于
      When set option with macros ETM_OPT_CTXTID and ETM_OPT_TS, it wrongly
      takes these two values (14 and 28 prespectively) as bit masks, but
      actually both are the offset for bits.  But this doesn't lead to
      further failure due to the AND logic operation will be always true for
      ETM_OPT_CTXTID / ETM_OPT_TS.
      
      This patch defines new independent macros (rather than using the
      "config" bits) for requesting the "contextid" and "timestamp" for
      cs_etm_set_option().
      Signed-off-by: NSuzuki Poulouse <suzuki.poulose@arm.com>
      Reviewed-by: NMike Leach <mike.leach@linaro.org>
      Cc: Al Grant <al.grant@arm.com>
      Cc: Daniel Kiss <daniel.kiss@arm.com>
      Cc: Denis Nikitin <denik@chromium.org>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: coresight@lists.linaro.org
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: linux-doc@vger.kernel.org
      Link: http://lore.kernel.org/lkml/20210206150833.42120-5-leo.yan@linaro.org
      [ Extract the change as a separate patch for easier review ]
      Signed-off-by: NLeo Yan <leo.yan@linaro.org>
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      6fc5baf5
  4. 02 3月, 2021 3 次提交
  5. 01 12月, 2020 2 次提交
  6. 23 6月, 2020 1 次提交
  7. 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
  8. 06 5月, 2020 3 次提交
  9. 18 2月, 2020 2 次提交
  10. 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
  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 次提交