perf/x86/intel/lbr: Fix the return type of get_lbr_cycles()
authorKan Liang <kan.liang@linux.intel.com>
Wed, 25 Nov 2020 21:37:20 +0000 (13:37 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Dec 2020 10:54:10 +0000 (11:54 +0100)
commit0b505007f93e5976814c167f40b61ae7fe01799b
tree91835abadcd9ab1cf740aef407f99848ac50f0c3
parent2bc4ac17ece7447056999dbe644c1e6fc1b06f27
perf/x86/intel/lbr: Fix the return type of get_lbr_cycles()

commit f8129cd958b395575e5543ce25a8434874b04d3a upstream.

The cycle count of a timed LBR is always 1 in perf record -D.

The cycle count is stored in the first 16 bits of the IA32_LBR_x_INFO
register, but the get_lbr_cycles() return Boolean type.

Use u16 to replace the Boolean type.

Fixes: 47125db27e47 ("perf/x86/intel/lbr: Support Architectural LBR")
Reported-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20201125213720.15692-2-kan.liang@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/events/intel/lbr.c