lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 31 Jan 2012 21:14:28 +0530
From:	Anshuman Khandual <khandual@...ux.vnet.ibm.com>
To:	Stephane Eranian <eranian@...gle.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 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

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ