1. 04 Oct, 2022 40 commits
    • Namhyung Kim's avatar
      perf record: Read and inject LOST_SAMPLES events · e3a23261
      Namhyung Kim authored
      When there are lost samples, it can read the number of PERF_FORMAT_LOST and
      convert it to PERF_RECORD_LOST_SAMPLES and write to the data file at the end.
      Reviewed-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: https://lore.kernel.org/r/20220901195739.668604-4-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e3a23261
    • Namhyung Kim's avatar
      perf record: Set PERF_FORMAT_LOST by default · e17f343c
      Namhyung Kim authored
      As we want to see the number of lost samples in the perf report, set the
      LOST format when it configs evsel.  On old kernels, it'd fallback to
      disable it.
      Reviewed-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: https://lore.kernel.org/r/20220901195739.668604-3-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e17f343c
    • Namhyung Kim's avatar
      perf tools: Print LOST read format in the verbose mode · a8d68cc4
      Namhyung Kim authored
      So that we can see it with:
      
        $ perf record -vv pwd
        ...
        perf_event_attr:
          size                             128
          { sample_period, sample_freq }   4000
          sample_type                      IP|TID|TIME|PERIOD
          read_format                      ID|LOST
          disabled                         1
          inherit                          1
          exclude_kernel                   1
          freq                             1
          enable_on_exec                   1
          precise_ip                       3
          sample_id_all                    1
          exclude_guest                    1
      Reviewed-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: https://lore.kernel.org/r/20220901195739.668604-2-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      a8d68cc4
    • Ian Rogers's avatar
      perf smt: Tidy header guard add SPDX · 9dcc22ef
      Ian Rogers authored
      Make the header guard consistent with others.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Caleb Biggers <caleb.biggers@intel.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Kshipra Bopardikar <kshipra.bopardikar@intel.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Miaoqian Lin <linmq006@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Perry Taylor <perry.taylor@intel.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Xing Zhengjun <zhengjun.xing@linux.intel.com>
      Cc: florian fischer <florian.fischer@muhq.space>
      Link: http://lore.kernel.org/lkml/20220830164846.401143-2-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      9dcc22ef
    • Anshuman Khandual's avatar
      perf branch: Add PERF_BR_NEW_ARCH_[N] map for BRBE on arm64 platform · fb42f8b7
      Anshuman Khandual authored
      This updates the perf tool with arch specific branch type classification
      used for BRBE on arm64 platform as added in the kernel earlier.
      Signed-off-by: default avatarAnshuman Khandual <anshuman.khandual@arm.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will@kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: https://lore.kernel.org/r/20220824044822.70230-9-anshuman.khandual@arm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      fb42f8b7
    • Anshuman Khandual's avatar
      perf branch: Add branch privilege information request flag · bcb96ce6
      Anshuman Khandual authored
      This updates the perf tools with branch privilege information request flag
      i.e PERF_SAMPLE_BRANCH_PRIV_SAVE that has been added earlier in the kernel.
      This also updates 'perf record' documentation, branch_modes[], and generic
      branch privilege level enumeration as added earlier in the kernel.
      Signed-off-by: default avatarAnshuman Khandual <anshuman.khandual@arm.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will@kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: https://lore.kernel.org/r/20220824044822.70230-8-anshuman.khandual@arm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      bcb96ce6
    • Anshuman Khandual's avatar
      perf branch: Extend branch type classification · 0ddea8e2
      Anshuman Khandual authored
      This updates the perf tool with generic branch type classification with new
      ABI extender place holder i.e PERF_BR_EXTEND_ABI, the new 4 bit branch type
      field i.e perf_branch_entry.new_type, new generic page fault related branch
      types and some arch specific branch types as added earlier in the kernel.
      
      Committer note:
      
      Add an extra entry to the branch_type_name array to cope with
      PERF_BR_EXTEND_ABI, to address build warnings on some compiler/systems,
      like:
      
        75     8.89 ubuntu:20.04-x-powerpc64el    : FAIL gcc version 10.3.0 (Ubuntu 10.3.0-1ubuntu1~20.04)
              inlined from 'branch_type_stat_display' at util/branch.c:152:4:
          /usr/powerpc64le-linux-gnu/include/bits/stdio2.h:100:10: error: '%8s' directive argument is null [-Werror=format-overflow=]
            100 |   return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
                |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            101 |    __va_arg_pack ());
                |    ~~~~~~~~~~~~~~~~~
      Signed-off-by: default avatarAnshuman Khandual <anshuman.khandual@arm.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will@kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: https://lore.kernel.org/r/20220824044822.70230-7-anshuman.khandual@arm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0ddea8e2
    • Anshuman Khandual's avatar
      perf branch: Add system error and not in transaction branch types · 1c96b6e4
      Anshuman Khandual authored
      This updates the perf tool with generic branch type classification with
      two new branch types i.e system error (PERF_BR_SERROR) and not in
      transaction (PERF_BR_NO_TX) which got updated earlier in the kernel.
      
      This also updates corresponding branch type strings in
      branch_type_name().
      
      Committer notes:
      
      At perf tools merge time this is only on PeterZ's tree, at:
      
        git://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git perf/core
      
      So for testing one has to build a kernel with that branch, then test
      the tooling side from:
      
        git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git perf/core
      Reviewed-by: default avatarJames Clark <james.clark@arm.com>
      Signed-off-by: default avatarAnshuman Khandual <anshuman.khandual@arm.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will@kernel.org>
      Cc: linux-arm-kernel@lists.infradead.org
      Link: https://lore.kernel.org/r/20220824044822.70230-6-anshuman.khandual@arm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      1c96b6e4
    • Ian Rogers's avatar
      perf build: Enable -Wthread-safety with clang · dca571ed
      Ian Rogers authored
      If building with clang then enable -Wthread-safety warnings.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Reviewed-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexandre Truong <alexandre.truong@arm.com>
      Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Andres Freund <andres@anarazel.de>
      Cc: Andrii Nakryiko <andrii@kernel.org>
      Cc: André Almeida <andrealmeid@igalia.com>
      Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
      Cc: Colin Ian King <colin.king@intel.com>
      Cc: Dario Petrillo <dario.pk1@gmail.com>
      Cc: Darren Hart <dvhart@infradead.org>
      Cc: Dave Marchevsky <davemarchevsky@fb.com>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      Cc: Fangrui Song <maskray@google.com>
      Cc: Hewenliang <hewenliang4@huawei.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jason Wang <wangborong@cdjrlc.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kim Phillips <kim.phillips@amd.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin Liška <mliska@suse.cz>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Pavithra Gurushankar <gpavithrasha@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Quentin Monnet <quentin@isovalent.com>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Remi Bernon <rbernon@codeweavers.com>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Tom Rix <trix@redhat.com>
      Cc: Weiguo Li <liwg06@foxmail.com>
      Cc: Wenyu Liu <liuwenyu7@huawei.com>
      Cc: William Cohen <wcohen@redhat.com>
      Cc: Zechuan Chen <chenzechuan1@huawei.com>
      Cc: bpf@vger.kernel.org
      Cc: llvm@lists.linux.dev
      Cc: yaowenbin <yaowenbin1@huawei.com>
      Link: https://lore.kernel.org/r/20220826164242.43412-19-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      dca571ed
    • Ian Rogers's avatar
      perf top: Fixes for thread safety analysis · b40b2122
      Ian Rogers authored
      Add annotations to describe lock behavior.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Reviewed-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexandre Truong <alexandre.truong@arm.com>
      Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Andres Freund <andres@anarazel.de>
      Cc: Andrii Nakryiko <andrii@kernel.org>
      Cc: André Almeida <andrealmeid@igalia.com>
      Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
      Cc: Colin Ian King <colin.king@intel.com>
      Cc: Dario Petrillo <dario.pk1@gmail.com>
      Cc: Darren Hart <dvhart@infradead.org>
      Cc: Dave Marchevsky <davemarchevsky@fb.com>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      Cc: Fangrui Song <maskray@google.com>
      Cc: Hewenliang <hewenliang4@huawei.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jason Wang <wangborong@cdjrlc.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kim Phillips <kim.phillips@amd.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin Liška <mliska@suse.cz>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Pavithra Gurushankar <gpavithrasha@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Quentin Monnet <quentin@isovalent.com>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Remi Bernon <rbernon@codeweavers.com>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Tom Rix <trix@redhat.com>
      Cc: Weiguo Li <liwg06@foxmail.com>
      Cc: Wenyu Liu <liuwenyu7@huawei.com>
      Cc: William Cohen <wcohen@redhat.com>
      Cc: Zechuan Chen <chenzechuan1@huawei.com>
      Cc: bpf@vger.kernel.org
      Cc: llvm@lists.linux.dev
      Cc: yaowenbin <yaowenbin1@huawei.com>
      Link: https://lore.kernel.org/r/20220826164242.43412-18-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      b40b2122
    • Ian Rogers's avatar
      perf sched: Fixes for thread safety analysis · 59c26660
      Ian Rogers authored
      Add annotations to describe lock behavior. Add unlocks so that mutexes
      aren't conditionally held on exit from perf_sched__replay. Add an exit
      variable so that thread_func can terminate, rather than leaving the
      threads blocked on mutexes.
      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: Alexandre Truong <alexandre.truong@arm.com>
      Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Andres Freund <andres@anarazel.de>
      Cc: Andrii Nakryiko <andrii@kernel.org>
      Cc: André Almeida <andrealmeid@igalia.com>
      Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
      Cc: Colin Ian King <colin.king@intel.com>
      Cc: Dario Petrillo <dario.pk1@gmail.com>
      Cc: Darren Hart <dvhart@infradead.org>
      Cc: Dave Marchevsky <davemarchevsky@fb.com>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      Cc: Fangrui Song <maskray@google.com>
      Cc: Hewenliang <hewenliang4@huawei.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jason Wang <wangborong@cdjrlc.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kim Phillips <kim.phillips@amd.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin Liška <mliska@suse.cz>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Pavithra Gurushankar <gpavithrasha@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Quentin Monnet <quentin@isovalent.com>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Remi Bernon <rbernon@codeweavers.com>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Tom Rix <trix@redhat.com>
      Cc: Weiguo Li <liwg06@foxmail.com>
      Cc: Wenyu Liu <liuwenyu7@huawei.com>
      Cc: William Cohen <wcohen@redhat.com>
      Cc: Zechuan Chen <chenzechuan1@huawei.com>
      Cc: bpf@vger.kernel.org
      Cc: llvm@lists.linux.dev
      Cc: yaowenbin <yaowenbin1@huawei.com>
      Link: https://lore.kernel.org/r/20220826164242.43412-17-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      59c26660
    • Ian Rogers's avatar
      perf mutex: Add thread safety annotations · bfa339ce
      Ian Rogers authored
      Add thread safety annotations to struct mutex so that when compiled with
      clang's -Wthread-safety warnings are generated for erroneous lock
      patterns. NO_THREAD_SAFETY_ANALYSIS is needed for
      mutex_lock/mutex_unlock as the analysis doesn't under pthread calls.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Reviewed-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexandre Truong <alexandre.truong@arm.com>
      Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Andres Freund <andres@anarazel.de>
      Cc: Andrii Nakryiko <andrii@kernel.org>
      Cc: André Almeida <andrealmeid@igalia.com>
      Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
      Cc: Colin Ian King <colin.king@intel.com>
      Cc: Dario Petrillo <dario.pk1@gmail.com>
      Cc: Darren Hart <dvhart@infradead.org>
      Cc: Dave Marchevsky <davemarchevsky@fb.com>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      Cc: Fangrui Song <maskray@google.com>
      Cc: Hewenliang <hewenliang4@huawei.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jason Wang <wangborong@cdjrlc.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kim Phillips <kim.phillips@amd.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin Liška <mliska@suse.cz>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Pavithra Gurushankar <gpavithrasha@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Quentin Monnet <quentin@isovalent.com>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Remi Bernon <rbernon@codeweavers.com>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Tom Rix <trix@redhat.com>
      Cc: Weiguo Li <liwg06@foxmail.com>
      Cc: Wenyu Liu <liuwenyu7@huawei.com>
      Cc: William Cohen <wcohen@redhat.com>
      Cc: Zechuan Chen <chenzechuan1@huawei.com>
      Cc: bpf@vger.kernel.org
      Cc: llvm@lists.linux.dev
      Cc: yaowenbin <yaowenbin1@huawei.com>
      Link: https://lore.kernel.org/r/20220826164242.43412-16-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      bfa339ce
    • Ian Rogers's avatar
      perf dso: Hold lock when accessing nsinfo · e54dea69
      Ian Rogers authored
      There may be threads racing to update dso->nsinfo:
      
        https://lore.kernel.org/linux-perf-users/CAP-5=fWZH20L4kv-BwVtGLwR=Em3AOOT+Q4QGivvQuYn5AsPRg@mail.gmail.com/
      
      Holding the dso->lock avoids use-after-free, memory leaks and other such
      bugs. Apply the fix in:
      
        https://lore.kernel.org/linux-perf-users/20211118193714.2293728-1-irogers@google.com/
      
      of there being a missing nsinfo__put now that the accesses are data race
      free. Fixes test "Lookup mmap thread" when compiled with address
      sanitizer.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Reviewed-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexandre Truong <alexandre.truong@arm.com>
      Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Andres Freund <andres@anarazel.de>
      Cc: Andrii Nakryiko <andrii@kernel.org>
      Cc: André Almeida <andrealmeid@igalia.com>
      Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
      Cc: Colin Ian King <colin.king@intel.com>
      Cc: Dario Petrillo <dario.pk1@gmail.com>
      Cc: Darren Hart <dvhart@infradead.org>
      Cc: Dave Marchevsky <davemarchevsky@fb.com>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      Cc: Fangrui Song <maskray@google.com>
      Cc: Hewenliang <hewenliang4@huawei.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jason Wang <wangborong@cdjrlc.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kim Phillips <kim.phillips@amd.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin Liška <mliska@suse.cz>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Pavithra Gurushankar <gpavithrasha@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Quentin Monnet <quentin@isovalent.com>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Remi Bernon <rbernon@codeweavers.com>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Tom Rix <trix@redhat.com>
      Cc: Weiguo Li <liwg06@foxmail.com>
      Cc: Wenyu Liu <liuwenyu7@huawei.com>
      Cc: William Cohen <wcohen@redhat.com>
      Cc: Zechuan Chen <chenzechuan1@huawei.com>
      Cc: bpf@vger.kernel.org
      Cc: llvm@lists.linux.dev
      Cc: yaowenbin <yaowenbin1@huawei.com>
      Link: https://lore.kernel.org/r/20220826164242.43412-15-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e54dea69
    • Ian Rogers's avatar
      perf top: Update use of pthread mutex · d8e40b58
      Ian Rogers authored
      Switch to the use of mutex wrappers that provide better error checking.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Reviewed-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexandre Truong <alexandre.truong@arm.com>
      Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Andres Freund <andres@anarazel.de>
      Cc: Andrii Nakryiko <andrii@kernel.org>
      Cc: André Almeida <andrealmeid@igalia.com>
      Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
      Cc: Colin Ian King <colin.king@intel.com>
      Cc: Dario Petrillo <dario.pk1@gmail.com>
      Cc: Darren Hart <dvhart@infradead.org>
      Cc: Dave Marchevsky <davemarchevsky@fb.com>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      Cc: Fangrui Song <maskray@google.com>
      Cc: Hewenliang <hewenliang4@huawei.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jason Wang <wangborong@cdjrlc.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kim Phillips <kim.phillips@amd.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin Liška <mliska@suse.cz>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Pavithra Gurushankar <gpavithrasha@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Quentin Monnet <quentin@isovalent.com>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Remi Bernon <rbernon@codeweavers.com>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Tom Rix <trix@redhat.com>
      Cc: Weiguo Li <liwg06@foxmail.com>
      Cc: Wenyu Liu <liuwenyu7@huawei.com>
      Cc: William Cohen <wcohen@redhat.com>
      Cc: Zechuan Chen <chenzechuan1@huawei.com>
      Cc: bpf@vger.kernel.org
      Cc: llvm@lists.linux.dev
      Cc: yaowenbin <yaowenbin1@huawei.com>
      Link: https://lore.kernel.org/r/20220826164242.43412-14-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      d8e40b58
    • Ian Rogers's avatar
      perf annotate: Update use of pthread mutex · 9b3726ef
      Ian Rogers authored
      Switch to the use of mutex wrappers that provide better error checking.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Reviewed-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexandre Truong <alexandre.truong@arm.com>
      Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Andres Freund <andres@anarazel.de>
      Cc: Andrii Nakryiko <andrii@kernel.org>
      Cc: André Almeida <andrealmeid@igalia.com>
      Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
      Cc: Colin Ian King <colin.king@intel.com>
      Cc: Dario Petrillo <dario.pk1@gmail.com>
      Cc: Darren Hart <dvhart@infradead.org>
      Cc: Dave Marchevsky <davemarchevsky@fb.com>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      Cc: Fangrui Song <maskray@google.com>
      Cc: Hewenliang <hewenliang4@huawei.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jason Wang <wangborong@cdjrlc.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kim Phillips <kim.phillips@amd.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin Liška <mliska@suse.cz>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Pavithra Gurushankar <gpavithrasha@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Quentin Monnet <quentin@isovalent.com>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Remi Bernon <rbernon@codeweavers.com>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Tom Rix <trix@redhat.com>
      Cc: Weiguo Li <liwg06@foxmail.com>
      Cc: Wenyu Liu <liuwenyu7@huawei.com>
      Cc: William Cohen <wcohen@redhat.com>
      Cc: Zechuan Chen <chenzechuan1@huawei.com>
      Cc: bpf@vger.kernel.org
      Cc: llvm@lists.linux.dev
      Cc: yaowenbin <yaowenbin1@huawei.com>
      Link: https://lore.kernel.org/r/20220826164242.43412-13-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      9b3726ef
    • Ian Rogers's avatar
      perf dso: Update use of pthread mutex · d9a0d6b8
      Ian Rogers authored
      Switch to the use of mutex wrappers that provide better error checking.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Reviewed-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexandre Truong <alexandre.truong@arm.com>
      Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Andres Freund <andres@anarazel.de>
      Cc: Andrii Nakryiko <andrii@kernel.org>
      Cc: André Almeida <andrealmeid@igalia.com>
      Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
      Cc: Colin Ian King <colin.king@intel.com>
      Cc: Dario Petrillo <dario.pk1@gmail.com>
      Cc: Darren Hart <dvhart@infradead.org>
      Cc: Dave Marchevsky <davemarchevsky@fb.com>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      Cc: Fangrui Song <maskray@google.com>
      Cc: Hewenliang <hewenliang4@huawei.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jason Wang <wangborong@cdjrlc.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kim Phillips <kim.phillips@amd.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin Liška <mliska@suse.cz>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Pavithra Gurushankar <gpavithrasha@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Quentin Monnet <quentin@isovalent.com>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Remi Bernon <rbernon@codeweavers.com>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Tom Rix <trix@redhat.com>
      Cc: Weiguo Li <liwg06@foxmail.com>
      Cc: Wenyu Liu <liuwenyu7@huawei.com>
      Cc: William Cohen <wcohen@redhat.com>
      Cc: Zechuan Chen <chenzechuan1@huawei.com>
      Cc: bpf@vger.kernel.org
      Cc: llvm@lists.linux.dev
      Cc: yaowenbin <yaowenbin1@huawei.com>
      Link: https://lore.kernel.org/r/20220826164242.43412-12-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      d9a0d6b8
    • Ian Rogers's avatar
      perf mmap: Remove unnecessary pthread.h include · 26b3a5fa
      Ian Rogers authored
      The comment says it is for cpu_set_t which isn't used in the header.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Reviewed-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexandre Truong <alexandre.truong@arm.com>
      Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Andres Freund <andres@anarazel.de>
      Cc: Andrii Nakryiko <andrii@kernel.org>
      Cc: André Almeida <andrealmeid@igalia.com>
      Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
      Cc: Colin Ian King <colin.king@intel.com>
      Cc: Dario Petrillo <dario.pk1@gmail.com>
      Cc: Darren Hart <dvhart@infradead.org>
      Cc: Dave Marchevsky <davemarchevsky@fb.com>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      Cc: Fangrui Song <maskray@google.com>
      Cc: Hewenliang <hewenliang4@huawei.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jason Wang <wangborong@cdjrlc.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kim Phillips <kim.phillips@amd.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin Liška <mliska@suse.cz>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Pavithra Gurushankar <gpavithrasha@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Quentin Monnet <quentin@isovalent.com>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Remi Bernon <rbernon@codeweavers.com>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Tom Rix <trix@redhat.com>
      Cc: Weiguo Li <liwg06@foxmail.com>
      Cc: Wenyu Liu <liuwenyu7@huawei.com>
      Cc: William Cohen <wcohen@redhat.com>
      Cc: Zechuan Chen <chenzechuan1@huawei.com>
      Cc: bpf@vger.kernel.org
      Cc: llvm@lists.linux.dev
      Cc: yaowenbin <yaowenbin1@huawei.com>
      Link: https://lore.kernel.org/r/20220826164242.43412-11-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      26b3a5fa
    • Ian Rogers's avatar
      perf ui: Update use of pthread mutex · 82aff6cc
      Ian Rogers authored
      Switch to the use of mutex wrappers that provide better error checking.
      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: Alexandre Truong <alexandre.truong@arm.com>
      Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Andres Freund <andres@anarazel.de>
      Cc: Andrii Nakryiko <andrii@kernel.org>
      Cc: André Almeida <andrealmeid@igalia.com>
      Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
      Cc: Colin Ian King <colin.king@intel.com>
      Cc: Dario Petrillo <dario.pk1@gmail.com>
      Cc: Darren Hart <dvhart@infradead.org>
      Cc: Dave Marchevsky <davemarchevsky@fb.com>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      Cc: Fangrui Song <maskray@google.com>
      Cc: Hewenliang <hewenliang4@huawei.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jason Wang <wangborong@cdjrlc.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kim Phillips <kim.phillips@amd.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin Liška <mliska@suse.cz>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Pavithra Gurushankar <gpavithrasha@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Quentin Monnet <quentin@isovalent.com>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Remi Bernon <rbernon@codeweavers.com>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Tom Rix <trix@redhat.com>
      Cc: Weiguo Li <liwg06@foxmail.com>
      Cc: Wenyu Liu <liuwenyu7@huawei.com>
      Cc: William Cohen <wcohen@redhat.com>
      Cc: Zechuan Chen <chenzechuan1@huawei.com>
      Cc: bpf@vger.kernel.org
      Cc: llvm@lists.linux.dev
      Cc: yaowenbin <yaowenbin1@huawei.com>
      Link: https://lore.kernel.org/r/20220826164242.43412-10-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      82aff6cc
    • Ian Rogers's avatar
      perf sched: Update use of pthread mutex · 0bd14ac2
      Ian Rogers authored
      Switch to the use of mutex wrappers that provide better error
      checking. Update cmd_sched so that we always explicitly destroy the
      mutexes.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Reviewed-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexandre Truong <alexandre.truong@arm.com>
      Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Andres Freund <andres@anarazel.de>
      Cc: Andrii Nakryiko <andrii@kernel.org>
      Cc: André Almeida <andrealmeid@igalia.com>
      Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
      Cc: Colin Ian King <colin.king@intel.com>
      Cc: Dario Petrillo <dario.pk1@gmail.com>
      Cc: Darren Hart <dvhart@infradead.org>
      Cc: Dave Marchevsky <davemarchevsky@fb.com>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      Cc: Fangrui Song <maskray@google.com>
      Cc: Hewenliang <hewenliang4@huawei.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jason Wang <wangborong@cdjrlc.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kim Phillips <kim.phillips@amd.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin Liška <mliska@suse.cz>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Pavithra Gurushankar <gpavithrasha@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Quentin Monnet <quentin@isovalent.com>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Remi Bernon <rbernon@codeweavers.com>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Tom Rix <trix@redhat.com>
      Cc: Weiguo Li <liwg06@foxmail.com>
      Cc: Wenyu Liu <liuwenyu7@huawei.com>
      Cc: William Cohen <wcohen@redhat.com>
      Cc: Zechuan Chen <chenzechuan1@huawei.com>
      Cc: bpf@vger.kernel.org
      Cc: llvm@lists.linux.dev
      Cc: yaowenbin <yaowenbin1@huawei.com>
      Link: https://lore.kernel.org/r/20220826164242.43412-9-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      0bd14ac2
    • Ian Rogers's avatar
      perf record: Update use of pthread mutex · 49c670b1
      Ian Rogers authored
      Switch to the use of mutex wrappers that provide better error checking
      for synth_lock.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Reviewed-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexandre Truong <alexandre.truong@arm.com>
      Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Andres Freund <andres@anarazel.de>
      Cc: Andrii Nakryiko <andrii@kernel.org>
      Cc: André Almeida <andrealmeid@igalia.com>
      Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
      Cc: Colin Ian King <colin.king@intel.com>
      Cc: Dario Petrillo <dario.pk1@gmail.com>
      Cc: Darren Hart <dvhart@infradead.org>
      Cc: Dave Marchevsky <davemarchevsky@fb.com>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      Cc: Fangrui Song <maskray@google.com>
      Cc: Hewenliang <hewenliang4@huawei.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jason Wang <wangborong@cdjrlc.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kim Phillips <kim.phillips@amd.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin Liška <mliska@suse.cz>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Pavithra Gurushankar <gpavithrasha@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Quentin Monnet <quentin@isovalent.com>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Remi Bernon <rbernon@codeweavers.com>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Tom Rix <trix@redhat.com>
      Cc: Weiguo Li <liwg06@foxmail.com>
      Cc: Wenyu Liu <liuwenyu7@huawei.com>
      Cc: William Cohen <wcohen@redhat.com>
      Cc: Zechuan Chen <chenzechuan1@huawei.com>
      Cc: bpf@vger.kernel.org
      Cc: llvm@lists.linux.dev
      Cc: yaowenbin <yaowenbin1@huawei.com>
      Link: https://lore.kernel.org/r/20220826164242.43412-8-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      49c670b1
    • Ian Rogers's avatar
      perf lock: Remove unused pthread.h include · 6f37dc6e
      Ian Rogers authored
      No pthread usage in builtin-lock.c.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Reviewed-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexandre Truong <alexandre.truong@arm.com>
      Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Andres Freund <andres@anarazel.de>
      Cc: Andrii Nakryiko <andrii@kernel.org>
      Cc: André Almeida <andrealmeid@igalia.com>
      Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
      Cc: Colin Ian King <colin.king@intel.com>
      Cc: Dario Petrillo <dario.pk1@gmail.com>
      Cc: Darren Hart <dvhart@infradead.org>
      Cc: Dave Marchevsky <davemarchevsky@fb.com>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      Cc: Fangrui Song <maskray@google.com>
      Cc: Hewenliang <hewenliang4@huawei.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jason Wang <wangborong@cdjrlc.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kim Phillips <kim.phillips@amd.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin Liška <mliska@suse.cz>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Pavithra Gurushankar <gpavithrasha@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Quentin Monnet <quentin@isovalent.com>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Remi Bernon <rbernon@codeweavers.com>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Tom Rix <trix@redhat.com>
      Cc: Weiguo Li <liwg06@foxmail.com>
      Cc: Wenyu Liu <liuwenyu7@huawei.com>
      Cc: William Cohen <wcohen@redhat.com>
      Cc: Zechuan Chen <chenzechuan1@huawei.com>
      Cc: bpf@vger.kernel.org
      Cc: llvm@lists.linux.dev
      Cc: yaowenbin <yaowenbin1@huawei.com>
      Link: https://lore.kernel.org/r/20220826164242.43412-7-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      6f37dc6e
    • Ian Rogers's avatar
      perf bpf: Remove unused pthread.h include · ed0546b7
      Ian Rogers authored
      No pthread usage in bpf-event.h.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Reviewed-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexandre Truong <alexandre.truong@arm.com>
      Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Andres Freund <andres@anarazel.de>
      Cc: Andrii Nakryiko <andrii@kernel.org>
      Cc: André Almeida <andrealmeid@igalia.com>
      Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
      Cc: Colin Ian King <colin.king@intel.com>
      Cc: Dario Petrillo <dario.pk1@gmail.com>
      Cc: Darren Hart <dvhart@infradead.org>
      Cc: Dave Marchevsky <davemarchevsky@fb.com>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      Cc: Fangrui Song <maskray@google.com>
      Cc: Hewenliang <hewenliang4@huawei.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jason Wang <wangborong@cdjrlc.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kim Phillips <kim.phillips@amd.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin Liška <mliska@suse.cz>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Pavithra Gurushankar <gpavithrasha@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Quentin Monnet <quentin@isovalent.com>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Remi Bernon <rbernon@codeweavers.com>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Tom Rix <trix@redhat.com>
      Cc: Weiguo Li <liwg06@foxmail.com>
      Cc: Wenyu Liu <liuwenyu7@huawei.com>
      Cc: William Cohen <wcohen@redhat.com>
      Cc: Zechuan Chen <chenzechuan1@huawei.com>
      Cc: bpf@vger.kernel.org
      Cc: llvm@lists.linux.dev
      Cc: yaowenbin <yaowenbin1@huawei.com>
      Link: https://lore.kernel.org/r/20220826164242.43412-6-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      ed0546b7
    • Ian Rogers's avatar
      perf hist: Update use of pthread mutex · 8e03bb88
      Ian Rogers authored
      Switch to the use of mutex wrappers that provide better error checking.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Reviewed-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexandre Truong <alexandre.truong@arm.com>
      Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Andres Freund <andres@anarazel.de>
      Cc: Andrii Nakryiko <andrii@kernel.org>
      Cc: André Almeida <andrealmeid@igalia.com>
      Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
      Cc: Colin Ian King <colin.king@intel.com>
      Cc: Dario Petrillo <dario.pk1@gmail.com>
      Cc: Darren Hart <dvhart@infradead.org>
      Cc: Dave Marchevsky <davemarchevsky@fb.com>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      Cc: Fangrui Song <maskray@google.com>
      Cc: Hewenliang <hewenliang4@huawei.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jason Wang <wangborong@cdjrlc.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kim Phillips <kim.phillips@amd.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin Liška <mliska@suse.cz>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Pavithra Gurushankar <gpavithrasha@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Quentin Monnet <quentin@isovalent.com>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Remi Bernon <rbernon@codeweavers.com>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Tom Rix <trix@redhat.com>
      Cc: Weiguo Li <liwg06@foxmail.com>
      Cc: Wenyu Liu <liuwenyu7@huawei.com>
      Cc: William Cohen <wcohen@redhat.com>
      Cc: Zechuan Chen <chenzechuan1@huawei.com>
      Cc: bpf@vger.kernel.org
      Cc: llvm@lists.linux.dev
      Cc: yaowenbin <yaowenbin1@huawei.com>
      Link: https://lore.kernel.org/r/20220826164242.43412-5-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      8e03bb88
    • Ian Rogers's avatar
      perf tests: Avoid pthread.h inclusion · 130f267a
      Ian Rogers authored
      pthread.h is being included for the side-effect of getting sched.h and
      macros like CPU_CLR. Switch to directly using sched.h, or if that is
      already present, just remove the pthread.h inclusion entirely.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Reviewed-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexandre Truong <alexandre.truong@arm.com>
      Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Andres Freund <andres@anarazel.de>
      Cc: Andrii Nakryiko <andrii@kernel.org>
      Cc: André Almeida <andrealmeid@igalia.com>
      Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
      Cc: Colin Ian King <colin.king@intel.com>
      Cc: Dario Petrillo <dario.pk1@gmail.com>
      Cc: Darren Hart <dvhart@infradead.org>
      Cc: Dave Marchevsky <davemarchevsky@fb.com>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      Cc: Fangrui Song <maskray@google.com>
      Cc: Hewenliang <hewenliang4@huawei.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jason Wang <wangborong@cdjrlc.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kim Phillips <kim.phillips@amd.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin Liška <mliska@suse.cz>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Pavithra Gurushankar <gpavithrasha@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Quentin Monnet <quentin@isovalent.com>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Remi Bernon <rbernon@codeweavers.com>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Tom Rix <trix@redhat.com>
      Cc: Weiguo Li <liwg06@foxmail.com>
      Cc: Wenyu Liu <liuwenyu7@huawei.com>
      Cc: William Cohen <wcohen@redhat.com>
      Cc: Zechuan Chen <chenzechuan1@huawei.com>
      Cc: bpf@vger.kernel.org
      Cc: llvm@lists.linux.dev
      Cc: yaowenbin <yaowenbin1@huawei.com>
      Link: https://lore.kernel.org/r/20220826164242.43412-4-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      130f267a
    • Ian Rogers's avatar
      perf bench: Update use of pthread mutex/cond · a64d3af5
      Ian Rogers authored
      Switch to the use of mutex wrappers that provide better error checking.
      Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Reviewed-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexandre Truong <alexandre.truong@arm.com>
      Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Andres Freund <andres@anarazel.de>
      Cc: Andrii Nakryiko <andrii@kernel.org>
      Cc: André Almeida <andrealmeid@igalia.com>
      Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
      Cc: Colin Ian King <colin.king@intel.com>
      Cc: Dario Petrillo <dario.pk1@gmail.com>
      Cc: Darren Hart <dvhart@infradead.org>
      Cc: Dave Marchevsky <davemarchevsky@fb.com>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      Cc: Fangrui Song <maskray@google.com>
      Cc: Hewenliang <hewenliang4@huawei.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jason Wang <wangborong@cdjrlc.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kim Phillips <kim.phillips@amd.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin Liška <mliska@suse.cz>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Pavithra Gurushankar <gpavithrasha@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Quentin Monnet <quentin@isovalent.com>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Remi Bernon <rbernon@codeweavers.com>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Tom Rix <trix@redhat.com>
      Cc: Weiguo Li <liwg06@foxmail.com>
      Cc: Wenyu Liu <liuwenyu7@huawei.com>
      Cc: William Cohen <wcohen@redhat.com>
      Cc: Zechuan Chen <chenzechuan1@huawei.com>
      Cc: bpf@vger.kernel.org
      Cc: llvm@lists.linux.dev
      Cc: yaowenbin <yaowenbin1@huawei.com>
      Link: https://lore.kernel.org/r/20220826164242.43412-3-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      a64d3af5
    • Pavithra Gurushankar's avatar
      perf mutex: Wrapped usage of mutex and cond · e57d8977
      Pavithra Gurushankar authored
      Added a new header file mutex.h that wraps the usage of
      pthread_mutex_t and pthread_cond_t. By abstracting these it is
      possible to introduce error checking.
      Signed-off-by: default avatarPavithra Gurushankar <gpavithrasha@gmail.com>
      Reviewed-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexandre Truong <alexandre.truong@arm.com>
      Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Andres Freund <andres@anarazel.de>
      Cc: Andrii Nakryiko <andrii@kernel.org>
      Cc: André Almeida <andrealmeid@igalia.com>
      Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
      Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
      Cc: Colin Ian King <colin.king@intel.com>
      Cc: Dario Petrillo <dario.pk1@gmail.com>
      Cc: Darren Hart <dvhart@infradead.org>
      Cc: Dave Marchevsky <davemarchevsky@fb.com>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      Cc: Fangrui Song <maskray@google.com>
      Cc: Hewenliang <hewenliang4@huawei.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jason Wang <wangborong@cdjrlc.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Kajol Jain <kjain@linux.ibm.com>
      Cc: Kim Phillips <kim.phillips@amd.com>
      Cc: Leo Yan <leo.yan@linaro.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin Liška <mliska@suse.cz>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Quentin Monnet <quentin@isovalent.com>
      Cc: Ravi Bangoria <ravi.bangoria@amd.com>
      Cc: Remi Bernon <rbernon@codeweavers.com>
      Cc: Riccardo Mancini <rickyman7@gmail.com>
      Cc: Song Liu <songliubraving@fb.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Tom Rix <trix@redhat.com>
      Cc: Weiguo Li <liwg06@foxmail.com>
      Cc: Wenyu Liu <liuwenyu7@huawei.com>
      Cc: William Cohen <wcohen@redhat.com>
      Cc: Zechuan Chen <chenzechuan1@huawei.com>
      Cc: bpf@vger.kernel.org
      Cc: llvm@lists.linux.dev
      Cc: yaowenbin <yaowenbin1@huawei.com>
      Link: https://lore.kernel.org/r/20220826164242.43412-2-irogers@google.comSigned-off-by: default avatarIan Rogers <irogers@google.com>
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e57d8977
    • Adrian Hunter's avatar
      perf record: Allow multiple recording time ranges · 6657a099
      Adrian Hunter authored
      AUX area traces can produce too much data to record successfully or
      analyze subsequently. Add another means to reduce data collection by
      allowing multiple recording time ranges.
      
      This is useful, for instance, in cases where a workload produces
      predictably reproducible events in specific time ranges.
      
      Today we only have perf record -D <msecs> to start at a specific region, or
      some complicated approach using snapshot mode and external scripts sending
      signals or using the fifos. But these approaches are difficult to set up
      compared with simply having perf do it.
      
      Extend perf record option -D/--delay option to specifying relative time
      stamps for start stop controlled by perf with the right time offset, for
      instance:
      
          perf record -e intel_pt// -D 10-20,30-40
      
      to record 10ms to 20ms into the trace and 30ms to 40ms.
      
      Example:
      
       The example workload is:
      
       $ cat repeat-usleep.c
      
       int usleep(useconds_t usec);
      
       int usage(int ret, const char *msg)
       {
               if (msg)
                       fprintf(stderr, "%s\n", msg);
      
               fprintf(stderr, "Usage is: repeat-usleep <microseconds>\n");
      
               return ret;
       }
      
       int main(int argc, char *argv[])
       {
               unsigned long usecs;
               char *end_ptr;
      
               if (argc != 2)
                       return usage(1, "Error: Wrong number of arguments!");
      
               errno = 0;
               usecs = strtoul(argv[1], &end_ptr, 0);
               if (errno || *end_ptr || usecs > UINT_MAX)
                       return usage(1, "Error: Invalid argument!");
      
               while (1) {
                       int ret = usleep(usecs);
      
                       if (ret & errno != EINTR)
                               return usage(1, "Error: usleep() failed!");
               }
      
               return 0;
       }
      
       $ perf record -e intel_pt//u --delay 10-20,40-70,110-160 -- ./repeat-usleep 500
       Events disabled
       Events enabled
       Events disabled
       Events enabled
       Events disabled
       Events enabled
       Events disabled
       [ perf record: Woken up 5 times to write data ]
       [ perf record: Captured and wrote 0.204 MB perf.data ]
       Terminated
      
       A dlfilter is used to determine continuous data collection (timestamps
       less than 1ms apart):
      
       $ cat dlfilter-show-delays.c
      
       static __u64 start_time;
       static __u64 last_time;
      
       int start(void **data, void *ctx)
       {
               printf("%-17s\t%-9s\t%-6s\n", " Time", " Duration", " Delay");
               return 0;
       }
      
       int filter_event_early(void *data, const struct perf_dlfilter_sample *sample, void *ctx)
       {
               __u64 delta;
      
               if (!sample->time)
                       return 1;
               if (!last_time)
                       goto out;
               delta = sample->time - last_time;
               if (delta < 1000000)
                       goto out2;;
               printf("%17.9f\t%9.1f\t%6.1f\n", start_time / 1000000000.0, (last_time - start_time) / 1000000.0, delta / 1000000.0);
       out:
               start_time = sample->time;
       out2:
               last_time = sample->time;
               return 1;
       }
      
       int stop(void *data, void *ctx)
       {
               printf("%17.9f\t%9.1f\n", start_time / 1000000000.0, (last_time - start_time) / 1000000.0);
               return 0;
       }
      
       The result shows the times roughly match the --delay option:
      
       $ perf script --itrace=qb --dlfilter dlfilter-show-delays.so
        Time                    Duration        Delay
         39215.302317300             9.7         20.5
         39215.332480217            30.4         40.9
         39215.403837717            49.8
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lore.kernel.org/r/20220824072814.16422-6-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      6657a099
    • Adrian Hunter's avatar
      perf evlist: Add evlist__{en/dis}able_non_dummy() · 329725d5
      Adrian Hunter authored
      Dummy events are used to provide sideband information like MMAP events that
      are always needed even when main events are disabled. Add functions that
      take that into account.
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Acked-by: default avatarIan Rogers <irogers@google.com>
      Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lore.kernel.org/r/20220824072814.16422-5-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      329725d5
    • Adrian Hunter's avatar
      perf record: Change evlist->ctl_fd to use fdarray_flag__non_perf_event · feff0b61
      Adrian Hunter authored
      Patch "perf record: Fix way of handling non-perf-event pollfds" added a
      generic way to handle non-perf-event file descriptors like evlist->ctl_fd.
      Use it instead of handling evlist->ctl_fd separately.
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Acked-by: default avatarIan Rogers <irogers@google.com>
      Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lore.kernel.org/r/20220824072814.16422-4-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      feff0b61
    • Adrian Hunter's avatar
      perf record: Fix done_fd wakeup event · a032ad87
      Adrian Hunter authored
      evlist__add_wakeup_eventfd() calls perf_evlist__add_pollfd() to add a
      non-perf-event to the evlist pollfds. Since commit 415ccb58
      ("perf record: Introduce thread specific data array") that doesn't work
      because evlist pollfs is not polled and done_fd is not duplicated into
      thread-data.
      
      Patch "perf record: Fix way of handling non-perf-event pollfds" added a new
      approach that ensures file descriptors like done_fd are handled correctly
      by flagging them as fdarray_flag__non_perf_event.
      
      Fix by flagging done_fd as fdarray_flag__non_perf_event.
      
      Example:
      
       Before:
      
        $ sleep 3 & perf record -vv -p $!
        ...
        thread_data[0x55f44bd34140]: pollfd[0] <- event_fd=5
        thread_data[0x55f44bd34140]: pollfd[1] <- event_fd=6
        thread_data[0x55f44bd34140]: pollfd[2] <- event_fd=7
        thread_data[0x55f44bd34140]: pollfd[3] <- event_fd=8
        thread_data[0x55f44bd34140]: pollfd[4] <- event_fd=9
        thread_data[0x55f44bd34140]: pollfd[5] <- event_fd=10
        thread_data[0x55f44bd34140]: pollfd[6] <- event_fd=11
        thread_data[0x55f44bd34140]: pollfd[7] <- event_fd=12
        ...
      
       After:
      
        $ sleep 3 & perf record -vv -p $!
        ...
        thread_data[0x55a8ded89140]: pollfd[0] <- event_fd=5
        thread_data[0x55a8ded89140]: pollfd[1] <- event_fd=6
        thread_data[0x55a8ded89140]: pollfd[2] <- event_fd=7
        thread_data[0x55a8ded89140]: pollfd[3] <- event_fd=8
        thread_data[0x55a8ded89140]: pollfd[4] <- event_fd=9
        thread_data[0x55a8ded89140]: pollfd[5] <- event_fd=10
        thread_data[0x55a8ded89140]: pollfd[6] <- event_fd=11
        thread_data[0x55a8ded89140]: pollfd[7] <- event_fd=12
        thread_data[0x55a8ded89140]: pollfd[8] <- non_perf_event fd=4
        ...
      
      This patch depends on "perf record: Fix way of handling non-perf-event
      pollfds".
      
      Fixes: 415ccb58 ("perf record: Introduce thread specific data array")
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Acked-by: default avatarIan Rogers <irogers@google.com>
      Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lore.kernel.org/r/20220824072814.16422-3-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      a032ad87
    • Adrian Hunter's avatar
      perf record: Fix way of handling non-perf-event pollfds · 6562c9ac
      Adrian Hunter authored
      perf record __cmd_record() does not poll evlist pollfds. Instead it polls
      thread_data[0].pollfd. That happens whether or not threads are being used.
      
      perf record duplicates evlist mmap pollfds as needed for separate threads.
      The non-perf-event represented by evlist->ctl_fd has to handled separately,
      which is done explicitly, duplicating it into the thread_data[0] pollfds.
      That approach neglects any other non-perf-event file descriptors. Currently
      there is also done_fd which needs the same handling.
      
      Add a new generalized approach.
      
      Add fdarray_flag__non_perf_event to identify the file descriptors that
      need the special handling. For those cases, also keep a mapping of the
      evlist pollfd index and thread pollfd index, so that the evlist revents
      can be updated.
      
      Although this patch adds the new handling, it does not take it into use.
      There is no functional change, but it is the precursor to a fix, so is
      marked as a fix.
      
      Fixes: 415ccb58 ("perf record: Introduce thread specific data array")
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Acked-by: default avatarIan Rogers <irogers@google.com>
      Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lore.kernel.org/r/20220824072814.16422-2-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      6562c9ac
    • Ian Rogers's avatar
      perf hashmap: Tidy hashmap dependency · bdf45725
      Ian Rogers authored
      When libbpf is present the build uses definitions in libbpf hashmap.c,
      however, libbpf's hashmap.h wasn't being used. Switch to using the
      correct hashmap.h dependent on the define HAVE_LIBBPF_SUPPORT. This was
      the original intent in:
      
        https://lore.kernel.org/lkml/20200515221732.44078-8-irogers@google.com/Signed-off-by: default avatarIan Rogers <irogers@google.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lore.kernel.org/lkml/20220824050604.352156-1-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      bdf45725
    • Xin Gao's avatar
      perf metrics: Use 'unsigned int' instead of just 'unsigned'. · 84f879c5
      Xin Gao authored
      'unsigned int' should be clearer than 'unsigned'.
      Signed-off-by: default avatarXin Gao <gaoxin@cdjrlc.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: John Garry <john.garry@huawei.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lore.kernel.org/lkml/20220816173804.7539-1-gaoxin@cdjrlc.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      84f879c5
    • Xin Gao's avatar
      perf parse-events: Use 'unsigned int' instead of plain 'unsigned'. · f1417cea
      Xin Gao authored
      'unsigned int' should be clearer than 'unsigned'.
      Signed-off-by: default avatarXin Gao <gaoxin@cdjrlc.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Ian Rogers <irogers@google.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: https://lore.kernel.org/r/20220816174109.7718-1-gaoxin@cdjrlc.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      f1417cea
    • Roberto Sassu's avatar
      tools build: Display logical OR of a feature flavors · 74ef1cc9
      Roberto Sassu authored
      Sometimes, features are simply different flavors of another feature, to
      properly detect the exact dependencies needed by different Linux
      distributions.
      
      For example, libbfd has three flavors: libbfd if the distro does not
      require any additional dependency; libbfd-liberty if it requires libiberty;
      libbfd-liberty-z if it requires libiberty and libz.
      
      It might not be clear to the user whether a feature has been successfully
      detected or not, given that some of its flavors will be set to OFF, others
      to ON.
      
      Instead, display only the feature main flavor if not in verbose mode
      (VF != 1), and set it to ON if at least one of its flavors has been
      successfully detected (logical OR), OFF otherwise. Omit the other flavors.
      
      Accomplish that by declaring a FEATURE_GROUP_MEMBERS-<feature main flavor>
      variable, with the list of the other flavors as variable value. For now, do
      it just for libbfd.
      
      In verbose mode, of if no group is defined for a feature, show the feature
      detection result as before.
      
      Committer testing:
      
      Collecting the output from:
      
        $ make -C tools/bpf/bpftool/ clean
        $ make -C tools/bpf/bpftool/ |& grep "Auto-detecting system features" -A10
      
        $ diff -u before after
        --- before	2022-08-18 10:06:40.422086966 -0300
        +++ after	2022-08-18 10:07:59.202138282 -0300
        @@ -1,6 +1,4 @@
         Auto-detecting system features:
         ...                                  libbfd: [ on  ]
        -...                          libbfd-liberty: [ on  ]
        -...                        libbfd-liberty-z: [ on  ]
         ...                                  libcap: [ on  ]
         ...                         clang-bpf-co-re: [ on  ]
        $
      Signed-off-by: default avatarRoberto Sassu <roberto.sassu@huawei.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Quentin Monnet <quentin@isovalent.com>
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20220818120957.319995-3-roberto.sassu@huaweicloud.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      74ef1cc9
    • Roberto Sassu's avatar
      tools build: Increment room for feature name in feature detection output · 74da7697
      Roberto Sassu authored
      Since now there are features with a long name, increase the room for them,
      so that fields are correctly aligned.
      Signed-off-by: default avatarRoberto Sassu <roberto.sassu@huawei.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Quentin Monnet <quentin@isovalent.com>
      Cc: bpf@vger.kernel.org
      Link: https://lore.kernel.org/r/20220818120957.319995-2-roberto.sassu@huaweicloud.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      74da7697
    • Roberto Sassu's avatar
      tools build: Fix feature detection output due to eval expansion · 709533e5
      Roberto Sassu authored
      As the first eval expansion is used only to generate Makefile statements,
      messages should not be displayed at this stage, as for example conditional
      expressions are not evaluated.
      
      It can be seen for example in the output of feature detection for bpftool,
      where the number of detected features does not change, despite turning on
      the verbose mode (VF = 1) and there are additional features to display.
      
      Fix this issue by escaping the $ before $(info) statements, to ensure that
      messages are printed only when the function containing them is actually
      executed, and not when it is expanded.
      
      In addition, move the $(info) statement out of feature_print_status, due to
      the fact that is called both inside and outside an eval context, and place
      it to the caller so that the $ can be escaped when necessary. For symmetry,
      move the $(info) statement also out of feature_print_text, and place it to
      the caller.
      
      Force the TMP variable evaluation in verbose mode, to display the features
      in FEATURE_TESTS that are not in FEATURE_DISPLAY.
      
      Reorder perf feature detection messages (first non-verbose, then verbose
      ones) by moving the call to feature_display_entries earlier, before the VF
      environment variable check.
      
      Also, remove the newline from that function, as perf might display
      additional messages. Move the newline to perf Makefile, and display another
      one if displaying the detection result is not deferred as in the case of
      bpftool.
      
      Committer testing:
      
        Collecting the output from:
      
        $ make VF=1 -C tools/bpf/bpftool/ |& grep "Auto-detecting system features" -A20
      
        $ diff -u before after
        --- before	2022-08-18 09:59:55.460529231 -0300
        +++ after	2022-08-18 10:01:11.182517282 -0300
        @@ -4,3 +4,5 @@
         ...              libbfd-liberty-z: [ on  ]
         ...                        libcap: [ on  ]
         ...               clang-bpf-co-re: [ on  ]
        +...        disassembler-four-args: [ on  ]
        +...      disassembler-init-styled: [ OFF ]
        $
      
      Fixes: 0afc5cad ("perf build: Separate feature make support into config/Makefile.feature")
      Signed-off-by: default avatarRoberto Sassu <roberto.sassu@huawei.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: bpf@vger.kernel.org
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Quentin Monnet <quentin@isovalent.com>
      Link: https://lore.kernel.org/r/20220818120957.319995-1-roberto.sassu@huaweicloud.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      709533e5
    • Raul Silvera's avatar
      perf inject: Add a command line option to specify build ids. · 8012243e
      Raul Silvera authored
      This commit adds the option --known-build-ids to perf inject.
      It allows the user to explicitly specify the build id for a given
      path, instead of retrieving it from the current system. This is
      useful in cases where a perf.data file is processed on a different
      system from where it was collected, or if some of the binaries are
      no longer available.
      
      The build ids and paths are specified in pairs in the command line.
      Using the file:// specifier, build ids can be loaded from a file
      directly generated by perf buildid-list. This is convenient to copy
      build ids from one perf.data file to another.
      
      ** Example: In this example we use perf record to create two
      perf.data files, one with build ids and another without, and use
      perf buildid-list and perf inject to copy the build ids from the
      first file to the second.
      
       $ perf record ls /tmp
       $ perf record --no-buildid -o perf.data.no-buildid ls /tmp
       $ perf buildid-list > build-ids.txt
       $ perf inject -b --known-build-ids='file://build-ids.txt' \
              -i perf.data.no-buildid -o perf.data.buildid
      Signed-off-by: default avatarRaul Silvera <rsilvera@google.com>
      Acked-by: default avatarNamhyung Kim <namhyung@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: James Clark <james.clark@arm.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: https://lore.kernel.org/r/20220815225922.2118745-1-rsilvera@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      8012243e
    • Linus Torvalds's avatar
      Merge tag 'statx-dioalign-for-linus' of... · 725737e7
      Linus Torvalds authored
      Merge tag 'statx-dioalign-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux
      
      Pull STATX_DIOALIGN support from Eric Biggers:
       "Make statx() support reporting direct I/O (DIO) alignment information.
      
        This provides a generic interface for userspace programs to determine
        whether a file supports DIO, and if so with what alignment
        restrictions. Specifically, STATX_DIOALIGN works on block devices, and
        on regular files when their containing filesystem has implemented
        support.
      
        An interface like this has been requested for years, since the
        conditions for when DIO is supported in Linux have gotten increasingly
        complex over time. Today, DIO support and alignment requirements can
        be affected by various filesystem features such as multi-device
        support, data journalling, inline data, encryption, verity,
        compression, checkpoint disabling, log-structured mode, etc.
      
        Further complicating things, Linux v6.0 relaxed the traditional rule
        of DIO needing to be aligned to the block device's logical block size;
        now user buffers (but not file offsets) only need to be aligned to the
        DMA alignment.
      
        The approach of uplifting the XFS specific ioctl XFS_IOC_DIOINFO was
        discarded in favor of creating a clean new interface with statx().
      
        For more information, see the individual commits and the man page
        update[1]"
      
      Link: https://lore.kernel.org/r/20220722074229.148925-1-ebiggers@kernel.org [1]
      
      * tag 'statx-dioalign-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux:
        xfs: support STATX_DIOALIGN
        f2fs: support STATX_DIOALIGN
        f2fs: simplify f2fs_force_buffered_io()
        f2fs: move f2fs_force_buffered_io() into file.c
        ext4: support STATX_DIOALIGN
        fscrypt: change fscrypt_dio_supported() to prepare for STATX_DIOALIGN
        vfs: support STATX_DIOALIGN on block devices
        statx: add direct I/O alignment information
      725737e7
    • Linus Torvalds's avatar
      Merge tag 'fsverity-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt · 5779aa2d
      Linus Torvalds authored
      Pull fsverity updates from Eric Biggers:
       "Minor changes to convert uses of kmap() to kmap_local_page()"
      
      * tag 'fsverity-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt:
        fs-verity: use kmap_local_page() instead of kmap()
        fs-verity: use memcpy_from_page()
      5779aa2d