Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3222589imu; Fri, 18 Jan 2019 06:54:50 -0800 (PST) X-Google-Smtp-Source: ALg8bN69Yf9WMg84gDftrG96aYDEGRbiwSXbmIIrm1j2Qjd9S3l3JbDiX4QaQp+oq+c7g8kHNmRN X-Received: by 2002:a17:902:8687:: with SMTP id g7mr19352400plo.96.1547823290505; Fri, 18 Jan 2019 06:54:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547823290; cv=none; d=google.com; s=arc-20160816; b=JWdVG4Ty0/Ppoxn6amOGLMz/K34vWvHEmwK7CRUdtu5Bns9y3BmzDC2y0E0FdBckaw y4XHB6pvUE5NgPgwTA8jUSPIFvuHDqvSVN5831jM63skyWHeqSqw78CopdeW4uP0vX+F sip8MpjW+KLRNSPPcsJoYv8SCwvIJ2FK/0z1jN4kqiYZMVeah1KBKWx4Y7Xp6DDzNCmY 5xiEj1VtW4YplZ2GsdAThi0maC/phb8zf36NiMEsqEi3KCKJRZy8xSDrWC4k/gFIqyFY vfSYFC4aX4nlhjd3Tm6MA9LDPX/ZWivvNkNFUviKdPyskKZxrp8UqGDgs+ReinFnf7V/ KiPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=mVUzNLXcpo+LrsfKgiU8Ef+j4LmOp60YjCO25YJ9aXA=; b=TbYtml13q/2i6MsrUH4OmJgEkhLgbmbrKwvbZuk4wFMJ/8x0mbCvdEGrQUf8fIBWot UADgqSXnva+5dC6YSdM0j5UVCE53GH23XAqumivv0oDAtDHDlSJd1zwQIi9D8opShpgS pDnhwPCDYJYsInvQLCm9yiB+EuglpZConMuv140KhUJWKhfZbzlKojfNvUnseeTpMgqR Sr6HcS48Bf24+H6BJQNwL/Jw5oGNyFWzSr2+mK2zYlRZE3/ojGGbg1goe0cfT9Juv2/u hw6C0B2YhFOjtsJoIBnXjPxpC3L8WQ8hDHAstFXFS7eWcZjN3wxeKaNqFaSwdLfvnAi6 rIpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=N1esrmTT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v5si2371625pgh.510.2019.01.18.06.54.32; Fri, 18 Jan 2019 06:54:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=N1esrmTT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728247AbfAROwp (ORCPT + 99 others); Fri, 18 Jan 2019 09:52:45 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:54518 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727563AbfAROwn (ORCPT ); Fri, 18 Jan 2019 09:52:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=mVUzNLXcpo+LrsfKgiU8Ef+j4LmOp60YjCO25YJ9aXA=; b=N1esrmTTEjDH6NcjlyFo2mLxe 7WMh7pjwVpIWt8TRhimS3yuAXmb2K+BXpfE8Pbt6bODCyxnc+e+rfpD00MIRQqAc3LxwxMyW0gk3c 1FfcRlQaEOgsc8x+AG6aXFupmn+x/E65CQG7/J5zgJMO1zNhpl3EhXxzCyeiZdmgNQMpryU2zN//D LJ/o3yVlJpTF0pLu+J4a7idTuZRXsZl3Rc/7z1ZIaRRYSpLcBZPT+6gOW6sI3pGtgs5zavpVs/ihY AVb9truybfyuQgMF3O+jFz+ytxeUOwN/MDbDAwaOrN4lVjruGDBCrM5c0wscwMvSuKpopN2kDLqmi 5SccNXmDA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gkVVf-0007sB-QK; Fri, 18 Jan 2019 14:52:39 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 80FE520289CC4; Fri, 18 Jan 2019 15:52:37 +0100 (CET) Date: Fri, 18 Jan 2019 15:52:37 +0100 From: Peter Zijlstra To: Arnaldo Carvalho de Melo Cc: Ingo Molnar , Alexei Starovoitov , Daniel Borkmann , Jamal Hadi Salim , Linux Kernel Mailing List , Linux Networking Development Mailing List Subject: Re: [PATCH/RFC] Make perf_event_open() propagate errors for use in bpf_perf_event_open() Message-ID: <20190118145237.GD27931@hirez.programming.kicks-ass.net> References: <20190111155538.GX22483@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190111155538.GX22483@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 11, 2019 at 12:55:38PM -0300, Arnaldo Carvalho de Melo wrote: > Hi Peter, > > bpf_perf_event_open() already returns a value, but if > perf_event_output's output_begin (mostly perf_output_begin) fails, > the only way to know about that is looking before/after the rb->lost, > right? > > For ring buffer users that is ok, we'll get a PERF_RECORD_LOST, > etc, but for BPF programs it would be convenient to get that -ENOSPC and > do some fallback, whatever makes sense, like in my augmented_syscalls > stuff for 'perf trace', i.e. don't augment it (i.e. push stuff at the > end of the normal payload), just don't filter the > raw_syscalls:sys_enter, 'perf trace' will get the enter syscall enter > event without the pointer dereference at the end, etc, warn the user but > don't lose a syscall in the strace-like output. > > What do you think? Am I missing something? Probably ;-) Seems ok to do this.