From: "tip-bot2 for Kan Liang" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Stephane Eranian <eranian@google.com>,
Kan Liang <kan.liang@linux.intel.com>,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
stable@vger.kernel.org, x86@kernel.org,
linux-kernel@vger.kernel.org
Subject: [tip: perf/core] perf/x86/intel/lbr: Fix the return type of get_lbr_cycles()
Date: Wed, 09 Dec 2020 18:44:39 -0000 [thread overview]
Message-ID: <160753947980.3364.1410052392262724615.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20201125213720.15692-2-kan.liang@linux.intel.com>
The following commit has been merged into the perf/core branch of tip:
Commit-ID: f8129cd958b395575e5543ce25a8434874b04d3a
Gitweb: https://git.kernel.org/tip/f8129cd958b395575e5543ce25a8434874b04d3a
Author: Kan Liang <kan.liang@linux.intel.com>
AuthorDate: Wed, 25 Nov 2020 13:37:20 -08:00
Committer: Peter Zijlstra <peterz@infradead.org>
CommitterDate: Wed, 09 Dec 2020 17:08:58 +01:00
perf/x86/intel/lbr: Fix the return type of get_lbr_cycles()
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
---
arch/x86/events/intel/lbr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/events/intel/lbr.c b/arch/x86/events/intel/lbr.c
index 8961653..e2b0efc 100644
--- a/arch/x86/events/intel/lbr.c
+++ b/arch/x86/events/intel/lbr.c
@@ -919,7 +919,7 @@ static __always_inline bool get_lbr_predicted(u64 info)
return !(info & LBR_INFO_MISPRED);
}
-static __always_inline bool get_lbr_cycles(u64 info)
+static __always_inline u16 get_lbr_cycles(u64 info)
{
if (static_cpu_has(X86_FEATURE_ARCH_LBR) &&
!(x86_pmu.lbr_timed_lbr && info & LBR_INFO_CYC_CNT_VALID))
next prev parent reply other threads:[~2020-12-09 18:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-25 21:37 [PATCH 1/2] perf/x86/intel: Fix rtm_abort_event encoding on Ice Lake kan.liang
2020-11-25 21:37 ` [PATCH 2/2] perf/x86/intel/lbr: Fix the return type of get_lbr_cycles() kan.liang
2020-12-09 18:44 ` tip-bot2 for Kan Liang [this message]
2020-12-09 18:44 ` [tip: perf/core] perf/x86/intel: Fix rtm_abort_event encoding on Ice Lake tip-bot2 for Kan Liang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=160753947980.3364.1410052392262724615.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=eranian@google.com \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=stable@vger.kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).