Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2470373pxb; Mon, 18 Jan 2021 20:17:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJxes+NfOAlvR9O8czvI0IsCJ7M2TmX+BNwklOuVJGjW8kgXpcvaid8BeqVV0qcOEebqvDzL X-Received: by 2002:a17:906:1987:: with SMTP id g7mr1909136ejd.316.1611029861570; Mon, 18 Jan 2021 20:17:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611029861; cv=none; d=google.com; s=arc-20160816; b=lLiD9gPdTib/fGVrc/cEqFzzeAEVm3a35Y1wXaGPSntagmjVbWruP5QbYDhDFiI0wD gB3lX/VBI2qEohMGkdkrCVZEX3TTr6aPKxQyhc7Fv3dGv2R36Xaui6HagyhsuHh+1WS6 PD84j/1EvgAYwhUCB7nAS3thk+ezlNCHzYE2Pzy4aK21umOxUkkJTUhRwkEYM2ZH6AEx g6lPbz77hluSijgR0xxYjd+rcPgXb6WV0HPinkmkLzTRa122FpRxgxNpKSmNtSxkpC1l TyqTZJVYL6006MuN9/LIcIZAsnOBUVX+L7ytMVDFgdx7EjSXHaPGmsiVXyH2O50oyZCC k8+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=CPFbDEJ4anKjbDRG1spWGGNge5leysn3Sb0uEuAXe/k=; b=oll7sOyDpk3j5A0VqIuZnw/MB9dm+q6aNV4IHOKBKk4z7EPq4LBS1aLm4ZLXx8L7G4 cI69YTI3X2hE36H43k8Bl1Y4RvEsa7F8YGN7vW8NbIGsSnt0z6O1F9GEtDJY01uN2zKh rBJdmtQNe7v7sYvq4VkAlk0F5bjq0ezMLMr3QMEsnsW0FjM76r3gPyDJEI5+w7szoDGK cLWp/8xkImUKA1fRhU7eoVaCcVyQJuUeYxNS79O7836Xl8jQiEbHrxYdOwILhM24hfNA 7EZ9QsBT7Sm0SSVsf3v4TGeuXx0j9X5kE5JEADIwLI9lFcpDORVsn1XkVBvBq4pNuqAG cOGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=R7FPYtLT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w11si8022531ejc.31.2021.01.18.20.17.18; Mon, 18 Jan 2021 20:17:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=R7FPYtLT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389912AbhARM7h (ORCPT + 99 others); Mon, 18 Jan 2021 07:59:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391962AbhARM5j (ORCPT ); Mon, 18 Jan 2021 07:57:39 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A557FC061573 for ; Mon, 18 Jan 2021 04:56:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=CPFbDEJ4anKjbDRG1spWGGNge5leysn3Sb0uEuAXe/k=; b=R7FPYtLTC1BSQOon7pbdZBpLel 1okmV0itamIZ2oYe4Qean2HZ2l4+eZZyniaZWWqi3roQYcO5HGPVYNXChKwD9JNhcmhhh3cJFUbDG KoAYvyTh9wodAphUTWWjuQmUZlSehr6OUVJokv9HxcAaPSxx92TZJWtEj3Y/rEYi8HnyvdM2Ao6NV SVBK8/RcKEYqHXV8DcviNbfWIfNkPKwiLUdo2i49nMJFygJt2Ll408pEHrWhaX4hmlp6JFp4RS8y4 23TpZPmnaUZqn9LXF9vp2XE9thB0Mvnv72PYZjhZyWiwQHRiEA59w8+XejfTYp5mabXTHctjDIz7q dgPLzHvw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1l1U5R-00Cq4E-RL; Mon, 18 Jan 2021 12:56:50 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 39470300F7A; Mon, 18 Jan 2021 13:56:49 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 1E94C2023AA22; Mon, 18 Jan 2021 13:56:49 +0100 (CET) Date: Mon, 18 Jan 2021 13:56:49 +0100 From: Peter Zijlstra To: Namhyung Kim Cc: Arnaldo Carvalho de Melo , Jiri Olsa , Ingo Molnar , Mark Rutland , Alexander Shishkin , LKML , Stephane Eranian , Andi Kleen , Ian Rogers , Alexey Alexandrov Subject: Re: [PATCH] perf/core: Emit PERF_RECORD_LOST for pinned events Message-ID: References: <20210118034323.427029-1-namhyung@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 18, 2021 at 08:44:20PM +0900, Namhyung Kim wrote: > Hi Peter, > > On Mon, Jan 18, 2021 at 7:11 PM Peter Zijlstra wrote: > > > > On Mon, Jan 18, 2021 at 12:43:23PM +0900, Namhyung Kim wrote: > > > As of now we silently ignore pinned events when it's failed to be > > > scheduled and make it error state not try to schedule it again. > > > That means we won't get any samples for the event. > > > > > > But there's no way for users to notice and respond to it. Let's > > > emit a lost event with a new misc bit to indicate this situation. > > > > Users should get a read(2) error IIRC, does that not work? > > Ah, right. maybe I'm too specific to perf record's perspective. > > In perf record, it doesn't use read(2) so I thought it should > have the information in the stream of sample data. perf-record could of course do a read() at the end, to detect this. I don't think I object to having an even in the stream, but your LOST event is unfortunate in that it itself can get lost when there's no space in the buffer (which arguably is unlikely, but still). So from that point of view, I think overloading LOST is not so very nice for this.