Skip to content
  1. Apr 25, 2023
    • James Clark's avatar
      perf cs-etm: Validate options after applying them · 35c51f83
      James Clark authored
      
      
      Currently the cs_etm_set_option() function both validates and applies
      the config options. Because it's only called when they are added
      automatically, there are some paths where the user can apply the option
      on the command line and skip the validation. By moving it to the end it
      covers both cases.
      
      Also, options don't need to be re-applied anyway, Perf handles parsing
      and applying the config terms automatically.
      
      Signed-off-by: default avatarJames Clark <james.clark@arm.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Denis Nikitin <denik@google.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Garry <john.g.garry@oracle.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      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: Yang Shi <shy828301@gmail.com>
      Cc: coresight@lists.linaro.org
      Cc: linux-arm-kernel@lists.infradead.org
      Link: https://lore.kernel.org/r/20230424134748.228137-5-james.clark@arm.com
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      35c51f83
    • James Clark's avatar
      perf cs-etm: Don't test full_auxtrace because it's always set · 3963d84b
      James Clark authored
      
      
      There is no path in cs-etm where this isn't true so it doesn't need to
      be tested. Also re-order the beginning of cs_etm_recording_options() so
      that nothing is done until the early exit is passed.
      
      Signed-off-by: default avatarJames Clark <james.clark@arm.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Denis Nikitin <denik@google.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Garry <john.g.garry@oracle.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      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: Yang Shi <shy828301@gmail.com>
      Cc: coresight@lists.linaro.org
      Cc: linux-arm-kernel@lists.infradead.org
      Link: https://lore.kernel.org/r/20230424134748.228137-4-james.clark@arm.com
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      3963d84b
    • James Clark's avatar
      perf tools: Add util function for overriding user set config values · 6593f019
      James Clark authored
      
      
      There is some duplicated code to only override config values if they
      haven't already been set by the user so make a util function for this.
      
      Signed-off-by: default avatarJames Clark <james.clark@arm.com>
      Acked-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Denis Nikitin <denik@google.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Garry <john.g.garry@oracle.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      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: Yang Shi <shy828301@gmail.com>
      Cc: coresight@lists.linaro.org
      Cc: linux-arm-kernel@lists.infradead.org
      Link: https://lore.kernel.org/r/20230424134748.228137-3-james.clark@arm.com
      
      
      [ Moved evsel__set_config_if_unset() to util/pmu.c to avoid dragging stuff into the python binding ]
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      6593f019
    • James Clark's avatar
      perf cs-etm: Fix timeless decode mode detection · 449067f3
      James Clark authored
      In this context, timeless refers to the trace data rather than the perf
      event data. But when detecting whether there are timestamps in the trace
      data or not, the presence of a timestamp flag on any perf event is used.
      
      Since commit f42c0ce5 ("perf record: Always get text_poke events
      with --kcore option") timestamps were added to a tracking event when
      --kcore is used which breaks this detection mechanism. Fix it by
      detecting if trace timestamps exist by looking at the ETM config flags.
      This would have always been a more accurate way of doing it anyway.
      
      This fixes the following error message when using --kcore with
      Coresight:
      
        $ perf record --kcore -e cs_etm// --per-thread
        $ perf report
        The perf.data/data data has no samples!
      
      Fixes: f42c0ce5
      
       ("perf record: Always get text_poke events with --kcore option")
      Reported-by: default avatarYang Shi <shy828301@gmail.com>
      Signed-off-by: default avatarJames Clark <james.clark@arm.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Garry <john.g.garry@oracle.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      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: coresight@lists.linaro.org
      Cc: denik@google.com
      Cc: linux-arm-kernel@lists.infradead.org
      Link: https://lore.kernel.org/lkml/CAHbLzkrJQTrYBtPkf=jf3OpQ-yBcJe7XkvQstX9j2frz4WF-SQ@mail.gmail.com/
      Link: https://lore.kernel.org/r/20230424134748.228137-2-james.clark@arm.com
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      449067f3
    • Arnaldo Carvalho de Melo's avatar
      perf evsel: Introduce evsel__name_is() method to check if the evsel name is equal to a given string · ce1d3bc2
      Arnaldo Carvalho de Melo authored
      
      
      This makes the logic a bit clear by avoiding the !strcmp() pattern and
      also a way to intercept the pointer if we need to do extra validation on
      it or to do lazy setting of evsel->name via evsel__name(evsel).
      
      Reviewed-by: default avatar"Liang, Kan" <kan.liang@linux.intel.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lore.kernel.org/lkml/ZEGLM8VehJbS0gP2@kernel.org
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      ce1d3bc2
  2. Apr 21, 2023
  3. Apr 20, 2023
  4. Apr 19, 2023
  5. Apr 18, 2023
  6. Apr 15, 2023
    • Arnaldo Carvalho de Melo's avatar
      perf test: Simplify for_each_test() to avoid tripping on -Werror=array-bounds · 17354d15
      Arnaldo Carvalho de Melo authored
      
      
      When cross building on debian to the mips 32-bit arch we get these
      warnings:
      
        In function '__cmd_test',
            inlined from 'cmd_test' at tests/builtin-test.c:561:9:
        tests/builtin-test.c:260:66: error: array subscript 1 is outside array bounds of 'struct test_suite *[1]' [-Werror=array-bounds]
          260 |                 for (k = 0, t = tests[j][k]; tests[j][k]; k++, t = tests[j][k])
              |                                                                  ^
        tests/builtin-test.c:369:9: note: in expansion of macro 'for_each_test'
          369 |         for_each_test(j, k, t) {
              |         ^~~~~~~~~~~~~
        tests/builtin-test.c: In function 'cmd_test':
        tests/builtin-test.c:36:27: note: at offset 4 into object 'arch_tests' of size 4
           36 | struct test_suite *__weak arch_tests[] = {
              |                           ^~~~~~~~~~
        cc1: all warnings being treated as errors
      
      Switch to using a while(!sentinel) for the second level of the 'tests'
      array to avoid that compiler complaint.
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      17354d15
  7. Apr 14, 2023