[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABPqkBSa60pA3qQ=zT=NNP_VmW2DeFCzg-1fdHdr7tPZ-djBzA@mail.gmail.com>
Date: Tue, 31 Jan 2012 16:48:02 +0100
From: Stephane Eranian <eranian@...gle.com>
To: Anshuman Khandual <khandual@...ux.vnet.ibm.com>
Cc: linux-kernel@...r.kernel.org, peterz@...radead.org, mingo@...e.hu,
acme@...hat.com, robert.richter@....com, ming.m.lin@...el.com,
andi@...stfloor.org, asharma@...com, ravitillo@....gov,
vweaver1@...s.utk.edu, dsahern@...il.com
Subject: Re: [PATCH v4 12/18] perf: add support for sampling taken branch to
perf record
On Tue, Jan 31, 2012 at 4:44 PM, Anshuman Khandual
<khandual@...ux.vnet.ibm.com> wrote:
> On Tuesday 31 January 2012 04:01 PM, Stephane Eranian wrote:
>>>> +};
>>>> +
>>>> +static int
>>>> +parse_branch_stack(const struct option *opt, const char *str, int unset __used)
>>>> +{
>>>> +#define ONLY_PLM \
>>>> + (PERF_SAMPLE_BRANCH_USER |\
>>>> + PERF_SAMPLE_BRANCH_KERNEL |\
>>>> + PERF_SAMPLE_BRANCH_KERNEL)
>>>
>>> I guess this would be PERF_SAMPLE_BRANCH_HV instead of the second
>>> PERF_SAMPLE_BRANCH_KERNEL.
>>>
>> Oops, yes you're right.
>>
>> There is also something else I realized after the fact that needs to
>> be tweaked about
>> BRANCH_HV.
>>
>> The thing is the X86 code is setup to ignore priv levels it does not
>> know about, it seems.
>> Perf does not set exclude_hv by default. Thus in my patch, if the user
>> does not specify
>> any branch priv level, it will default to the level used for the
>> event. That is fine but in the
>> x86 code, I added a sanity check to reject BRANCH_HV because the HW
>> does not support
>> it.
>
> Right. So either we
>
> (1) Set 'exclude_hv' on a X86 system without hypervisor mode (and required HW support) and do the sanity check for BRANCH_HV
>
> or
>
> (2) Do not set 'exclude_hv' (which is happening right now by default) and remove the sanity check
>>I think it should just ignore it. That way, one can do:
>>
>> $ perf record -b any_call -e cycles ls
>>
>> without getting an error (because hv is not supported on branch sampling).
>> Currently, the workaround is to set the priv level on branches:
>>
>> $ perf record -b any_call,u,k -e cycles ls
> --------------------------------
> ./perf record -b any_call -e cycles ls
> ./perf record -b any_call,hv -e cycles ls
>
> Error: sys_perf_event_open() syscall returned with 95 (Operation not supported). /bin/dmesg may provide additional information.
>
> Fatal: No CONFIG_PERF_EVENTS=y kernel support configured?
>
> ls: Terminated
> --------------------------------
>
> However these works absolutely fine
>
> perf record -b any_call,k -e cycles ls
> perf record -b any_call,u -e cycles ls
> perf record -b any_call,u,k -e cycles ls
Yes, because you only get the problem with the kernel has to figure out the
default priv level for the branches.
I want to make this simplest case work:
/perf record -b any_call -e cycles ls
For now, I have reworked the patchset, to ignore hv in the x86 lbr code.
That's the simplest.
> --
> Anshuman Khandual
> Linux Technology Centre
> IBM Systems and Technology Group
>
--
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