Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf annotate: Use architecture-agnostic register limit

Remove the arch-specific guard around TYPE_STATE_MAX_REGS and define it
as 32 for all architectures.

The architecture that perf is built on may not match the architecture
that produced the perf.data file, so relying on __powerpc__ or similar
is fragile.

Using 32 as a fixed upper bound is safe since it is greater than the
previous maximum of 16.

Add a comment to clarify that TYPE_STATE_MAX_REGS is an arch-independent
maximum rather than a build-time choice.

Suggested-by: Ian Rogers <irogers@google.com>
Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Suchit Karunakaran <suchitkarunakaran@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Suchit Karunakaran and committed by
Arnaldo Carvalho de Melo
60c38a6d 6c153cc4

+8 -5
+8 -5
tools/perf/util/annotate-data.h
··· 189 189 u8 kind; 190 190 }; 191 191 192 - /* FIXME: This should be arch-dependent */ 193 - #ifdef __powerpc__ 192 + /* 193 + * Maximum number of registers tracked in type_state. 194 + * 195 + * This limit must cover all supported architectures, since perf 196 + * may analyze perf.data files generated on systems with a different 197 + * register set. Use 32 as a safe upper bound instead of relying on 198 + * build-arch specific values. 199 + */ 194 200 #define TYPE_STATE_MAX_REGS 32 195 - #else 196 - #define TYPE_STATE_MAX_REGS 16 197 - #endif 198 201 199 202 /* 200 203 * State table to maintain type info in each register and stack location.