1. 29 Aug, 2024 6 commits
    • James Clark's avatar
      perf: cs-etm: Only save valid trace IDs into files · 940007ce
      James Clark authored
      This isn't a bug because Perf always masks with
      CORESIGHT_TRACE_ID_VAL_MASK before using these values, but to avoid it
      looking like it could be, make an effort to not save bad values.
      Reviewed-by: default avatarMike Leach <mike.leach@linaro.org>
      Signed-off-by: default avatarJames Clark <james.clark@arm.com>
      Signed-off-by: default avatarJames Clark <james.clark@linaro.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
      Cc: Anshuman Khandual <anshuman.khandual@arm.com>
      Cc: Ganapatrao Kulkarni <gankulkarni@os.amperecomputing.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: Kan Liang <kan.liang@linux.intel.com>
      Cc: Leo Yan <leo.yan@linux.dev>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
      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>
      Link: https://lore.kernel.org/r/20240722101202.26915-6-james.clark@linaro.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      940007ce
    • James Clark's avatar
      perf: cs-etm: Create decoders based on the trace ID mappings · 19c3e4db
      James Clark authored
      Now that each queue has a unique set of trace ID mappings, use this
      list to create the decoders. In unformatted mode just add a single
      mapping so only one decoder is made.
      
      Previously each queue would have a decoder created for each traced CPU
      on the system but this won't work anymore because CPUs can have
      overlapping trace IDs.
      
      This also means that the CORESIGHT_TRACE_ID_UNUSED_FLAG isn't needed
      any more. If mappings aren't added then decoders aren't created, rather
      than needing a flag to suppress creation.
      Reviewed-by: default avatarMike Leach <mike.leach@linaro.org>
      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: Alexandre Torgue <alexandre.torgue@foss.st.com>
      Cc: Anshuman Khandual <anshuman.khandual@arm.com>
      Cc: Ganapatrao Kulkarni <gankulkarni@os.amperecomputing.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: Kan Liang <kan.liang@linux.intel.com>
      Cc: Leo Yan <leo.yan@linux.dev>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
      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>
      Link: https://lore.kernel.org/r/20240722101202.26915-5-james.clark@linaro.orgSigned-off-by: default avatarJames Clark <james.clark@linaro.org>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      19c3e4db
    • James Clark's avatar
      perf: cs-etm: Move traceid_list to each queue · 77c123f5
      James Clark authored
      The global list won't work for per-sink trace ID allocations, so put a
      list in each queue where the IDs will be unique to that queue.
      
      To keep the same behavior as before, for version 0 of the HW_ID packets,
      copy all the HW_ID mappings into all queues.
      
      This change doesn't effect the decoders, only trace ID lookups on the
      Perf side. The decoders are still created with global mappings which
      will be fixed in a later commit.
      Reviewed-by: default avatarMike Leach <mike.leach@linaro.org>
      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: Alexandre Torgue <alexandre.torgue@foss.st.com>
      Cc: Anshuman Khandual <anshuman.khandual@arm.com>
      Cc: Ganapatrao Kulkarni <gankulkarni@os.amperecomputing.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: Kan Liang <kan.liang@linux.intel.com>
      Cc: Leo Yan <leo.yan@linux.dev>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
      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>
      Link: https://lore.kernel.org/r/20240722101202.26915-4-james.clark@linaro.orgSigned-off-by: default avatarJames Clark <james.clark@linaro.org>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      77c123f5
    • James Clark's avatar
      perf: cs-etm: Allocate queues for all CPUs · 57880a79
      James Clark authored
      Make cs_etm__setup_queue() setup a queue even if it's empty, and
      pre-allocate queues based on the max CPU that was recorded. In per-CPU
      mode aux queues are indexed based on CPU ID even if all CPUs aren't
      recorded, sparse queue arrays aren't used.
      
      This will allow HW_IDs to be saved even if no aux data was received in
      that queue without having to call cs_etm__setup_queue() from two
      different places.
      Reviewed-by: default avatarMike Leach <mike.leach@linaro.org>
      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: Alexandre Torgue <alexandre.torgue@foss.st.com>
      Cc: Anshuman Khandual <anshuman.khandual@arm.com>
      Cc: Ganapatrao Kulkarni <gankulkarni@os.amperecomputing.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: Kan Liang <kan.liang@linux.intel.com>
      Cc: Leo Yan <leo.yan@linux.dev>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
      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>
      Link: https://lore.kernel.org/r/20240722101202.26915-3-james.clark@linaro.orgSigned-off-by: default avatarJames Clark <james.clark@linaro.org>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      57880a79
    • James Clark's avatar
      perf cs-etm: Create decoders after both AUX and HW_ID search passes · b6aa0de9
      James Clark authored
      Both of these passes gather information about how to create the
      decoders. AUX records determine formatted/unformatted, and the HW_IDs
      determine the traceID/metadata mappings.
      
      Therefore it makes sense to cache the information and wait until both
      passes are over until creating the decoders, rather than creating them
      at the first HW_ID found.
      
      This will allow a simplification of the creation process where
      cs_etm_queue->traceid_list will exclusively used to create the decoders,
      rather than the current two methods depending on whether the trace is
      formatted or not.
      
      Previously the sample CPU from the AUX record was used to initialize
      the decoder CPU, but actually sample CPU == AUX queue index in per-CPU
      mode, so saving the sample CPU isn't required.
      
      Similarly formatted/unformatted was used upfront to create the decoders,
      but now it's cached until later.
      Reviewed-by: default avatarAnshuman Khandual <anshuman.khandual@arm.com>
      Reviewed-by: default avatarMike Leach <mike.leach@linaro.org>
      Signed-off-by: default avatarJames Clark <james.clark@arm.com>
      Signed-off-by: default avatarJames Clark <james.clark@linaro.org>
      Tested-by: default avatarGanapatrao Kulkarni <gankulkarni@os.amperecomputing.com>
      Tested-by: default avatarLeo Yan <leo.yan@arm.com>
      Acked-by: default avatarSuzuki Poulouse <suzuki.poulose@arm.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexandre Torgue <alexandre.torgue@foss.st.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: Kan Liang <kan.liang@linux.intel.com>
      Cc: Leo Yan <leo.yan@linux.dev>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Will Deacon <will@kernel.org>
      Link: https://lore.kernel.org/r/20240722101202.26915-2-james.clark@linaro.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      b6aa0de9
    • Arnaldo Carvalho de Melo's avatar
      Revert "tools build: Remove leftover libcap tests that prevents fast path... · 0fd77ae4
      Arnaldo Carvalho de Melo authored
      Revert "tools build: Remove leftover libcap tests that prevents fast path feature detection from working"
      
      Ian pointed out that the libcap feature test is also used by bpftool, so
      we can't remove it just because perf stopped using it, revert the
      removal of the feature test.
      
      Since both perf and libcap uses the fast path feature detection
      (tools/build/feature/test-all.c), probably the best thing is to keep
      libcap-devel when building perf even it not being used there.
      
      This reverts commit 47b3b643.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0fd77ae4
  2. 28 Aug, 2024 32 commits
  3. 26 Aug, 2024 1 commit
  4. 22 Aug, 2024 1 commit