]> git.baikalelectronics.ru Git - kernel.git/commit
perf tools: Fix PMU term format max value calculation
authorKan Liang <kan.liang@intel.com>
Wed, 30 Mar 2016 19:16:15 +0000 (12:16 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 1 Apr 2016 21:46:24 +0000 (18:46 -0300)
commit7b920df0d4b1918fa2f6340b2985b015ed427886
treeacb9929531a5d0f051be6a662dff099f3ea8252e
parenta6ab308b643ef0432f4860e72c9e945ccd7fe036
perf tools: Fix PMU term format max value calculation

Currently the max value of format is calculated by the bits number. It
relies on the continuity of the format.

However, uncore event format is not continuous. E.g. uncore qpi event
format can be 0-7,21.

If bit 21 is set, there is parsing issues as below.

  $ perf stat -a -e uncore_qpi_0/event=0x200002,umask=0x8/
  event syntax error: '..pi_0/event=0x200002,umask=0x8/'
                                    \___ value too big for format, maximum is 511

This patch return the real max value by setting all possible bits to 1.

Signed-off-by: Kan Liang <kan.liang@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/1459365375-14285-1-git-send-email-kan.liang@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/pmu.c