Messages in this thread | | | Date | Tue, 31 Jan 2012 21:14:28 +0530 | From | Anshuman Khandual <> | Subject | Re: [PATCH v4 12/18] perf: add support for sampling taken branch to perf record |
| |
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 -- Anshuman Khandual Linux Technology Centre IBM Systems and Technology Group
| |