Skip to contentSkip to conversation

perf/x86/intel: Add {rd,wr}lbr_{to,from} wrappers

tip:perf/core Peter Zijlstra 1 participant 1 message Jun 29, 2016 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 4 lines · tip-bot for Peter Zijlstra
(quoted diff) +4 -0
+static inline u64 rdlbr_from(unsigned int idx)
+{
+	u64 val;
+

Review

Quoted 10 lines
(quoted diff) +10 -0
+	rdmsrl(x86_pmu.lbr_from + idx, val);
+
+	return lbr_from_signext_quirk_rd(val);
+}
+
+static inline u64 rdlbr_to(unsigned int idx)
+{
+	u64 val;
+
+	rdmsrl(x86_pmu.lbr_from + idx, val);

Things work loads better when we use:

	rdmsrl(x86_pmu.lbr_to + idx, val);

:-/

Quoted 3 lines
(quoted diff) +1 -0
+
 	return val;
 }