1. 30 Aug, 2024 4 commits
    • Namhyung Kim's avatar
      perf lock contention: Handle error in a single place · 10d6c57c
      Namhyung Kim authored
      It has some duplicate codes to do the same job.  Let's add a label and
      goto there to handle errors in a single place.
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Song Liu <song@kernel.org>
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20240830065150.1758962-1-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      10d6c57c
    • Ian Rogers's avatar
      perf test: Additional pipe tests with pipe output written to a file · ccb90046
      Ian Rogers authored
      Additional pipe tests where piped files are written to disk. This
      means that spotting a file name of "-" isn't a sufficient "is pipe?"
      test.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@linaro.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nick Terrell <terrelln@fb.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Yanteng Si <siyanteng@loongson.cn>
      Cc: Yicong Yang <yangyicong@hisilicon.com>
      Link: https://lore.kernel.org/r/20240829150154.37929-9-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      ccb90046
    • Ian Rogers's avatar
      perf header: Remove repipe option · 2d57c32b
      Ian Rogers authored
      No longer used by `perf inject` the repipe_fd is always -1 and repipe
      is always false. Remove the options and associated code knowing the
      constant values of the removed variables.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@linaro.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nick Terrell <terrelln@fb.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Yanteng Si <siyanteng@loongson.cn>
      Cc: Yicong Yang <yangyicong@hisilicon.com>
      Link: https://lore.kernel.org/r/20240829150154.37929-8-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      2d57c32b
    • Ian Rogers's avatar
      perf inject: Overhaul handling of pipe files · 89d64e72
      Ian Rogers authored
      Previously inject->is_pipe was set if the input or output were a
      pipe. Determining the input was a pipe had to be done prior to
      starting the session and opening the file. This was done by comparing
      the input file name with '-' but it fails if the pipe file is written
      to disk.
      
      Opening a pipe file from disk will correctly set perf_data.is_pipe, but
      this is too late for 'perf inject' and results in a broken file. A
      workaround is 'cat pipe_perf|perf inject -i - ...'.
      
      This change removes inject->is_pipe and changes the dependent
      conditions to use the is_pipe flag on the input
      (inject->session->data) and output files (inject->output). This
      ensures the is_pipe condition reflects things like the header being
      read.
      
      The change removes the use of perf file header repiping, that is
      writing the file header out while reading it in. The case of input
      pipe and output file cannot repipe as the attributes for the file are
      unknown. To resolve this, write the file header when writing to disk
      and as the attributes may be unknown, write them after the data.
      
      Update sessions repipe variable to be trace_event_repipe as those are
      the only events now impacted by it. Update __perf_session__new as the
      repipe_fd no longer needs passing. Fully removing repipe from session
      header reading will be done in a later change.
      
      Committer testing:
      
        root@number:~# perf record -e syscalls:sys_enter_*sleep/max-stack=4/ -o - sleep 0.01 | perf report -i -
        # To display the perf.data header info, please use --header/--header-only options.
        #
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.050 MB - ]
        #
        # Total Lost Samples: 0
        #
        # Samples: 1  of event 'syscalls:sys_enter_clock_nanosleep'
        # Event count (approx.): 1
        #
        # Overhead  Command  Shared Object  Symbol
        # ........  .......  .............  ...............................
        #
           100.00%  sleep    libc.so.6      [.] clock_nanosleep@GLIBC_2.2.5
                    |
                    ---__libc_start_main@@GLIBC_2.34
                       __libc_start_call_main
                       0x562fc2560a9f
                       clock_nanosleep@GLIBC_2.2.5
      
        #
        # (Tip: Create an archive with symtabs to analyse on other machine: perf archive)
        #
        root@number:~# perf record -e syscalls:sys_enter_*sleep/max-stack=4/ -o - sleep 0.01 > pipe.data
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.050 MB - ]
        root@number:~# perf report --stdio -i pipe.data
        # To display the perf.data header info, please use --header/--header-only options.
        #
        #
        # Total Lost Samples: 0
        #
        # Samples: 1  of event 'syscalls:sys_enter_clock_nanosleep'
        # Event count (approx.): 1
        #
        # Overhead  Command  Shared Object  Symbol
        # ........  .......  .............  ...............................
        #
           100.00%  sleep    libc.so.6      [.] clock_nanosleep@GLIBC_2.2.5
                    |
                    ---__libc_start_main@@GLIBC_2.34
                       __libc_start_call_main
                       0x55f775975a9f
                       clock_nanosleep@GLIBC_2.2.5
      
        #
        # (Tip: To set sampling period of individual events use perf record -e cpu/cpu-cycles,period=100001/,cpu/branches,period=10001/ ...)
        #
        root@number:~#
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@linaro.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nick Terrell <terrelln@fb.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Yanteng Si <siyanteng@loongson.cn>
      Cc: Yicong Yang <yangyicong@hisilicon.com>
      Link: https://lore.kernel.org/r/20240829150154.37929-7-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      89d64e72
  2. 29 Aug, 2024 12 commits
    • Ian Rogers's avatar
      perf header: Allow attributes to be written after data · e9a7053d
      Ian Rogers authored
      With a file, to write data an offset needs to be known. Typically data
      follows the event attributes in a file.
      
      However, if processing a pipe the number of event attributes may not be
      known.
      
      It is convenient in that case to write the attributes after the data.
      
      Expand perf_session__do_write_header() to allow this when the data
      offset and size are known.
      
      This approach may be useful for more than just taking a pipe file to
      write into a data file, `perf inject --itrace` will reserve and
      additional 8kb for attributes, which would be unnecessary if the
      attributes were written after the data.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@linaro.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nick Terrell <terrelln@fb.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Yanteng Si <siyanteng@loongson.cn>
      Cc: Yicong Yang <yangyicong@hisilicon.com>
      Link: https://lore.kernel.org/r/20240829150154.37929-6-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e9a7053d
    • Ian Rogers's avatar
      perf header: Fail read if header sections overlap · 10df481f
      Ian Rogers authored
      Buggy perf.data files can have the attributes and data
      overlapping.
      
      For example, when processing pipe data the attributes aren't known and
      so file offset header calculations can consider them not present.
      
      Later this can cause the attributes to overwrite the data. This can be
      seen in:
      
        $ perf record -o - true > a.data
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.059 MB - ]
        $ perf inject -i a.data -o b.data
        $ perf report --stats -i b.data
        0x68 [0]: failed to process type: 510379 [Invalid argument]
        Error:
        failed to process sample
        $
      
      This change makes reading the corrupt file fail:
      
        $ perf report --stats -i b.data
        Perf file header corrupt: Attributes and data overlap
        incompatible file format (rerun with -v to learn more)
        $
      
      Which is more informative.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@linaro.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nick Terrell <terrelln@fb.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Yanteng Si <siyanteng@loongson.cn>
      Cc: Yicong Yang <yangyicong@hisilicon.com>
      Link: https://lore.kernel.org/r/20240829150154.37929-5-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      10df481f
    • Ian Rogers's avatar
      perf header: Add kerneldoc to 'struct perf_file_header' · d71bbe79
      Ian Rogers authored
      Some of the values are a little strange so add documentation to
      resolve ambiguity.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@linaro.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nick Terrell <terrelln@fb.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Yanteng Si <siyanteng@loongson.cn>
      Cc: Yicong Yang <yangyicong@hisilicon.com>
      Link: https://lore.kernel.org/r/20240829150154.37929-4-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      d71bbe79
    • Ian Rogers's avatar
      perf session: Document 'struct perf_session' and constify its 'auxtrace' member · d9c99310
      Ian Rogers authored
      perf_session is a central data structure to the tool so let's comment
      it. The auxtrace callbacks are never modified in session so constify.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@linaro.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nick Terrell <terrelln@fb.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Yanteng Si <siyanteng@loongson.cn>
      Cc: Yicong Yang <yangyicong@hisilicon.com>
      Link: https://lore.kernel.org/r/20240829150154.37929-3-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      d9c99310
    • James Clark's avatar
      perf: cs-etm: Print queue number in raw trace dump · 022aa67b
      James Clark authored
      Now that we have overlapping trace IDs it's also useful to know what the
      queue number is to be able to distinguish the source of the trace so
      print it inline. Hide it behind the -v option because it might not be
      obvious to users what the queue number is.
      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-8-james.clark@linaro.orgSigned-off-by: default avatarJames Clark <james.clark@linaro.org>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      022aa67b
    • James Clark's avatar
      perf: cs-etm: Support version 0.1 of HW_ID packets · 1506af6d
      James Clark authored
      v0.1 HW_ID packets have a new field that describes which sink each CPU
      writes to. Use the sink ID to link trace ID maps to each other so that
      mappings are shared wherever the sink is shared.
      
      Also update the error message to show that overlapping IDs aren't an
      error in per-thread mode, just not supported. In the future we can
      use the CPU ID from the AUX records, or watch for changing sink IDs on
      HW_ID packets to use the correct decoders.
      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-7-james.clark@linaro.orgSigned-off-by: default avatarJames Clark <james.clark@linaro.org>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      1506af6d
    • 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
  3. 28 Aug, 2024 24 commits