From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753966AbaIOK3x (ORCPT ); Mon, 15 Sep 2014 06:29:53 -0400 Received: from mail-oa0-f45.google.com ([209.85.219.45]:59795 "EHLO mail-oa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751541AbaIOK3v (ORCPT ); Mon, 15 Sep 2014 06:29:51 -0400 MIME-Version: 1.0 In-Reply-To: References: <20140908124945.GD17728@krava.brq.redhat.com> <20140908143107.GG17728@krava.brq.redhat.com> <20140908152206.GH6758@twins.programming.kicks-ass.net> Date: Mon, 15 Sep 2014 12:29:51 +0200 Message-ID: Subject: Re: [PATCH] perf: Do not check PERF_EVENT_STATE_EXIT on syscall read path From: Stephane Eranian To: Peter Zijlstra Cc: Jiri Olsa , LKML , "mingo@elte.hu" , Arnaldo Carvalho de Melo , Namhyung Kim , "ak@linux.intel.com" , David Ahern Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 10, 2014 at 3:49 PM, Stephane Eranian wrote: > > Peter, > > > > On Mon, Sep 8, 2014 at 5:22 PM, Peter Zijlstra wrote: > > On Mon, Sep 08, 2014 at 04:31:07PM +0200, Jiri Olsa wrote: > >> Revert PERF_EVENT_STATE_EXIT check on read syscall path. > >> It breaks standard way to read counter, which is to open > >> the counter, wait for the monitored process to die and > >> read the counter. > >> > >> Reported-by: Stephane Eranian > >> Acked-by: Stephane Eranian > >> Cc: Arnaldo Carvalho de Melo > >> Cc: Frederic Weisbecker > >> Cc: Ingo Molnar > >> Cc: Paul Mackerras > >> Cc: Peter Zijlstra > >> Cc: Stephane Eranian > >> Signed-off-by: Jiri Olsa > > > > Thanks! > Still don't see this fix in tip.git. > Still not there. This is a problem. > > >> --- > >> kernel/events/core.c | 3 +-- > >> 1 file changed, 1 insertion(+), 2 deletions(-) > >> > >> diff --git a/kernel/events/core.c b/kernel/events/core.c > >> index d8cb4d21a346..6d1c9ce1643e 100644 > >> --- a/kernel/events/core.c > >> +++ b/kernel/events/core.c > >> @@ -3600,8 +3600,7 @@ perf_read_hw(struct perf_event *event, char __user *buf, size_t count) > >> * error state (i.e. because it was pinned but it couldn't be > >> * scheduled on to the CPU at some point). > >> */ > >> - if ((event->state == PERF_EVENT_STATE_ERROR) || > >> - (event->state == PERF_EVENT_STATE_EXIT)) > >> + if (event->state == PERF_EVENT_STATE_ERROR) > >> return 0; > >> > >> if (count < event->read_size) > >> -- > >> 1.8.3.1 > >>