From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751473AbdFFRda (ORCPT ); Tue, 6 Jun 2017 13:33:30 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:36617 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751200AbdFFRd3 (ORCPT ); Tue, 6 Jun 2017 13:33:29 -0400 Date: Tue, 6 Jun 2017 23:02:31 +0530 From: "Naveen N. Rao" To: Peter Zijlstra Cc: Ingo Molnar , Arnaldo Carvalho de Melo , Jiri Olsa , linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 1/1] kernel/events: Introduce IOC_COUNT_RECORDS References: <20170606145118.3126-1-naveen.n.rao@linux.vnet.ibm.com> <20170606162537.yapgt72mp3wxr4h7@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170606162537.yapgt72mp3wxr4h7@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.6.2 (2016-07-01) X-TM-AS-MML: disable x-cbid: 17060617-0052-0000-0000-0000024EC540 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17060617-0053-0000-0000-0000082C2175 Message-Id: <20170606173231.GD19390@naverao1-tp.localdomain> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-06-06_12:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1706060302 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2017/06/06 06:25PM, Peter Zijlstra wrote: > On Tue, Jun 06, 2017 at 08:21:18PM +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. > > > > Signed-off-by: Naveen N. Rao > > --- > > include/linux/perf_event.h | 1 + > > include/uapi/linux/perf_event.h | 1 + > > kernel/events/core.c | 16 +++++++++++++++- > > kernel/events/ring_buffer.c | 9 +++++++++ > > 4 files changed, 26 insertions(+), 1 deletion(-) > > > > diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h > > index 24a635887f28..016f2da2bba7 100644 > > --- a/include/linux/perf_event.h > > +++ b/include/linux/perf_event.h > > @@ -683,6 +683,7 @@ struct perf_event { > > struct irq_work pending; > > > > atomic_t event_limit; > > + bool count_records; > > This is an instant nack ;-) Never, that is _never_ use bool in composite > types. Ouch! Sorry. I did briefly consider labeling this 'EARLY RFC', but that still wouldn't have done justice :/ Thanks for the review, - Naveen