1. 25 Oct, 2021 1 commit
  2. 20 Oct, 2021 25 commits
    • Adrian Hunter's avatar
      perf tools: Add support for PERF_RECORD_AUX_OUTPUT_HW_ID · 61750473
      Adrian Hunter authored
      The PERF_RECORD_AUX_OUTPUT_HW_ID event provides a way to match AUX output
      data like Intel PT PEBS-via-PT back to the event that it came from, by
      providing a hardware ID that is present in the AUX output.
      Reviewed-by: default avatarAlexander Shishkin <alexander.shishkin@linux.intel.com>
      Reviewed-by: default avatarAndi Kleen <ak@linux.intel.com>
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: x86@kernel.org
      Link: http://lore.kernel.org/lkml/20210907163903.11820-3-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      61750473
    • Andrew Kilroy's avatar
      perf vendor events arm64: Categorise the Neoverse V1 counters · 70ae034d
      Andrew Kilroy authored
      This is so they are categorised in the perf list output.  The pmus all
      exist in the armv8-common-and-microarch.json and arm-recommended.json
      files, so this commit places them into each category's own file under
      
        tools/perf/pmu-events/arch/arm64/arm/neoverse-v1
      
      Also add the Neoverse V1 to the arm64 mapfile
      Reviewed-by: default avatarJohn Garry <john.garry@huawei.com>
      Signed-off-by: default avatarAndrew Kilroy <andrew.kilroy@arm.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      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: Will Deacon <will@kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: https://lore.kernel.org/r/20211006081106.8649-3-andrew.kilroy@arm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      70ae034d
    • Andrew Kilroy's avatar
      perf vendor events arm64: Add new armv8 pmu events · e166fc32
      Andrew Kilroy authored
      Add new armv8 common events for use by Arm Neoverse V1 cores in a later
      commit. These are defined in the ArmV8 architecture reference manual
      available from
      
        https://developer.arm.com/documentation/ddi0487/gb/?lang=enReviewed-by: default avatarJohn Garry <john.garry@huawei.com>
      Signed-off-by: default avatarAndrew Kilroy <andrew.kilroy@arm.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      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: Will Deacon <will@kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: https://lore.kernel.org/r/20211006081106.8649-2-andrew.kilroy@arm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e166fc32
    • Andrew Kilroy's avatar
      perf vendor events: Syntax corrections in Neoverse N1 json · 25bc4793
      Andrew Kilroy authored
      There are some syntactical mistakes in the json files for the Cortex A76
      N1 (Neoverse N1).  This was obstructing parsing from an external tool.
      
      This patch fixes the erroneous placement of commas causing the problems.
      Reviewed-by: default avatarJohn Garry <john.garry@huawei.com>
      Signed-off-by: default avatarAndrew Kilroy <andrew.kilroy@arm.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      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: Will Deacon <will@kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: https://lore.kernel.org/r/20211006081106.8649-1-andrew.kilroy@arm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      25bc4793
    • Ian Rogers's avatar
      perf metric: Allow modifiers on metrics · b85a4d61
      Ian Rogers authored
      By allowing modifiers on metrics we can, for example, gather the
      same metric for kernel and user mode. On a SkylakeX with
      TopDownL1 this gives:
      
        $ perf stat -M TopDownL1:u,TopDownL1:k -a sleep 2
      
         Performance counter stats for 'system wide':
      
               849,855,577    uops_issued.any:k         #     0.06 Bad_Speculation:k
                                                        #     0.51 Backend_Bound:k          (16.71%)
             1,995,257,996    cycles:k
                                                        # 7981031984.00 SLOTS:k
                                                        #     0.35 Frontend_Bound:k
                                                        #     0.08 Retiring:k               (16.71%)
             2,791,940,753    idq_uops_not_delivered.core:k                                 (16.71%)
               641,961,928    uops_retired.retire_slots:k                                   (16.71%)
                72,239,337    int_misc.recovery_cycles:k                                    (16.71%)
             2,294,413,647    uops_issued.any:u         #     0.04 Bad_Speculation:u
                                                        #     0.39 Backend_Bound:u          (16.78%)
             1,333,248,940    cycles:u
                                                        # 5332995760.00 SLOTS:u
                                                        #     0.16 Frontend_Bound:u
                                                        #     0.40 Retiring:u               (16.78%)
               858,517,081    idq_uops_not_delivered.core:u                                 (16.78%)
             2,153,789,582    uops_retired.retire_slots:u                                   (16.78%)
                19,373,627    int_misc.recovery_cycles:u                                    (16.78%)
                31,503,661    cpu_clk_unhalted.one_thread_active:k #     0.18 CoreIPC_SMT:k (16.73%)
               315,454,104    inst_retired.any:k        # 315454104.00 Instructions:k       (16.73%)
                42,533,729    cpu_clk_unhalted.ref_xclk:k                                   (16.73%)
             2,043,119,037    cpu_clk_unhalted.thread:k                                     (16.73%)
                28,843,803    cpu_clk_unhalted.one_thread_active:u #     1.55 CoreIPC_SMT:u (16.60%)
             2,153,353,869    inst_retired.any:u        # 2153353869.00 Instructions:u      (16.60%)
                28,844,743    cpu_clk_unhalted.ref_xclk:u                                   (16.60%)
             1,387,544,378    cpu_clk_unhalted.thread:u                                     (16.60%)
               308,031,603    inst_retired.any:k        #     0.15 CoreIPC:k                (33.19%)
             2,036,774,753    cycles:k                                                      (33.19%)
             1,994,344,281    inst_retired.any:u        #     1.59 CoreIPC:u                (33.18%)
             1,251,538,227    cycles:u                                                      (33.18%)
      
               2.000342948 seconds time elapsed
      
      Modifiers are naively copy and pasted on to events, this can yield errors like:
      
        $ perf stat -M Kernel_Utilization:k -a sleep 2
        event syntax error: '..d.thread:k/kk,cpu_clk_unhalted.thread/metric-id=cpu_clk_unhalted.thread/k..'
                                          \___ Bad modifier
      
         Usage: perf stat [<options>] [<command>]
      
            -M, --metrics <metric/metric group list>
                                  monitor specified metrics or metric groups (separated by ,)
      
      When modifiers are present with constraints, from --metric-no-group or
      the NMI watchdog, they are no longer placed in the same set - which may
      miss deduplicating events.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarAndi Kleen <ak@linux.intel.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Antonov <alexander.antonov@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andrew Kilroy <andrew.kilroy@arm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Changbin Du <changbin.du@intel.com>
      Cc: Denys Zagorui <dzagorui@cisco.com>
      Cc: Fabian Hemmer <copy@copy.sh>
      Cc: Felix Fietkau <nbd@nbd.name>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jacob Keller <jacob.e.keller@intel.com>
      Cc: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Joakim Zhang <qiangqing.zhang@nxp.com>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Kees Kook <keescook@chromium.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nicholas Fraser <nfraser@codeweavers.com>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Paul Clarke <pc@us.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Sami Tolvanen <samitolvanen@google.com>
      Cc: ShihCheng Tu <mrtoastcheng@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Wan Jiabing <wanjiabing@vivo.com>
      Cc: Zhen Lei <thunder.leizhen@huawei.com>
      Link: https://lore.kernel.org/r/20211015172132.1162559-22-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      b85a4d61
    • Ian Rogers's avatar
      perf parse-events: Identify broken modifiers · eabd4523
      Ian Rogers authored
      Previously the broken modifier causes a usage message to printed but
      nothing else.
      
      After:
      
        $ perf stat -e 'cycles:kk' -a sleep 2
        event syntax error: 'cycles:kk'
                                    \___ Bad modifier
        Run 'perf list' for a list of valid events
      
         Usage: perf stat [<options>] [<command>]
      
            -e, --event <event>   event selector. use 'perf list' to list available events
      
        $ perf stat -e '{instructions,cycles}:kk' -a sleep 2
        event syntax error: '..ns,cycles}:kk'
                                          \___ Bad modifier
        Run 'perf list' for a list of valid events
      
         Usage: perf stat [<options>] [<command>]
      
            -e, --event <event>   event selector. use 'perf list' to list available events
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarAndi Kleen <ak@linux.intel.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Antonov <alexander.antonov@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andrew Kilroy <andrew.kilroy@arm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Changbin Du <changbin.du@intel.com>
      Cc: Denys Zagorui <dzagorui@cisco.com>
      Cc: Fabian Hemmer <copy@copy.sh>
      Cc: Felix Fietkau <nbd@nbd.name>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jacob Keller <jacob.e.keller@intel.com>
      Cc: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Joakim Zhang <qiangqing.zhang@nxp.com>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Kees Kook <keescook@chromium.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nicholas Fraser <nfraser@codeweavers.com>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Paul Clarke <pc@us.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Sami Tolvanen <samitolvanen@google.com>
      Cc: ShihCheng Tu <mrtoastcheng@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Wan Jiabing <wanjiabing@vivo.com>
      Cc: Zhen Lei <thunder.leizhen@huawei.com>
      Link: https://lore.kernel.org/r/20211015172132.1162559-21-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      eabd4523
    • Ian Rogers's avatar
      perf metric: Switch fprintf() to pr_err() · e068c256
      Ian Rogers authored
      There's no clear reason for the inconsistency that stems from the
      initial commit.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarAndi Kleen <ak@linux.intel.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Antonov <alexander.antonov@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andrew Kilroy <andrew.kilroy@arm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Changbin Du <changbin.du@intel.com>
      Cc: Denys Zagorui <dzagorui@cisco.com>
      Cc: Fabian Hemmer <copy@copy.sh>
      Cc: Felix Fietkau <nbd@nbd.name>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jacob Keller <jacob.e.keller@intel.com>
      Cc: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Joakim Zhang <qiangqing.zhang@nxp.com>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Kees Kook <keescook@chromium.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nicholas Fraser <nfraser@codeweavers.com>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Paul Clarke <pc@us.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Sami Tolvanen <samitolvanen@google.com>
      Cc: ShihCheng Tu <mrtoastcheng@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Wan Jiabing <wanjiabing@vivo.com>
      Cc: Zhen Lei <thunder.leizhen@huawei.com>
      Link: https://lore.kernel.org/r/20211015172132.1162559-20-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e068c256
    • Ian Rogers's avatar
      perf metrics: Modify setup and deduplication · 5ecd5a0c
      Ian Rogers authored
      Previously find_evsel_group was trying to share events while
      mark-sweeping to eliminate unused events, this was complicated and had
      issues around uncore events and grouped sharing.
      
      This was further complicated by the event string being created while
      metrics and metric groups were being added, with the string affecting
      the evlist order.
      
      This change moves deduplication before event parsing.  Ungrouped events
      are placed in a single combined set. Groups are checked to see if an
      earlier (larger) group can support their events.
      
      As the deduplication and sharing detection is done on metric IDs before
      parsing, wildcard expansion problems with uncore events are avoided.
      
      Overall the code is simpler while working better.
      
      An example of failing to deduplicate can be seen with a list of metrics
      like the following, where in the after case multiplexing has been
      avoided:
      
      Before:
      
        $ perf stat -M Bad_Speculation,Backend_Bound,Frontend_Bound,Retiring -a sleep 2
      
         Performance counter stats for 'system wide':
      
               959,620,872      uops_issued.any           #     0.06 Bad_Speculation    (50.03%)
             2,163,072,261      cycles
                                                          #     0.09 Retiring           (50.03%)
               735,827,436      uops_retired.retire_slots                               (50.03%)
                74,676,484      int_misc.recovery_cycles                                (50.03%)
               987,062,794      uops_issued.any           #     0.50 Backend_Bound      (49.97%)
             2,203,734,187      cycles
                                                          #     0.35 Frontend_Bound     (49.97%)
             3,085,016,091      idq_uops_not_delivered.core                             (49.97%)
               758,599,232      uops_retired.retire_slots                               (49.97%)
                75,807,526      int_misc.recovery_cycles                                (49.97%)
      
               2.002103760 seconds time elapsed
      
      After:
      
        $ sudo perf stat -M Bad_Speculation,Backend_Bound,Frontend_Bound,Retiring -a sleep 2
      
         Performance counter stats for 'system wide':
      
               769,694,676      uops_issued.any           #     0.08 Bad_Speculation
                                                          #     0.41 Backend_Bound
             1,087,548,633      cycles
                                                          #     0.38 Frontend_Bound
                                                          #     0.14 Retiring
             1,642,085,777      idq_uops_not_delivered.core
               603,112,590      uops_retired.retire_slots
                43,787,854      int_misc.recovery_cycles
      
               2.003844383 seconds time elapsed
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarAndi Kleen <ak@linux.intel.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Antonov <alexander.antonov@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andrew Kilroy <andrew.kilroy@arm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Changbin Du <changbin.du@intel.com>
      Cc: Denys Zagorui <dzagorui@cisco.com>
      Cc: Fabian Hemmer <copy@copy.sh>
      Cc: Felix Fietkau <nbd@nbd.name>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jacob Keller <jacob.e.keller@intel.com>
      Cc: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Joakim Zhang <qiangqing.zhang@nxp.com>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Kees Kook <keescook@chromium.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nicholas Fraser <nfraser@codeweavers.com>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Paul Clarke <pc@us.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Sami Tolvanen <samitolvanen@google.com>
      Cc: ShihCheng Tu <mrtoastcheng@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Wan Jiabing <wanjiabing@vivo.com>
      Cc: Zhen Lei <thunder.leizhen@huawei.com>
      Link: https://lore.kernel.org/r/20211015172132.1162559-19-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      5ecd5a0c
    • Ian Rogers's avatar
      perf expr: Add subset_of_ids() utility · 798c3f4a
      Ian Rogers authored
      Add a helper that returns true if all the IDs in needles are present in
      haystack.
      
      Later this will be used in sharing events between metrics.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarAndi Kleen <ak@linux.intel.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Antonov <alexander.antonov@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andrew Kilroy <andrew.kilroy@arm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Changbin Du <changbin.du@intel.com>
      Cc: Denys Zagorui <dzagorui@cisco.com>
      Cc: Fabian Hemmer <copy@copy.sh>
      Cc: Felix Fietkau <nbd@nbd.name>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jacob Keller <jacob.e.keller@intel.com>
      Cc: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Joakim Zhang <qiangqing.zhang@nxp.com>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Kees Kook <keescook@chromium.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nicholas Fraser <nfraser@codeweavers.com>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Paul Clarke <pc@us.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Sami Tolvanen <samitolvanen@google.com>
      Cc: ShihCheng Tu <mrtoastcheng@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Wan Jiabing <wanjiabing@vivo.com>
      Cc: Zhen Lei <thunder.leizhen@huawei.com>
      Link: https://lore.kernel.org/r/20211015172132.1162559-18-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      798c3f4a
    • Ian Rogers's avatar
      perf metric: Encode and use metric-id as qualifier · ec5c5b3d
      Ian Rogers authored
      For a metric like IPC a group of events like {instructions,cycles}:W
      would be formed.
      
      If the events names were changed in parsing then the metric expression
      parser would fail to find them.
      
      This change makes the event encoding be something like:
      
        {instructions/metric-id=instructions/, cycles/metric-id=cycles/}
      
      and then uses the evsel's stable metric-id value to locate the events.
      
      This fixes the case that an event is restricted to user because of the
      paranoia setting:
      
        $ echo 2 > /proc/sys/kernel/perf_event_paranoid
        $ perf stat -M IPC /bin/true
         Performance counter stats for '/bin/true':
      
                   150,298      inst_retired.any:u        #      0.77 IPC
                   187,095      cpu_clk_unhalted.thread:u
      
               0.002042731 seconds time elapsed
      
               0.000000000 seconds user
               0.002377000 seconds sys
      
      Adding the metric-id as a qualifier has a complication in that
      qualifiers will become embedded in qualifiers.
      
      For example, msr/tsc/ could become msr/tsc,metric-id=msr/tsc// which
      will fail parse-events.
      
      To solve this problem the metric is encoded and decoded for the
      metric-id with !<num> standing in for an encoded value.
      
      Previously ! wasn't parsed.
      
      With this msr/tsc/ becomes msr/tsc,metric-id=msr!3tsc!3/
      
      The metric expression parser is changed so that @ isn't changed to /,
      instead this is done when the ID is encoded for parse events.
      
      metricgroup__add_metric_non_group() and metricgroup__add_metric_weak_group()
      need to inject the metric-id qualifier, so to avoid repetition they are
      merged into a single metricgroup__build_event_string with error codes
      more rigorously checked.
      
      stat-shadow's prepare_metric() uses the metric-id to match the metricgroup
      code.
      
      As "metric-id=..." is added to all events, it is adding during testing
      with the fake PMU.
      
      This complicates pmu_str_check code as PE_PMU_EVENT_FAKE won't match as
      part of a configuration.
      
      The testing fake PMU case is fixed so that if a known qualifier with an
      ! is parsed then it isn't reported as a fake PMU.
      
      This is sufficient to pass all testing but it and the original mechanism
      are somewhat brittle.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarAndi Kleen <ak@linux.intel.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Antonov <alexander.antonov@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andrew Kilroy <andrew.kilroy@arm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Changbin Du <changbin.du@intel.com>
      Cc: Denys Zagorui <dzagorui@cisco.com>
      Cc: Fabian Hemmer <copy@copy.sh>
      Cc: Felix Fietkau <nbd@nbd.name>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jacob Keller <jacob.e.keller@intel.com>
      Cc: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Joakim Zhang <qiangqing.zhang@nxp.com>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Kees Kook <keescook@chromium.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nicholas Fraser <nfraser@codeweavers.com>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Paul Clarke <pc@us.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Sami Tolvanen <samitolvanen@google.com>
      Cc: ShihCheng Tu <mrtoastcheng@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Wan Jiabing <wanjiabing@vivo.com>
      Cc: Zhen Lei <thunder.leizhen@huawei.com>
      Link: https://lore.kernel.org/r/20211015172132.1162559-17-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      ec5c5b3d
    • Ian Rogers's avatar
      perf parse-events: Allow config on kernel PMU events · fb081153
      Ian Rogers authored
      An event like inst_retired.any on an Intel skylake is found in the
      pmu-events code created from the pipeline event JSON.
      
      The event is an alias for cpu/event=0xc0,period=2000003/ and
      parse-events recognizes the event with the token PE_KERNEL_PMU_EVENT.
      
      The parser doesn't currently allow extra configuration on such events,
      except for modifiers, so:
      
        $ perf stat -e inst_retired.any// /bin/true
        event syntax error: 'inst_retired.any//'
                             \___ parser error
        Run 'perf list' for a list of valid events
      
         Usage: perf stat [<options>] [<command>]
      
            -e, --event <event>   event selector. use 'perf list' to list available events
      
      This patch adds configuration to these events which can be useful for a
      number of parameters like name and call-graph:
      
        $ sudo perf record -e inst_retired.any/call-graph=lbr/ -a sleep 1
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 1.856 MB perf.data (44 samples) ]
      
      It is necessary for the metric code so that we may add metric-id values
      to these events before they are parsed.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarAndi Kleen <ak@linux.intel.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Antonov <alexander.antonov@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andrew Kilroy <andrew.kilroy@arm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Changbin Du <changbin.du@intel.com>
      Cc: Denys Zagorui <dzagorui@cisco.com>
      Cc: Fabian Hemmer <copy@copy.sh>
      Cc: Felix Fietkau <nbd@nbd.name>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jacob Keller <jacob.e.keller@intel.com>
      Cc: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Joakim Zhang <qiangqing.zhang@nxp.com>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Kees Kook <keescook@chromium.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nicholas Fraser <nfraser@codeweavers.com>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Paul Clarke <pc@us.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Sami Tolvanen <samitolvanen@google.com>
      Cc: ShihCheng Tu <mrtoastcheng@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Wan Jiabing <wanjiabing@vivo.com>
      Cc: Zhen Lei <thunder.leizhen@huawei.com>
      Link: https://lore.kernel.org/r/20211015172132.1162559-16-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      fb081153
    • Ian Rogers's avatar
      perf parse-events: Add new "metric-id" term · 2b62b3a6
      Ian Rogers authored
      Add a new "metric-id" term to events so that metric parsing can set an
      ID that can be reliably looked up.
      
      Metric parsing currently will turn a metric like "instructions/cycles"
      into a parse events string of "{instructions,cycles}:W".
      
      However, parse-events may change "instructions" into "instructions:u" if
      perf_event_paranoid=2.
      
      When this happens expr__resolve_id currently fails as stat-shadow adds
      the ID "instructions:u" to match with the counter value and the metric
      tries to look up the ID just "instructions".
      
      A later patch will use the new term.
      
      An example of the current problem:
      
        $ echo -1 > /proc/sys/kernel/perf_event_paranoid
        $ perf stat -M IPC /bin/true
         Performance counter stats for '/bin/true':
      
                 1,217,161      inst_retired.any          #     0.97 IPC
                 1,250,389      cpu_clk_unhalted.thread
      
               0.002064773 seconds time elapsed
      
               0.002378000 seconds user
               0.000000000 seconds sys
      
        $ echo 2 > /proc/sys/kernel/perf_event_paranoid
        $ perf stat -M IPC /bin/true
         Performance counter stats for '/bin/true':
      
                   150,298      inst_retired.any:u        #      nan IPC
                   187,095      cpu_clk_unhalted.thread:u
      
               0.002042731 seconds time elapsed
      
               0.000000000 seconds user
               0.002377000 seconds sys
      
      Note: nan IPC is printed as an effect of "perf metric: Use NAN for
      missing event IDs." but earlier versions of perf just fail with a parse
      error and display no value.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarAndi Kleen <ak@linux.intel.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Antonov <alexander.antonov@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andrew Kilroy <andrew.kilroy@arm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Changbin Du <changbin.du@intel.com>
      Cc: Denys Zagorui <dzagorui@cisco.com>
      Cc: Fabian Hemmer <copy@copy.sh>
      Cc: Felix Fietkau <nbd@nbd.name>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jacob Keller <jacob.e.keller@intel.com>
      Cc: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Joakim Zhang <qiangqing.zhang@nxp.com>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Kees Kook <keescook@chromium.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nicholas Fraser <nfraser@codeweavers.com>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Paul Clarke <pc@us.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Sami Tolvanen <samitolvanen@google.com>
      Cc: ShihCheng Tu <mrtoastcheng@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Wan Jiabing <wanjiabing@vivo.com>
      Cc: Zhen Lei <thunder.leizhen@huawei.com>
      Link: https://lore.kernel.org/r/20211015172132.1162559-15-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      2b62b3a6
    • Ian Rogers's avatar
      perf parse-events: Add const to evsel name · 8e8bbfb3
      Ian Rogers authored
      The evsel name is strdup-ed before assignment and so can be const.
      
      A later change will add another similar string.
      
      Using const makes it clearer that these are not out arguments.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarAndi Kleen <ak@linux.intel.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Antonov <alexander.antonov@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andrew Kilroy <andrew.kilroy@arm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Changbin Du <changbin.du@intel.com>
      Cc: Denys Zagorui <dzagorui@cisco.com>
      Cc: Fabian Hemmer <copy@copy.sh>
      Cc: Felix Fietkau <nbd@nbd.name>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jacob Keller <jacob.e.keller@intel.com>
      Cc: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Joakim Zhang <qiangqing.zhang@nxp.com>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Kees Kook <keescook@chromium.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nicholas Fraser <nfraser@codeweavers.com>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Paul Clarke <pc@us.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Sami Tolvanen <samitolvanen@google.com>
      Cc: ShihCheng Tu <mrtoastcheng@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Wan Jiabing <wanjiabing@vivo.com>
      Cc: Zhen Lei <thunder.leizhen@huawei.com>
      Link: https://lore.kernel.org/r/20211015172132.1162559-14-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      8e8bbfb3
    • Ian Rogers's avatar
      perf metric: Simplify metric_refs calculation · 46bdc0bf
      Ian Rogers authored
      Don't build a list and then turn to an array, just directly build the
      array.
      
      The size of the array is known due to the search for a duplicate.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarAndi Kleen <ak@linux.intel.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Antonov <alexander.antonov@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andrew Kilroy <andrew.kilroy@arm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Changbin Du <changbin.du@intel.com>
      Cc: Denys Zagorui <dzagorui@cisco.com>
      Cc: Fabian Hemmer <copy@copy.sh>
      Cc: Felix Fietkau <nbd@nbd.name>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jacob Keller <jacob.e.keller@intel.com>
      Cc: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Joakim Zhang <qiangqing.zhang@nxp.com>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Kees Kook <keescook@chromium.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nicholas Fraser <nfraser@codeweavers.com>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Paul Clarke <pc@us.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Sami Tolvanen <samitolvanen@google.com>
      Cc: ShihCheng Tu <mrtoastcheng@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Wan Jiabing <wanjiabing@vivo.com>
      Cc: Zhen Lei <thunder.leizhen@huawei.com>
      Link: https://lore.kernel.org/r/20211015172132.1162559-13-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      46bdc0bf
    • Ian Rogers's avatar
      perf metric: Document the internal 'struct metric' · 485fcaed
      Ian Rogers authored
      Add documentation as part of code tidying.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarAndi Kleen <ak@linux.intel.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Antonov <alexander.antonov@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andrew Kilroy <andrew.kilroy@arm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Changbin Du <changbin.du@intel.com>
      Cc: Denys Zagorui <dzagorui@cisco.com>
      Cc: Fabian Hemmer <copy@copy.sh>
      Cc: Felix Fietkau <nbd@nbd.name>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jacob Keller <jacob.e.keller@intel.com>
      Cc: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Joakim Zhang <qiangqing.zhang@nxp.com>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Kees Kook <keescook@chromium.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nicholas Fraser <nfraser@codeweavers.com>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Paul Clarke <pc@us.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Sami Tolvanen <samitolvanen@google.com>
      Cc: ShihCheng Tu <mrtoastcheng@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Wan Jiabing <wanjiabing@vivo.com>
      Cc: Zhen Lei <thunder.leizhen@huawei.com>
      Link: https://lore.kernel.org/r/20211015172132.1162559-12-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      485fcaed
    • Ian Rogers's avatar
      perf metric: Comment data structures · 4d61aef9
      Ian Rogers authored
      Document the data structures maintained by metricgroup.c and used by
      stat-shadow.c for metric output.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarAndi Kleen <ak@linux.intel.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Antonov <alexander.antonov@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andrew Kilroy <andrew.kilroy@arm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Changbin Du <changbin.du@intel.com>
      Cc: Denys Zagorui <dzagorui@cisco.com>
      Cc: Fabian Hemmer <copy@copy.sh>
      Cc: Felix Fietkau <nbd@nbd.name>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jacob Keller <jacob.e.keller@intel.com>
      Cc: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Joakim Zhang <qiangqing.zhang@nxp.com>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Kees Kook <keescook@chromium.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nicholas Fraser <nfraser@codeweavers.com>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Paul Clarke <pc@us.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Sami Tolvanen <samitolvanen@google.com>
      Cc: ShihCheng Tu <mrtoastcheng@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Wan Jiabing <wanjiabing@vivo.com>
      Cc: Zhen Lei <thunder.leizhen@huawei.com>
      Link: https://lore.kernel.org/r/20211015172132.1162559-11-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      4d61aef9
    • Ian Rogers's avatar
      perf metric: Modify resolution and recursion check · 80be6434
      Ian Rogers authored
      Modify resolution. Rather than resolving a list of metrics, resolve a
      metric immediately after it is added.
      
      This simplifies knowing the root of the metric's tree so that IDs may be
      associated with it.
      
      A bug in the current implementation is that all the IDs were placed on
      the first metric in a metric group.
      
      Rather than maintain data on IDs' parents to detect cycles, maintain
      a list of visited metrics and detect cycles if the same metric is
      visited twice.
      
      Only place the root metric onto the list of metrics.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarAndi Kleen <ak@linux.intel.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Antonov <alexander.antonov@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andrew Kilroy <andrew.kilroy@arm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Changbin Du <changbin.du@intel.com>
      Cc: Denys Zagorui <dzagorui@cisco.com>
      Cc: Fabian Hemmer <copy@copy.sh>
      Cc: Felix Fietkau <nbd@nbd.name>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jacob Keller <jacob.e.keller@intel.com>
      Cc: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Joakim Zhang <qiangqing.zhang@nxp.com>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Kees Kook <keescook@chromium.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nicholas Fraser <nfraser@codeweavers.com>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Paul Clarke <pc@us.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Sami Tolvanen <samitolvanen@google.com>
      Cc: ShihCheng Tu <mrtoastcheng@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Wan Jiabing <wanjiabing@vivo.com>
      Cc: Zhen Lei <thunder.leizhen@huawei.com>
      Link: https://lore.kernel.org/r/20211015172132.1162559-10-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      80be6434
    • Ian Rogers's avatar
      perf metric: Only add a referenced metric once · a3de7690
      Ian Rogers authored
      If a metric references other metrics then the same other metrics may be
      referenced more than once, but the events and metric ref are only needed
      once.
      
      An example of this is in tests/parse-metric.c where DCache_L2_Hits
      references the metric DCache_L2_All_Hits twice, once directly and once
      through DCache_L2_All.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarAndi Kleen <ak@linux.intel.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Antonov <alexander.antonov@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andrew Kilroy <andrew.kilroy@arm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Changbin Du <changbin.du@intel.com>
      Cc: Denys Zagorui <dzagorui@cisco.com>
      Cc: Fabian Hemmer <copy@copy.sh>
      Cc: Felix Fietkau <nbd@nbd.name>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jacob Keller <jacob.e.keller@intel.com>
      Cc: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Joakim Zhang <qiangqing.zhang@nxp.com>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Kees Kook <keescook@chromium.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nicholas Fraser <nfraser@codeweavers.com>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Paul Clarke <pc@us.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Sami Tolvanen <samitolvanen@google.com>
      Cc: ShihCheng Tu <mrtoastcheng@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Wan Jiabing <wanjiabing@vivo.com>
      Cc: Zhen Lei <thunder.leizhen@huawei.com>
      Link: https://lore.kernel.org/r/20211015172132.1162559-9-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      a3de7690
    • Ian Rogers's avatar
      perf metric: Add metric new() and free() methods · 3d81d761
      Ian Rogers authored
      Metrics are complex enough that a new/free reduces the risk of memory
      leaks. Move static functions used in new.
      Reviewed-by: default avatarJohn Garry <john.garry@huawei.com>
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarAndi Kleen <ak@linux.intel.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Antonov <alexander.antonov@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andrew Kilroy <andrew.kilroy@arm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Changbin Du <changbin.du@intel.com>
      Cc: Denys Zagorui <dzagorui@cisco.com>
      Cc: Fabian Hemmer <copy@copy.sh>
      Cc: Felix Fietkau <nbd@nbd.name>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jacob Keller <jacob.e.keller@intel.com>
      Cc: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Joakim Zhang <qiangqing.zhang@nxp.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Kees Kook <keescook@chromium.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nicholas Fraser <nfraser@codeweavers.com>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Paul Clarke <pc@us.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Sami Tolvanen <samitolvanen@google.com>
      Cc: ShihCheng Tu <mrtoastcheng@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Wan Jiabing <wanjiabing@vivo.com>
      Cc: Zhen Lei <thunder.leizhen@huawei.com>
      Link: https://lore.kernel.org/r/20211015172132.1162559-8-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      3d81d761
    • Ian Rogers's avatar
      perf metric: Add documentation and rename a variable. · 68074811
      Ian Rogers authored
      Documentation to make current functionality clearer.
      
      Rename a variable called 'metric' to 'metric_name' as it can be
      ambiguous as to whether a string is the name of a metric or the
      expression.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarAndi Kleen <ak@linux.intel.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Antonov <alexander.antonov@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andrew Kilroy <andrew.kilroy@arm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Changbin Du <changbin.du@intel.com>
      Cc: Denys Zagorui <dzagorui@cisco.com>
      Cc: Fabian Hemmer <copy@copy.sh>
      Cc: Felix Fietkau <nbd@nbd.name>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jacob Keller <jacob.e.keller@intel.com>
      Cc: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Joakim Zhang <qiangqing.zhang@nxp.com>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Kees Kook <keescook@chromium.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nicholas Fraser <nfraser@codeweavers.com>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Paul Clarke <pc@us.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Sami Tolvanen <samitolvanen@google.com>
      Cc: ShihCheng Tu <mrtoastcheng@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Wan Jiabing <wanjiabing@vivo.com>
      Cc: Zhen Lei <thunder.leizhen@huawei.com>
      Link: https://lore.kernel.org/r/20211015172132.1162559-7-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      68074811
    • Ian Rogers's avatar
      perf metric: Move runtime value to the expr context · fa831fbb
      Ian Rogers authored
      The runtime value is needed when recursively parsing metrics, currently
      a value of 1 is passed which is incorrect.
      
      Rather than add more arguments to the bison parser, add runtime to the
      context.
      
      Fix call sites not to pass a value. The runtime value is defaulted to 0,
      which is arbitrary. In some places this replaces a value of 1, which was
      also arbitrary.
      
      This shouldn't affect anything other than PPC.
      
      The use of 0 or 1 shouldn't matter as a proper runtime value would be
      needed in a case that it did matter.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarAndi Kleen <ak@linux.intel.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Antonov <alexander.antonov@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andrew Kilroy <andrew.kilroy@arm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Changbin Du <changbin.du@intel.com>
      Cc: Denys Zagorui <dzagorui@cisco.com>
      Cc: Fabian Hemmer <copy@copy.sh>
      Cc: Felix Fietkau <nbd@nbd.name>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jacob Keller <jacob.e.keller@intel.com>
      Cc: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Joakim Zhang <qiangqing.zhang@nxp.com>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Kees Kook <keescook@chromium.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nicholas Fraser <nfraser@codeweavers.com>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Paul Clarke <pc@us.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Sami Tolvanen <samitolvanen@google.com>
      Cc: ShihCheng Tu <mrtoastcheng@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Wan Jiabing <wanjiabing@vivo.com>
      Cc: Zhen Lei <thunder.leizhen@huawei.com>
      Link: https://lore.kernel.org/r/20211015172132.1162559-6-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      fa831fbb
    • Ian Rogers's avatar
      perf pmu: Make pmu_event tables const. · 47f572aa
      Ian Rogers authored
      Make lookup nature of data structures clearer through their type. Reduce
      scope of architecture specific pmu_event tables by making them static.
      Suggested-by: default avatarJohn Garry <john.garry@huawei.com>
      Reviewed-by: default avatarJohn Garry <john.garry@huawei.com>
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarAndi Kleen <ak@linux.intel.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Antonov <alexander.antonov@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andrew Kilroy <andrew.kilroy@arm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Changbin Du <changbin.du@intel.com>
      Cc: Denys Zagorui <dzagorui@cisco.com>
      Cc: Fabian Hemmer <copy@copy.sh>
      Cc: Felix Fietkau <nbd@nbd.name>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jacob Keller <jacob.e.keller@intel.com>
      Cc: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Joakim Zhang <qiangqing.zhang@nxp.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Kees Kook <keescook@chromium.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nicholas Fraser <nfraser@codeweavers.com>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Paul Clarke <pc@us.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Sami Tolvanen <samitolvanen@google.com>
      Cc: ShihCheng Tu <mrtoastcheng@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Wan Jiabing <wanjiabing@vivo.com>
      Cc: Zhen Lei <thunder.leizhen@huawei.com>
      Link: https://lore.kernel.org/r/20211015172132.1162559-5-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      47f572aa
    • Ian Rogers's avatar
      perf pmu: Make pmu_sys_event_tables const. · 857974a6
      Ian Rogers authored
      Make lookup nature of data structures clearer through their type.
      Reviewed-by: default avatarJohn Garry <john.garry@huawei.com>
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarAndi Kleen <ak@linux.intel.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Antonov <alexander.antonov@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andrew Kilroy <andrew.kilroy@arm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Changbin Du <changbin.du@intel.com>
      Cc: Denys Zagorui <dzagorui@cisco.com>
      Cc: Fabian Hemmer <copy@copy.sh>
      Cc: Felix Fietkau <nbd@nbd.name>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jacob Keller <jacob.e.keller@intel.com>
      Cc: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Joakim Zhang <qiangqing.zhang@nxp.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Kees Kook <keescook@chromium.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nicholas Fraser <nfraser@codeweavers.com>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Paul Clarke <pc@us.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Sami Tolvanen <samitolvanen@google.com>
      Cc: ShihCheng Tu <mrtoastcheng@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Wan Jiabing <wanjiabing@vivo.com>
      Cc: Zhen Lei <thunder.leizhen@huawei.com>
      Link: https://lore.kernel.org/r/20211015172132.1162559-4-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      857974a6
    • Ian Rogers's avatar
      perf pmu: Add const to pmu_events_map. · 0ec43c08
      Ian Rogers authored
      The pmu_events_map is generated at compile time and used for lookup. For
      testing purposes we need to swap the map being used.
      
      Having the pmu_events_map be non-const is misleading as it may be an out
      argument.
      
      Make it const and update uses so they work on const too.
      Reviewed-by: default avatarJohn Garry <john.garry@huawei.com>
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarAndi Kleen <ak@linux.intel.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Antonov <alexander.antonov@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andrew Kilroy <andrew.kilroy@arm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Changbin Du <changbin.du@intel.com>
      Cc: Denys Zagorui <dzagorui@cisco.com>
      Cc: Fabian Hemmer <copy@copy.sh>
      Cc: Felix Fietkau <nbd@nbd.name>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jacob Keller <jacob.e.keller@intel.com>
      Cc: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Joakim Zhang <qiangqing.zhang@nxp.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Kees Kook <keescook@chromium.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nicholas Fraser <nfraser@codeweavers.com>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Paul Clarke <pc@us.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Sami Tolvanen <samitolvanen@google.com>
      Cc: ShihCheng Tu <mrtoastcheng@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Wan Jiabing <wanjiabing@vivo.com>
      Cc: Zhen Lei <thunder.leizhen@huawei.com>
      Link: https://lore.kernel.org/r/20211015172132.1162559-3-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0ec43c08
    • Ian Rogers's avatar
      tools lib: Adopt list_sort() from the kernel sources · 92ec3cc9
      Ian Rogers authored
      Add list_sort.[ch] from the main kernel tree. The linux/bug.h #include
      is removed due to conflicting definitions. Add check-headers and modify
      perf build accordingly.
      
      MANIFEST and python-ext-sources fixes suggested by Arnaldo.
      Suggested-by: default avatarArnaldo Carvalho de Melo <acme@kernel.org>
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarAndi Kleen <ak@linux.intel.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Antonov <alexander.antonov@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andrew Kilroy <andrew.kilroy@arm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Changbin Du <changbin.du@intel.com>
      Cc: Denys Zagorui <dzagorui@cisco.com>
      Cc: Fabian Hemmer <copy@copy.sh>
      Cc: Felix Fietkau <nbd@nbd.name>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jacob Keller <jacob.e.keller@intel.com>
      Cc: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Joakim Zhang <qiangqing.zhang@nxp.com>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Kees Kook <keescook@chromium.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nicholas Fraser <nfraser@codeweavers.com>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Paul Clarke <pc@us.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Sami Tolvanen <samitolvanen@google.com>
      Cc: ShihCheng Tu <mrtoastcheng@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Wan Jiabing <wanjiabing@vivo.com>
      Cc: Zhen Lei <thunder.leizhen@huawei.com>
      Link: https://lore.kernel.org/r/20211015172132.1162559-2-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      92ec3cc9
  3. 08 Oct, 2021 9 commits
  4. 07 Oct, 2021 5 commits
    • Linus Torvalds's avatar
      Merge tag 'nfsd-5.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux · 1da38549
      Linus Torvalds authored
      Pull nfsd fixes from Chuck Lever:
       "Bug fixes for NFSD error handling paths"
      
      * tag 'nfsd-5.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux:
        NFSD: Keep existing listeners on portlist error
        SUNRPC: fix sign error causing rpcsec_gss drops
        nfsd: Fix a warning for nfsd_file_close_inode
        nfsd4: Handle the NFSv4 READDIR 'dircount' hint being zero
        nfsd: fix error handling of register_pernet_subsys() in init_nfsd()
      1da38549
    • Linus Torvalds's avatar
      Merge tag 'armsoc-fixes-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc · 3e899c72
      Linus Torvalds authored
      Pull ARM SoC fixes from Arnd Bergmann:
       "This is a larger than normal update for Arm SoC specific code, most of
        it in device trees, but also drivers and the omap and at91/sama7
        platforms:
      
         - There are four new entries to the MAINTAINERS file: Sven Peter and
           Alyssa Rosenzweig for Apple M1, Romain Perier for Mstar/sigmastar,
           and Vignesh Raghavendra for TI K3
      
         - Build fixes to address randconfig warnings in sharpsl, dove, omap1,
           and qcom platforms as well as the scmi and op-tee subsystems
      
         - Regression fixes for missing CONFIG_FB and other options for
           several defconfigs
      
         - Several bug fixes for the newly added Microchip SAMA7 platform,
           mostly regarding power management
      
         - Missing SMP barriers to protect accesses to SCMI virtio device
      
         - Regression fixes for TI OMAP, including a boot-time hang on am335x.
      
         - Lots of bug fixes for NXP i.MX, mostly addressing incorrect
           settings in devicetree files, and one revert for broken suspend.
      
         - Fixes for ARM Juno/Vexpress devicetree files, addressing a couple
           of schema warnings.
      
         - Regression fixes for qualcomm SoC specific drivers and devicetree
           files, reverting an mdt_loader change and at least pastially
           reverting some of the 5.15 DTS changes, plus some minor bugfixes"
      
      * tag 'armsoc-fixes-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (64 commits)
        MAINTAINERS: Add Sven Peter as ARM/APPLE MACHINE maintainer
        MAINTAINERS: Add Alyssa Rosenzweig as M1 reviewer
        firmware: arm_scmi: Add proper barriers to scmi virtio device
        firmware: arm_scmi: Simplify spinlocks in virtio transport
        ARM: dts: omap3430-sdp: Fix NAND device node
        bus: ti-sysc: Use CLKDM_NOAUTO for dra7 dcan1 for errata i893
        ARM: sharpsl_param: work around -Wstringop-overread warning
        ARM: defconfig: gemini: Restore framebuffer
        ARM: dove: mark 'putc' as inline
        ARM: omap1: move omap15xx local bus handling to usb.c
        MAINTAINERS: Add Vignesh to TI K3 platform maintainership
        arm64: dts: imx8m*-venice-gw7902: fix M2_RST# gpio
        ARM: imx6: disable the GIC CPU interface before calling stby-poweroff sequence
        arm64: dts: ls1028a: fix eSDHC2 node
        arm64: dts: imx8mm-kontron-n801x-som: do not allow to switch off buck2
        ARM: dts: at91: sama7g5ek: to not touch slew-rate for SDMMC pins
        ARM: dts: at91: sama7g5ek: use proper slew-rate settings for GMACs
        ARM: at91: pm: preload base address of controllers in tlb
        ARM: at91: pm: group constants and addresses loading
        ARM: dts: at91: sama7g5ek: add suspend voltage for ddr3l rail
        ...
      3e899c72
    • Arnd Bergmann's avatar
      Merge tag 'asahi-soc-fixes-5.15' of https://github.com/AsahiLinux/linux into arm/fixes · 897c2e74
      Arnd Bergmann authored
      Apple SoC fixes for 5.15; just two MAINTAINERS updates.
      
      - MAINTAINERS: Add Sven Peter as ARM/APPLE MACHINE maintainer
      - MAINTAINERS: Add Alyssa Rosenzweig as M1 reviewer
      
      * tag 'asahi-soc-fixes-5.15' of https://github.com/AsahiLinux/linux:
        MAINTAINERS: Add Sven Peter as ARM/APPLE MACHINE maintainer
        MAINTAINERS: Add Alyssa Rosenzweig as M1 reviewer
      
      Link: https://lore.kernel.org/r/a50a9015-0e62-c451-4d0d-668233b35b85@marcan.stSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      897c2e74
    • Arnd Bergmann's avatar
      Merge tag 'scmi-fixes-5.15' of... · 6aaa8434
      Arnd Bergmann authored
      Merge tag 'scmi-fixes-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/fixes
      
      SCMI fixes for v5.15
      
      A few fixes addressing:
      - Kconfig dependency between VIRTIO and ARM_SCMI_PROTOCOL
      - Link-time error with __exit annotation for virtio_scmi_exit
      - Unnecessary nested irqsave/irqrestore spinlocks in virtio transport
      - Missing SMP barriers to protect accesses to SCMI virtio device
      
      * tag 'scmi-fixes-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux:
        firmware: arm_scmi: Add proper barriers to scmi virtio device
        firmware: arm_scmi: Simplify spinlocks in virtio transport
        firmware: arm_scmi: Remove __exit annotation
        firmware: arm_scmi: Fix virtio transport Kconfig dependency
      
      Link: https://lore.kernel.org/r/20211007102822.27886-1-sudeep.holla@arm.comSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      6aaa8434
    • Arnd Bergmann's avatar
      Merge tag 'omap-for-v5.15/fixes-rc4' of... · 3c7f58b3
      Arnd Bergmann authored
      Merge tag 'omap-for-v5.15/fixes-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/fixes
      
      Fixes for omaps for v5.15
      
      Few regression fixes for omaps for the v5.15-rc cycle. There is a fix
      for boot time hangs that can happen on some am335x devices that started
      when the pruss devicetree nodes were added. The other fixes are less
      critical:
      
      - Fix compiler warning for sysc_init_soc() that got recently introduced
      
      - Fix external abort for am335x pruss as otherwise some am335x will hang
      
      - Use CLKDM_NOAUTO quirk also for dra7 dcan1
      
      - Fix older NAND device node regression for omap3-sdp
      
      * tag 'omap-for-v5.15/fixes-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
        ARM: dts: omap3430-sdp: Fix NAND device node
        bus: ti-sysc: Use CLKDM_NOAUTO for dra7 dcan1 for errata i893
        soc: ti: omap-prm: Fix external abort for am335x pruss
        bus: ti-sysc: Add break in switch statement in sysc_init_soc()
      
      Link: https://lore.kernel.org/r/pull-1633609552-789682@atomide.comSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      3c7f58b3