[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABPqkBQaBu44LUxh5Q4+4vJvEU_KFKqi0Dx3mfTwxgSQDhiOUA@mail.gmail.com>
Date: Mon, 28 Jan 2013 23:20:35 +0100
From: Stephane Eranian <eranian@...gle.com>
To: Andi Kleen <andi@...stfloor.org>
Cc: Ingo Molnar <mingo@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Andrew Morton <akpm@...ux-foundation.org>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
Jiri Olsa <jolsa@...hat.com>,
Namhyung Kim <namhyung@...nel.org>,
Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH 05/12] perf, x86: Support Haswell v4 LBR format
On Mon, Jan 28, 2013 at 11:08 PM, Andi Kleen <andi@...stfloor.org> wrote:
>> > - 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.
I know it works. I am questioning the style: hard to read.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists