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] [day] [month] [year] [list]
Date:   Tue, 6 Jun 2017 22:42:46 +0530
From:   "Naveen N. Rao" <naveen.n.rao@...ux.vnet.ibm.com>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     Ingo Molnar <mingo@...nel.org>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Jiri Olsa <jolsa@...hat.com>, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 1/1] kernel/events: Introduce IOC_COUNT_RECORDS

Hi Peter,

On 2017/06/06 06:17PM, Peter Zijlstra wrote:
> On Tue, Jun 06, 2017 at 08:46:28PM +0530, Naveen N. Rao wrote:
> > Many perf sideband events (context switches, namespaces, ...) are useful
> > by themselves without the need for subscribing to any overflow events.
> > However, it is not possible to subscribe for notifications when such
> > records are logged into the ring buffer. Introduce IOC_COUNT_RECORDS as
> > a way to request this.
> > 
> > With IOC_COUNT_RECORDS set, IOC_REFRESH takes the number of records
> > after which to generate a notification, rather than the number of
> > overflow events.
> 
> You forgot to explain why? As is I'm not terribly excited to have more 
> 'crud' in that output path.

The usecase is a process wanting to profile itself for context switches.  
Currently, there is no way to ask for signals to be delivered for 
PERF_RECORD_SWITCH (or, other sideband) events, except setting 
{watermark=1, wakeup_watermark=1} and using poll()/select(). But, for 
self-profiling, that requires a separate thread to be used.

In addition, it would be easier for user-space to ask for notification 
after a certain number of records, rather than a certain number of 
bytes. This is specifically important for context switch events, since 
we would otherwise not be able to block (context switch out would 
generate an event which would wake us up immediately, interrupting any 
existing system calls).

I have included an example program in the cover letter which 
demonstrates this scenario.

For the above reasons, I felt it would be simpler to extend the use of 
IOC_REFRESH ioctl.

- Naveen

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ