From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752087AbbATSNi (ORCPT ); Tue, 20 Jan 2015 13:13:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34147 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751317AbbATSNg (ORCPT ); Tue, 20 Jan 2015 13:13:36 -0500 Date: Tue, 20 Jan 2015 19:13:16 +0100 From: Jiri Olsa To: Vince Weaver Cc: linux-kernel@vger.kernel.org, Jiri Olsa , Peter Zijlstra , Arnaldo Carvalho de Melo , Ingo Molnar , Paul Mackerras Subject: Re: perf: behavior of poll() changed in 3.18 Message-ID: <20150120181316.GA12860@krava.brq.redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 20, 2015 at 12:03:19PM -0500, Vince Weaver wrote: > Hello > > Some of my code that used poll() on a perf_event fd broke sometime between > 3.17 and current. (My perf_event_test validation testsuite caught this > too but I haven't been running it as regularly as I should). > > I bisected this to: > > commit 179033b3e064d2cd3f5f9945e76b0a0f0fbf4883 > Author: Jiri Olsa > Date: Thu Aug 7 11:48:26 2014 -0400 > > perf: Add PERF_EVENT_STATE_EXIT state for events with exited task > > > Before, when polling, my code would get a > result=0/WIFEXITED() > return when a child with events being polled exited. > > Now instead I get a > result=1/POLLHUP > return. > > Needless to say this broke my code. Is there a reason this change was > made? hi, I made this change to get notification that monitored process exited. We use it in 'perf record' to find out that we have nothing more to monitor and quit. The logic is to return POLLHUP (via poll syscall) when the monitored process exits for the event. Could you please share your test code? thanks, jirka