Re: [PATCH 0/2] Notifications for perf sideband events

From: Naveen N. Rao
Date: Thu Jul 13 2017 - 10:21:07 EST



[ Adding Vince...]


On 2017/07/12 12:48PM, Jiri Olsa wrote:
> On Mon, Jun 19, 2017 at 08:01:06PM +0530, Naveen N. Rao wrote:
> > Currently, there is no way to ask for signals to be delivered when a
> > certain number of sideband events have been logged into the ring buffer.
> > This is problematic if we are only interested in, say, context switch
> > events. Furthermore, signals are more useful (rather than polling) for
> > self-profiling. This series provides for a way to achieve this.
> >
> > We ride on top of the existing support for ring buffer wakeup to
> > generate signals as desired. Counting sideband events still requires
> > some changes in the output path, but in normal cases, it ends up being
> > just a comparison.
> >
> > The test program below demonstrates how a process can profile itself for
> > context switch events and how it can control notification through
> > signals. The key changes include the below perf_event_attr settings as
> > well as use of IOC_ENABLE:
> > pe.signal_on_wakeup = 1;
> > pe.count_sb_events = 1;
> > pe.wakeup_events = 2;
>
> Vince,
> could you please check on this? thanks
>
> Naveen,
> have you run Vince's test suite on this?
> http://github.com/deater/perf_event_tests.git

I just tried this and I see quite a few failures even without these
patches.

The behavior is similar with/without these patches and all the ioctl
tests pass, but I see some failures with the overflow tests. I'll look
into those tests in detail tomorrow. I may be missing something.


Thanks,
Naveen