linux-stable/tools/perf/arch
James Clark bfd431cb2c perf cs-etm: Fix contextid validation
Pre 5.11 kernels don't support 'contextid1' and 'contextid2' so
validation would be skipped. By adding an additional check for
'contextid', old kernels will still have validation done even though
contextid would either be contextid1 or contextid2.

Additionally now that it's possible to override options, an existing bug
in the validation is revealed. 'val' is overwritten by the contextid1
validation, and re-used for contextid2 validation causing it to always
fail. '!val || val != 0x4' is the same as 'val != 0x4' because 0 is also
!= 4, so that expression can be simplified and the temp variable not
overwritten.

Fixes: 35c51f83dd ("perf cs-etm: Validate options after applying them")
Reviewed-by: Leo Yan <leo.yan@linaro.org>
Signed-off-by: James Clark <james.clark@arm.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Garry <john.g.garry@oracle.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: coresight@lists.linaro.org
Cc: linux-arm-kernel@lists.infradead.org
Link: https://lore.kernel.org/all/20230501073452.GA4660@leoy-yangtze.lan
Link: https://lore.kernel.org/r/20230504144822.1938717-1-james.clark@arm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2023-05-10 14:40:23 -03:00
..
alpha
arc/annotate
arm perf cs-etm: Fix contextid validation 2023-05-10 14:40:23 -03:00
arm64 perf arm64: Fix build with refcount checking 2023-05-10 14:39:10 -03:00
csky perf arch: Support register names from all archs 2021-12-16 12:18:12 -03:00
loongarch tools/perf: Add basic support for LoongArch 2023-05-01 17:19:59 +08:00
mips tools headers UAPI: Sync files changed by new set_mempolicy_home_node syscall 2022-01-20 11:20:37 -03:00
parisc
powerpc perf evsel: Introduce evsel__name_is() method to check if the evsel name is equal to a given string 2023-04-24 14:28:11 -03:00
riscv perf tools riscv: Fix build error on riscv due to missing header for 'struct perf_sample' 2023-01-02 11:47:22 -03:00
riscv64/annotate perf annotate: Add riscv64 support 2021-09-27 09:33:44 -03:00
s390 perf map: Add helper for ->map_ip() and ->unmap_ip() 2023-04-06 22:10:17 -03:00
sh
sparc
x86 perf tools: Add util function for overriding user set config values 2023-04-24 14:41:51 -03:00
xtensa
Build
common.c Disable building BPF based features by default for v6.4. 2023-05-07 11:32:18 -07:00
common.h perf annotate: Own objdump_path and disassembler_style strings 2023-04-04 09:39:56 -03:00