Re: [PATCH 0/2] perf_counter: fix the group mess

From: Peter Zijlstra
Date: Wed Aug 12 2009 - 12:01:41 EST


On Wed, 2009-08-12 at 17:54 +0200, stephane eranian wrote:
> On Wed, Aug 12, 2009 at 5:35 PM, Peter Zijlstra<a.p.zijlstra@xxxxxxxxx> wrote:
> >
> > With these two patches the below proglet gives:
> >
> > # ./test
> > EVNT: 0xffffffff811c0f4c scale: nan ID: 37 CNT: 1006180 ID: 38 CNT: 1010230 ID: 39 CNT: 1010332 ID: 40 CNT: 1010420
> >
> > I can't seem to catch the SIGIO thing, but at least all the counters report
>
> I think it's because you are missing this fcntl() call to get async
> notification:
>
> ret = fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_ASYNC);
> if (ret == -1)
> err(1, "cannot set ASYNC");

Ah, indeed, thanks!

(with a reduced work function, or increased period)

# gcc -o test test.c; ./test
signal
signal
signal
signal
signal
signal
EVNT: 0x40091c scale: nan ID: 49 CNT: 1006676 ID: 50 CNT: 1010796 ID: 51 CNT: 1010960 ID: 52 CNT: 1010937
EVNT: 0x400928 scale: 1.000000 ID: 49 CNT: 2003019 ID: 50 CNT: 2010882 ID: 51 CNT: 2011475 ID: 52 CNT: 2012032
EVNT: 0x400928 scale: 1.000000 ID: 49 CNT: 3002707 ID: 50 CNT: 3015571 ID: 51 CNT: 3016714 ID: 52 CNT: 3017830
EVNT: 0x400916 scale: 1.000000 ID: 49 CNT: 4002677 ID: 50 CNT: 4020137 ID: 51 CNT: 4021880 ID: 52 CNT: 4023639
EVNT: 0x40091c scale: 1.000000 ID: 49 CNT: 5002749 ID: 50 CNT: 5024707 ID: 51 CNT: 5027078 ID: 52 CNT: 5029378
EVNT: 0x40091c scale: 1.000000 ID: 49 CNT: 6002799 ID: 50 CNT: 6029452 ID: 51 CNT: 6032339 ID: 52 CNT: 6035277


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/