lkml.org 
[lkml]   [2013]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 05/12] perf, x86: Support Haswell v4 LBR format
> > -               if (lbr_format == LBR_FORMAT_EIP_FLAGS) {
> > + if (lbr_format == LBR_FORMAT_EIP_FLAGS ||
> > + lbr_format == LBR_FORMAT_EIP_FLAGS2) {
> > mis = !!(from & LBR_FROM_FLAG_MISPRED);
> > pred = !mis;
> > - from = (u64)((((s64)from) << 1) >> 1);
> > + if (lbr_format == LBR_FORMAT_EIP_FLAGS)
> > + from = (u64)((((s64)from) << 1) >> 1);
> > + else if (lbr_format == LBR_FORMAT_EIP_FLAGS2) {
> > + intx = !!(from & LBR_FROM_FLAG_INTX);
> > + abort = !!(from & LBR_FROM_FLAG_ABORT);
> > + from = (u64)((((s64)from) << 3) >> 3);
> > + }
> > }
> >
> Wouldn't all that be more readable with a switch-case, especially given
> that lbr_format could be extended.

The current version works for me.

-Andi


\
 
 \ /
  Last update: 2013-01-28 23:41    [W:0.051 / U:10.892 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site