1. 23 Nov, 2022 10 commits
    • Ian Rogers's avatar
      perf list: Reorganize to use callbacks to allow honouring command line options · e5c6109f
      Ian Rogers authored
      Rather than controlling the list output with passed flags, add
      callbacks that are called when an event or metric are
      encountered. State is passed to the callback so that command line
      options can be respected, alternatively the callbacks can be changed.
      
      Fix a few bugs:
       - wordwrap to columns metric descriptions and expressions;
       - remove unnecessary whitespace after PMU event names;
       - the metric filter is a glob but matched using strstr which will
         always fail, switch to using a proper globmatch,
       - the detail flag gives details for extra kernel PMU events like
         branch-instructions.
      
      In metricgroup.c switch from struct mep being a rbtree of metricgroups
      containing a list of metrics, to the tree directly containing all the
      metrics. In general the alias for a name is passed to the print
      routine rather than being contained in the name with OR.
      
      Committer notes:
      
      Check the asprint() return to address this on fedora 36:
      
        util/print-events.c: In function ‘print_sdt_events’:
        util/print-events.c:183:33: error: ignoring return value of ‘asprintf’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result]
          183 |                                 asprintf(&evt_name, "%s@%s(%.12s)", sdt_name->s, path, bid);
              |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        cc1: all warnings being treated as errors
      
        $ gcc --version | head -1
        gcc (GCC) 12.2.1 20220819 (Red Hat 12.2.1-2)
        $
      
      Fix ps.pmu_glob setting when dealing with *:* events, it was being left
      with a freed pointer that then at the end of cmd_list() would be double
      freed.
      
      Check if pmu_name is NULL in default_print_event() before calling
      strglobmatch(pmu_name, ...) to avoid a segfault.
      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: Caleb Biggers <caleb.biggers@intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Perry Taylor <perry.taylor@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Rob Herring <robh@kernel.org>
      Cc: Sandipan Das <sandipan.das@amd.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Weilin Wang <weilin.wang@intel.com>
      Cc: Xin Gao <gaoxin@cdjrlc.com>
      Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
      Link: http://lore.kernel.org/lkml/20221114210723.2749751-10-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e5c6109f
    • Ian Rogers's avatar
      perf build: Fix LIBTRACEEVENT_DYNAMIC · a3720e96
      Ian Rogers authored
      The tools/lib includes fixes break LIBTRACEVENT_DYNAMIC as the makefile
      erroneously had dependencies on building libtraceevent even when not
      linking with it. This change fixes the issues with LIBTRACEEVENT_DYNAMIC
      by making the built files optional.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andrii Nakryiko <andrii.nakryiko@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Masahiro Yamada <masahiroy@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Nicolas Schier <nicolas@fjasle.eu>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: bpf@vger.kernel.org
      Link: http://lore.kernel.org/lkml/20221116224631.207631-1-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      a3720e96
    • Namhyung Kim's avatar
      perf test: Replace data symbol test workload with datasym · 0b77fe47
      Namhyung Kim authored
      So that it can get rid of requirement of a compiler.
      
        $ sudo ./perf test -v 109
        109: Test data symbol                                                :
        --- start ---
        test child forked, pid 844526
        Recording workload...
        [ perf record: Woken up 2 times to write data ]
        [ perf record: Captured and wrote 0.354 MB /tmp/__perf_test.perf.data.GFeZO (4847 samples) ]
        Cleaning up files...
        test child finished with 0
        ---- end ----
        Test data symbol: Ok
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Tested-by: default avatarJames Clark <james.clark@arm.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
      Cc: German Gomez <german.gomez@arm.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Zhengjun Xing <zhengjun.xing@linux.intel.com>
      Link: https://lore.kernel.org/r/20221116233854.1596378-13-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0b77fe47
    • Namhyung Kim's avatar
      perf test: Add 'datasym' test workload · 3dfc01fe
      Namhyung Kim authored
      The datasym workload is to check if perf mem command gets the data
      addresses precisely.  This is needed for data symbol test.
      
        $ perf test -w datasym
      
      I had to keep the buf1 in the data section, otherwise it could end
      up in the BSS and was mmaped as a separate //anon region, then it
      was not symbolized at all.  It needs to be fixed separately.
      
      Committer notes:
      
      Add a -U _FORTIFY_SOURCE to the datasym CFLAGS, as the main perf flags
      set it and it requires building with optimization, and this new test has
      a -O0.
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
      Cc: German Gomez <german.gomez@arm.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Zhengjun Xing <zhengjun.xing@linux.intel.com>
      Link: https://lore.kernel.org/r/20221116233854.1596378-12-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      3dfc01fe
    • Namhyung Kim's avatar
      perf test: Replace brstack test workload · 7bc1dd96
      Namhyung Kim authored
      So that it can get rid of requirement of a compiler.  Also rename the
      symbols to match with the perf test workload.
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Tested-by: default avatarJames Clark <james.clark@arm.com>
      Acked-by: default avatarGerman Gomez <german.gomez@arm.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Zhengjun Xing <zhengjun.xing@linux.intel.com>
      Link: https://lore.kernel.org/r/20221116233854.1596378-11-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      7bc1dd96
    • Namhyung Kim's avatar
      perf test: Add 'brstack' test workload · a104f0ea
      Namhyung Kim authored
      The brstack is to run different kinds of branches repeatedly.  This is
      necessary for brstack test case to verify if it has correct branch info.
      
        $ perf test -w brstack
      
      I renamed the internal functions to have brstack_ prefix as it's too
      generic name.
      
      Add a -U_FORTIFY_SOURCE to the brstack CFLAGS, as the main perf flags
      set it and it requires building with optimization, and this new test has
      a -O0.
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
      Cc: German Gomez <german.gomez@arm.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Zhengjun Xing <zhengjun.xing@linux.intel.com>
      Link: https://lore.kernel.org/r/20221116233854.1596378-10-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      a104f0ea
    • Namhyung Kim's avatar
      perf test: Replace arm spe fork test workload with sqrtloop · e011979e
      Namhyung Kim authored
      So that it can get rid of requirement of a compiler.  I've also removed
      killall as it'll kill perf process now and run the test workload for 10
      sec instead.
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Tested-by: default avatarJames Clark <james.clark@arm.com>
      Tested-by: default avatarLeo Yan <leo.yan@linaro.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
      Cc: German Gomez <german.gomez@arm.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Zhengjun Xing <zhengjun.xing@linux.intel.com>
      Link: https://lore.kernel.org/r/20221116233854.1596378-9-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e011979e
    • Namhyung Kim's avatar
      perf test: Add 'sqrtloop' test workload · 39281709
      Namhyung Kim authored
      The sqrtloop creates a child process to run an infinite loop calling
      sqrt() with rand().  This is needed for ARM SPE fork test.
      
        $ perf test -w sqrtloop
      
      It can take an optional argument to specify how long it will run in
      seconds (default: 1).
      
      Committer notes:
      
      Explicitely ignored the sqrt() return to fix the build on systems where
      the compiler complains it isn't being used.
      
      And added a sqrtloop specific CFLAGS to disable optimizations to make
      this a bit more robust wrt dead code elimination.
      
      Doing that a -U_FORTIFY_SOURCE needs to be added, as -O0 is incompatible
      with it.
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
      Cc: German Gomez <german.gomez@arm.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Zhengjun Xing <zhengjun.xing@linux.intel.com>
      Link: https://lore.kernel.org/r/20221116233854.1596378-8-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      39281709
    • Namhyung Kim's avatar
      perf test: Replace arm callgraph fp test workload with leafloop · 7cf0b4a7
      Namhyung Kim authored
      So that it can get rid of requirement of a compiler.
      Reviewed-by: default avatarLeo Yan <leo.yan@linaro.org>
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Tested-by: default avatarJames Clark <james.clark@arm.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
      Cc: German Gomez <german.gomez@arm.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Zhengjun Xing <zhengjun.xing@linux.intel.com>
      Link: https://lore.kernel.org/r/20221116233854.1596378-7-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      7cf0b4a7
    • Namhyung Kim's avatar
      perf test: Add 'leafloop' test workload · 41522f74
      Namhyung Kim authored
      The leafloop workload is to run an infinite loop in the test_leaf
      function.  This is needed for the ARM fp callgraph test to verify if it
      gets the correct callchains.
      
        $ perf test -w leafloop
      
      Committer notes:
      
      Add a:
      
        -U_FORTIFY_SOURCE
      
      to the leafloop CFLAGS as the main perf flags set it and it requires
      building with optimization, and this new test has a -O0.
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
      Cc: German Gomez <german.gomez@arm.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Zhengjun Xing <zhengjun.xing@linux.intel.com>
      Link: https://lore.kernel.org/r/20221116233854.1596378-6-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      41522f74
  2. 20 Nov, 2022 11 commits
    • Namhyung Kim's avatar
      perf test: Replace record test workload with thloop · 0b8ff0ba
      Namhyung Kim authored
      So that it can get rid of requirements for a compiler.
      
        $ sudo ./perf test -v 92
         92: perf record tests                                               :
        --- start ---
        test child forked, pid 740204
        Basic --per-thread mode test
        Basic --per-thread mode test [Success]
        Register capture test
        Register capture test [Success]
        Basic --system-wide mode test
        Basic --system-wide mode test [Success]
        Basic target workload test
        Basic target workload test [Success]
        test child finished with 0
        ---- end ----
        perf record tests: Ok
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Tested-by: default avatarJames Clark <james.clark@arm.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
      Cc: German Gomez <german.gomez@arm.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Zhengjun Xing <zhengjun.xing@linux.intel.com>
      Link: https://lore.kernel.org/r/20221116233854.1596378-5-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0b8ff0ba
    • Namhyung Kim's avatar
      perf test: Add 'thloop' test workload · 69b35292
      Namhyung Kim authored
      The thloop is similar to noploop but runs in two threads.  This is
      needed to verify perf record --per-thread to handle multi-threaded
      programs properly.
      
        $ perf test -w thloop
      
      It also takes an optional argument to specify runtime in seconds
      (default: 1).
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
      Cc: German Gomez <german.gomez@arm.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Zhengjun Xing <zhengjun.xing@linux.intel.com>
      Link: https://lore.kernel.org/r/20221116233854.1596378-4-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      69b35292
    • Namhyung Kim's avatar
      perf test: Replace pipe test workload with noploop · 24e733b2
      Namhyung Kim authored
      So that it can get rid of requirement of a compiler.
      Also define and use more local symbols to ease future changes.
      
        $ sudo ./perf test -v pipe
         87: perf pipe recording and injection test                          :
        --- start ---
        test child forked, pid 748003
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.000 MB - ]
            748014   748014       -1 |perf
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.000 MB - ]
            99.83%  perf     perf                  [.] noploop
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.000 MB - ]
            99.85%  perf     perf                  [.] noploop
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 0.160 MB /tmp/perf.data.2XYPdw (4007 samples) ]
            99.83%  perf     perf                  [.] noploop
        test child finished with 0
        ---- end ----
        perf pipe recording and injection test: Ok
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Tested-by: default avatarJames Clark <james.clark@arm.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
      Cc: German Gomez <german.gomez@arm.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Zhengjun Xing <zhengjun.xing@linux.intel.com>
      Link: https://lore.kernel.org/r/20221116233854.1596378-3-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      24e733b2
    • Namhyung Kim's avatar
      perf test: Add -w/--workload option · f215054d
      Namhyung Kim authored
      The -w/--workload option is to run a simple workload used by testing.
      This adds a basic framework to run the workloads and 'noploop' workload
      as an example.
      
        $ perf test -w noploop
      
      The noploop does a loop doing nothing (NOP) for a second by default.
      It can have an optional argument to specify the time in seconds.
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
      Cc: German Gomez <german.gomez@arm.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Zhengjun Xing <zhengjun.xing@linux.intel.com>
      Link: https://lore.kernel.org/r/20221116233854.1596378-2-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f215054d
    • Ian Rogers's avatar
      tools lib traceevent: Make install_headers clearer · e664f31e
      Ian Rogers authored
      Add libtraceevent to the name so that this install_headers build
      appears different to similar targets in different libraries. Add ;
      after kbuffer.h install target for consistency.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Andrii Nakryiko <andrii@kernel.org>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: Hao Luo <haoluo@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Fastabend <john.fastabend@gmail.com>
      Cc: KP Singh <kpsingh@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin KaFai Lau <martin.lau@linux.dev>
      Cc: Masahiro Yamada <masahiroy@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nicolas Schier <nicolas@fjasle.eu>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Song Liu <song@kernel.org>
      Cc: Stanislav Fomichev <sdf@google.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Yonghong Song <yhs@fb.com>
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20221117004356.279422-7-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e664f31e
    • Ian Rogers's avatar
      tools lib subcmd: Make install_headers clearer · 77dce689
      Ian Rogers authored
      Add libsubcmd to the name so that this install_headers build appears
      different to similar targets in different libraries.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Andrii Nakryiko <andrii@kernel.org>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: Hao Luo <haoluo@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Fastabend <john.fastabend@gmail.com>
      Cc: KP Singh <kpsingh@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin KaFai Lau <martin.lau@linux.dev>
      Cc: Masahiro Yamada <masahiroy@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nicolas Schier <nicolas@fjasle.eu>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Song Liu <song@kernel.org>
      Cc: Stanislav Fomichev <sdf@google.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Yonghong Song <yhs@fb.com>
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20221117004356.279422-6-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      77dce689
    • Ian Rogers's avatar
      tools lib perf: Make install_headers clearer · e8951bfb
      Ian Rogers authored
      Add libperf to the name so that this install_headers build appears
      different to similar targets in different libraries.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Andrii Nakryiko <andrii@kernel.org>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: Hao Luo <haoluo@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Fastabend <john.fastabend@gmail.com>
      Cc: KP Singh <kpsingh@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin KaFai Lau <martin.lau@linux.dev>
      Cc: Masahiro Yamada <masahiroy@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nicolas Schier <nicolas@fjasle.eu>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Song Liu <song@kernel.org>
      Cc: Stanislav Fomichev <sdf@google.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Yonghong Song <yhs@fb.com>
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20221117004356.279422-5-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e8951bfb
    • Ian Rogers's avatar
      tools lib symbol: Clean up build output · 806dda31
      Ian Rogers authored
      Missing @ when building libsymbol. Make the install echo specific to
      installing the libsymbol headers.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Andrii Nakryiko <andrii@kernel.org>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: Hao Luo <haoluo@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Fastabend <john.fastabend@gmail.com>
      Cc: KP Singh <kpsingh@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin KaFai Lau <martin.lau@linux.dev>
      Cc: Masahiro Yamada <masahiroy@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nicolas Schier <nicolas@fjasle.eu>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Song Liu <song@kernel.org>
      Cc: Stanislav Fomichev <sdf@google.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Yonghong Song <yhs@fb.com>
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20221117004356.279422-4-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      806dda31
    • Ian Rogers's avatar
      tools lib bpf: Avoid install_headers make warning · daa45f3f
      Ian Rogers authored
      The perf build makes the install_headers target, however, as there is
      no action for this target a warning is always produced of:
      
      make[3]: Nothing to be done for 'install_headers'.
      
      Solve this by adding a display of 'INSTALL libbpf_headers'.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Acked-by: default avatarAndrii Nakryiko <andrii@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: Hao Luo <haoluo@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Fastabend <john.fastabend@gmail.com>
      Cc: KP Singh <kpsingh@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin KaFai Lau <martin.lau@linux.dev>
      Cc: Masahiro Yamada <masahiroy@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nicolas Schier <nicolas@fjasle.eu>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Song Liu <song@kernel.org>
      Cc: Stanislav Fomichev <sdf@google.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Yonghong Song <yhs@fb.com>
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20221117004356.279422-3-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      daa45f3f
    • Ian Rogers's avatar
      tools lib api: Clean up install_headers · 586cb1d6
      Ian Rogers authored
      Add missing backslash that caused an install command to always appear
      in build output. Make the install headers more specific.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Andrii Nakryiko <andrii@kernel.org>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: Hao Luo <haoluo@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Fastabend <john.fastabend@gmail.com>
      Cc: KP Singh <kpsingh@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin KaFai Lau <martin.lau@linux.dev>
      Cc: Masahiro Yamada <masahiroy@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nicolas Schier <nicolas@fjasle.eu>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Song Liu <song@kernel.org>
      Cc: Stanislav Fomichev <sdf@google.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Yonghong Song <yhs@fb.com>
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20221117004356.279422-2-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      586cb1d6
    • Arnaldo Carvalho de Melo's avatar
      Merge remote-tracking branch 'torvalds/master' into perf/core · b3c39b1a
      Arnaldo Carvalho de Melo authored
      To pick up fixes and check if libraries used that comes from other trees
      continue to work with tools/perf, such as tools/lib/bpf.
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      b3c39b1a
  3. 19 Nov, 2022 8 commits
  4. 18 Nov, 2022 11 commits
    • Chen Jun's avatar
      Input: i8042 - fix leaking of platform device on module removal · 81cd7e84
      Chen Jun authored
      Avoid resetting the module-wide i8042_platform_device pointer in
      i8042_probe() or i8042_remove(), so that the device can be properly
      destroyed by i8042_exit() on module unload.
      
      Fixes: 9222ba68 ("Input: i8042 - add deferred probe support")
      Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
      Link: https://lore.kernel.org/r/20221109034148.23821-1-chenjun102@huawei.comSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      81cd7e84
    • Linus Torvalds's avatar
      Merge tag 'io_uring-6.1-2022-11-18' of git://git.kernel.dk/linux · a66e4cbf
      Linus Torvalds authored
      Pull io_uring fixes from Jens Axboe:
       "This is mostly fixing issues around the poll rework, but also two
        tweaks for the multishot handling for accept and receive.
      
        All stable material"
      
      * tag 'io_uring-6.1-2022-11-18' of git://git.kernel.dk/linux:
        io_uring: disallow self-propelled ring polling
        io_uring: fix multishot recv request leaks
        io_uring: fix multishot accept request leaks
        io_uring: fix tw losing poll events
        io_uring: update res mask in io_poll_check_events
      a66e4cbf
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · 23a60a03
      Linus Torvalds authored
      Pull arm64 fixes from Catalin Marinas:
      
       - Fix a build error with CONFIG_CFI_CLANG + CONFIG_FTRACE when
         CONFIG_FUNCTION_GRAPH_TRACER is not enabled.
      
       - Fix a BUG_ON triggered by the page table checker due to incorrect
         file_map_count for non-leaf pmd/pud (the arm64
         pmd_user_accessible_page() not checking whether it's a leaf entry).
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64/mm: fix incorrect file_map_count for non-leaf pmd/pud
        arm64: ftrace: Define ftrace_stub_graph only with FUNCTION_GRAPH_TRACER
      23a60a03
    • Linus Torvalds's avatar
      Merge tag 'block-6.1-2022-11-18' of git://git.kernel.dk/linux · f4408c3d
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
      
       - NVMe pull request via Christoph:
            - Two more bogus nid quirks (Bean Huo, Tiago Dias Ferreira)
            - Memory leak fix in nvmet (Sagi Grimberg)
      
       - Regression fix for block cgroups pinning the wrong blkcg, causing
         leaks of cgroups and blkcgs (Chris)
      
       - UAF fix for drbd setup error handling (Dan)
      
       - Fix DMA alignment propagation in DM (Keith)
      
      * tag 'block-6.1-2022-11-18' of git://git.kernel.dk/linux:
        dm-log-writes: set dma_alignment limit in io_hints
        dm-integrity: set dma_alignment limit in io_hints
        block: make blk_set_default_limits() private
        dm-crypt: provide dma_alignment limit in io_hints
        block: make dma_alignment a stacking queue_limit
        nvmet: fix a memory leak in nvmet_auth_set_key
        nvme-pci: add NVME_QUIRK_BOGUS_NID for Netac NV7000
        drbd: use after free in drbd_create_device()
        nvme-pci: add NVME_QUIRK_BOGUS_NID for Micron Nitro
        blk-cgroup: properly pin the parent in blkcg_css_online
      f4408c3d
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2022-11-19' of git://anongit.freedesktop.org/drm/drm · b5bf1d8a
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "I guess the main question is are things settling down, and I'd say
        kinda, these are all pretty small fixes, nothing big stands out
        really, just seems to be quite a few of them.
      
        Mostly amdgpu and core fixes, with some i915, tegra, vc4, panel bits.
      
        core:
         - Fix potential memory leak in drm_dev_init()
         - Fix potential null-ptr-deref in drm_vblank_destroy_worker()
         - Revert hiding unregistered connectors from userspace, as it breaks
           on DP-MST
         - Add workaround for DP++ dual mode adaptors that don't support i2c
           subaddressing
      
        i915:
         - Fix uaf with lmem_userfault_list handling
      
        amdgpu:
         - gang submit fixes
         - Fix a possible memory leak in ganng submit error path
         - DP tunneling fixes
         - DCN 3.1 page flip fix
         - DCN 3.2.x fixes
         - DCN 3.1.4 fixes
         - Don't expose degamma on hardware that doesn't support it
         - BACO fixes for SMU 11.x
         - BACO fixes for SMU 13.x
         - Virtual display fix for devices with no display hardware
      
        amdkfd:
         - Memory limit regression fix
      
        tegra:
         - tegra20 GART fix
      
        vc4:
         - Fix error handling in vc4_atomic_commit_tail()
      
        lima:
         - Set lima's clkname corrrectly when regulator is missing
      
        panel:
         - Set bpc for logictechno panels"
      
      * tag 'drm-fixes-2022-11-19' of git://anongit.freedesktop.org/drm/drm: (28 commits)
        gpu: host1x: Avoid trying to use GART on Tegra20
        drm/display: Don't assume dual mode adaptors support i2c sub-addressing
        drm/amd/pm: fix SMU13 runpm hang due to unintentional workaround
        drm/amd/pm: enable runpm support over BACO for SMU13.0.7
        drm/amd/pm: enable runpm support over BACO for SMU13.0.0
        drm/amdgpu: there is no vbios fb on devices with no display hw (v2)
        drm/amdkfd: Fix a memory limit issue
        drm/amdgpu: disable BACO support on more cards
        drm/amd/display: don't enable DRM CRTC degamma property for DCE
        drm/amd/display: Set max for prefetch lines on dcn32
        drm/amd/display: use uclk pstate latency for fw assisted mclk validation dcn32
        drm/amd/display: Fix prefetch calculations for dcn32
        drm/amd/display: Fix optc2_configure warning on dcn314
        drm/amd/display: Fix calculation for cursor CAB allocation
        Revert "drm: hide unregistered connectors from GETCONNECTOR IOCTL"
        drm/amd/display: Support parsing VRAM info v3.0 from VBIOS
        drm/amd/display: Fix invalid DPIA AUX reply causing system hang
        drm/amdgpu: Add psp_13_0_10_ta firmware to modinfo
        drm/amd/display: Add HUBP surface flip interrupt handler
        drm/amd/display: Fix access timeout to DPIA AUX at boot time
        ...
      b5bf1d8a
    • Linus Torvalds's avatar
      Merge tag 's390-6.1-5' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · ab290ead
      Linus Torvalds authored
      Pull s390 fixes from Alexander Gordeev:
      
       - Fix deadlock in discontiguous saved segments (DCSS) block device
         driver. When adding a disk and scanning partitions the scan would not
         break out early without a missed flag.
      
       - Avoid using global register variable for current_stack_pointer due to
         an old bug in gcc versions prior to gcc-8.4. Due to this bug a broken
         code is generated, which leads to stack corruptions.
      
      * tag 's390-6.1-5' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        s390: avoid using global register for current_stack_pointer
        s390/dcssblk: fix deadlock when adding a DCSS
      ab290ead
    • Linus Torvalds's avatar
      Merge tag 'for-6.1/dm-fixes-2' of... · 5556a78c
      Linus Torvalds authored
      Merge tag 'for-6.1/dm-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm
      
      Pull device mapper fixes from Mike Snitzer:
      
       - Fix misbehavior if list_versions DM ioctl races with module loading
      
       - Fix missing decrement of no_sleep_enabled if dm_bufio_client_create
         failed
      
       - Allow DM integrity devices to be activated in read-only mode
      
      * tag 'for-6.1/dm-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
        dm integrity: clear the journal on suspend
        dm integrity: flush the journal on suspend
        dm bufio: Fix missing decrement of no_sleep_enabled if dm_bufio_client_create failed
        dm ioctl: fix misbehavior if list_versions races with module loading
      5556a78c
    • Dave Airlie's avatar
      Merge tag 'drm/tegra/for-6.1-rc6' of https://gitlab.freedesktop.org/drm/tegra into drm-fixes · b1010b93
      Dave Airlie authored
      drm/tegra: Fixes for v6.1-rc6
      
      This contains a single fix that avoids using the GART on Tegra20 because
      it doesn't work well with the way the Tegra DRM driver tries to use it.
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      
      From: Thierry Reding <thierry.reding@gmail.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20221118121614.3511110-1-thierry.reding@gmail.com
      b1010b93
    • Linus Torvalds's avatar
      Merge tag 'usb-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 950a9f56
      Linus Torvalds authored
      Pull USB driver fixes from Greg KH:
       "Here are a number of USB driver fixes and new device ids for 6.1-rc6.
        Included in here are:
      
         - new usb-serial device ids
      
         - dwc3 driver fixes for reported problems
      
         - cdns3 driver fixes
      
         - new USB device quirks
      
         - typec driver fixes
      
         - extcon USB typec driver fix
      
        All of these have been in linux-next with no reported issues"
      
      * tag 'usb-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        USB: serial: option: add u-blox LARA-L6 modem
        USB: serial: option: add u-blox LARA-R6 00B modem
        USB: serial: option: remove old LARA-R6 PID
        USB: serial: option: add Fibocom FM160 0x0111 composition
        usb: add NO_LPM quirk for Realforce 87U Keyboard
        usb: cdns3: host: fix endless superspeed hub port reset
        usb: chipidea: fix deadlock in ci_otg_del_timer
        usb: dwc3: Do not get extcon device when usb-role-switch is used
        usb: typec: tipd: Prevent uninitialized event{1,2} in IRQ handler
        usb: typec: mux: Enter safe mode only when pins need to be reconfigured
        extcon: usbc-tusb320: Call the Type-C IRQ handler only if a port is registered
        Revert "usb: dwc3: disable USB core PHY management"
        usb: dwc3: gadget: Return -ESHUTDOWN on ep disable
        USB: bcma: Make GPIO explicitly optional
        USB: serial: option: add Sierra Wireless EM9191
      950a9f56
    • Linus Torvalds's avatar
      Merge tag 'staging-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · 12fe29ee
      Linus Torvalds authored
      Pull staging driver fix from Greg KH:
       "Here is a single staging driver fix for 6.1-rc6.
      
        It resolves a bogus signed character test as pointed out, and fixed
        by, Jason in the rtl8192e driver
      
        It has been in linux-next for a few weeks now with no reported
        problems"
      
      * tag 'staging-6.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
        staging: rtl8192e: remove bogus ssid character sign test
      12fe29ee
    • Liu Shixin's avatar
      arm64/mm: fix incorrect file_map_count for non-leaf pmd/pud · 5b47348f
      Liu Shixin authored
      The page table check trigger BUG_ON() unexpectedly when collapse hugepage:
      
       ------------[ cut here ]------------
       kernel BUG at mm/page_table_check.c:82!
       Internal error: Oops - BUG: 00000000f2000800 [#1] SMP
       Dumping ftrace buffer:
          (ftrace buffer empty)
       Modules linked in:
       CPU: 6 PID: 68 Comm: khugepaged Not tainted 6.1.0-rc3+ #750
       Hardware name: linux,dummy-virt (DT)
       pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
       pc : page_table_check_clear.isra.0+0x258/0x3f0
       lr : page_table_check_clear.isra.0+0x240/0x3f0
      [...]
       Call trace:
        page_table_check_clear.isra.0+0x258/0x3f0
        __page_table_check_pmd_clear+0xbc/0x108
        pmdp_collapse_flush+0xb0/0x160
        collapse_huge_page+0xa08/0x1080
        hpage_collapse_scan_pmd+0xf30/0x1590
        khugepaged_scan_mm_slot.constprop.0+0x52c/0xac8
        khugepaged+0x338/0x518
        kthread+0x278/0x2f8
        ret_from_fork+0x10/0x20
      [...]
      
      Since pmd_user_accessible_page() doesn't check if a pmd is leaf, it
      decrease file_map_count for a non-leaf pmd comes from collapse_huge_page().
      and so trigger BUG_ON() unexpectedly.
      
      Fix this problem by using pmd_leaf() insteal of pmd_present() in
      pmd_user_accessible_page(). Moreover, use pud_leaf() for
      pud_user_accessible_page() too.
      
      Fixes: 42b25471 ("arm64/mm: enable ARCH_SUPPORTS_PAGE_TABLE_CHECK")
      Reported-by: default avatarDenys Vlasenko <dvlasenk@redhat.com>
      Signed-off-by: default avatarLiu Shixin <liushixin2@huawei.com>
      Reviewed-by: default avatarDavid Hildenbrand <david@redhat.com>
      Acked-by: default avatarPasha Tatashin <pasha.tatashin@soleen.com>
      Reviewed-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
      Acked-by: default avatarWill Deacon <will@kernel.org>
      Link: https://lore.kernel.org/r/20221117075602.2904324-2-liushixin2@huawei.comSigned-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      5b47348f