perf header: Support num and width of branch counters
authorKan Liang <kan.liang@linux.intel.com>
Wed, 25 Oct 2023 20:16:25 +0000 (13:16 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 6 Nov 2023 21:15:16 +0000 (18:15 -0300)
commitac9cd7245fffa0fc053afce3b345469e5afa533a
tree6cf6267835be9e6f27491893b7f7a06132624b42
parent76db7aab1fca6688ddf9f388157521c442e0ffb8
perf header: Support num and width of branch counters

To support the branch counters feature, the information of the maximum
number of supported counters and the width of the counters is exposed in
the sysfs caps folder. The perf tool can use the information to parse
the logged counters in each branch.

Store the information in the perf_env for later usage.

Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com>
Cc: Andi Kleen <ak@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: Stephane Eranian <eranian@google.com>
Cc: Tinghao Zhang <tinghao.zhang@intel.com>
Link: https://lore.kernel.org/r/20231025201626.3000228-7-kan.liang@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/env.h
tools/perf/util/header.c