Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1701554imu; Sat, 12 Jan 2019 06:01:24 -0800 (PST) X-Google-Smtp-Source: ALg8bN4NGlHp5K1NWwC85dxUJ1vQcXp4hd1ef8iURF1Yyow4LIc1gXa3WZmw8lRUy/Y7aAroHs1G X-Received: by 2002:a63:4a4d:: with SMTP id j13mr14930548pgl.127.1547301684669; Sat, 12 Jan 2019 06:01:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547301684; cv=none; d=google.com; s=arc-20160816; b=yY3TLswxLXnn4mXDWvycwUvePDmRL7GoCdsZIatcm59oqGeR+KKRLK2P3zdyaOV3Fc Tt0L8dH0JN/9B3/ZkTxSIF08e9hrp6TUjqx6lvuPxhy+FLFM/818acV6fkJt646Pa+8o yM+HGyeWW2KDxJbb+KpZ9d+JgTUMzT2OpFllWSooLFoI7tIwGeTAutf0AuOsnJr2lScm zUugr95UTOlbuW+0fXr3uX3+TL3Rl3cUbD9RytbucTv+Ly/77+B/UO721XhaL3cdVAx9 9FMix7i3LMNkXaiqs8nhlMMgS6aDf7ExKCSwvLUvrBwin04tshwX1GDXrPVfaw0q+35e bniA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=n4FYB8axrV+9C+zBDYMhP9KTrRYzd7Hzktn646gZa/k=; b=Kk5QoeG/2NJMCOF3PviGmSooqVrjDedOqHxhNYkNzt6TtI1/zfbqMK9Kcct73/cxoj ohg+OcclQzN/yEfpzd75RottA8Q7to8W72/v7wktgcMpnwkK6GhUMQju7+dMDQyLaAS+ WgHY1Arar2h/ZYUXSATVhWS3O/ZsmETuTqMVSi9QW+T6Lnac++CVHi7w51TxBQeYQf9p DuZxywxUlP0qpSgXTWdmwe5IVxnvjUvTEQdmp3jiXR4i/W6eGHS+EN1Gg5ZdHXpJrAmf i6oMpySbNlPLgG1os3239KqAtTUZYeGiyb8/cjj2YheLHcMhrb6OeJydeoH8Zcz089BG HJKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mojatatu-com.20150623.gappssmtp.com header.s=20150623 header.b=uHENRo29; 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 f75si5968808pff.131.2019.01.12.06.01.06; Sat, 12 Jan 2019 06:01:24 -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=pass header.i=@mojatatu-com.20150623.gappssmtp.com header.s=20150623 header.b=uHENRo29; 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 S1725855AbfALN7p (ORCPT + 99 others); Sat, 12 Jan 2019 08:59:45 -0500 Received: from mail-it1-f194.google.com ([209.85.166.194]:56150 "EHLO mail-it1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725827AbfALN7p (ORCPT ); Sat, 12 Jan 2019 08:59:45 -0500 Received: by mail-it1-f194.google.com with SMTP id m62so7038442ith.5 for ; Sat, 12 Jan 2019 05:59:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mojatatu-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=n4FYB8axrV+9C+zBDYMhP9KTrRYzd7Hzktn646gZa/k=; b=uHENRo29L3D4xjTlZnFmmYnHm2sIRHEhtkRnlzOSfiDi1z4BaYIhS09scTPVlwjGAU mE4b5/6cEeGpHaFlAxysmqocXtLoGJTVN6SQc5ntWTB4xIhjxlxbT1nt/fejH9NEyyem gB0+OS6EVLidiNH6dhUIhC+UDa1Uq3HAAbSAIA6utRE1VATPqXZcMDEgz4dpEPjoJ/oW PuEsWhokObsTP1ZFNIVYU5ddHWzXchhETrucurT2BMFDByZ1jjjr0oLGm+tIY/mkHq/G a6K8w4jjNOngZMpgzr2O2DluyGzjWmgjTzApoYmZMjQ17Y4IiP+HK2/+D8DvG6/B93vp k7lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=n4FYB8axrV+9C+zBDYMhP9KTrRYzd7Hzktn646gZa/k=; b=RPVbQXtShSM+FGmv9OU6o+Ad7DuWjQcJKGeHMOsj1EPDj2JcPucd+/nZyPURqze9yy ucStXF+jJ8ioKCVU5fIpJvGGUYyOFweI20n5gE0xlrNonRLXFjiy/3WqtmdeL0c5MC5/ k6FkPsBUOIVyCGBxRN02rmiP+CM4glmnbuML9kmGqI2D4eujW0zTTMJeDZQUKa63WVzX XED8TYGmAvx4MdMFkpx/IO9HLNJJC5kW/MdeI9uBxGiEi+lUT8VQqvIFX3tFJiWx7Jjq H0F9c3KZQ0svu+KuLtPcXbvXhvLV2mTPM83rYmyLB1uf6aaAljeLmWkR2DY7+LycSJbg gr4w== X-Gm-Message-State: AJcUukfbx/flp8AHl3undw9EyynytSp9gXMBmhP3xqLFQqXhFthsBOmS 5qBkhK1r20AxnKoniE2xlLExsw== X-Received: by 2002:a02:8a69:: with SMTP id e38mr13166408jal.81.1547301583965; Sat, 12 Jan 2019 05:59:43 -0800 (PST) Received: from [10.0.0.135] (24-212-162-241.cable.teksavvy.com. [24.212.162.241]) by smtp.googlemail.com with ESMTPSA id y23sm5501330ita.1.2019.01.12.05.59.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 12 Jan 2019 05:59:42 -0800 (PST) Subject: Re: [PATCH/RFC] Make perf_event_open() propagate errors for use in bpf_perf_event_open() To: Arnaldo Carvalho de Melo , Peter Zijlstra Cc: Ingo Molnar , Alexei Starovoitov , Daniel Borkmann , Linux Kernel Mailing List , Linux Networking Development Mailing List References: <20190111155538.GX22483@kernel.org> From: Jamal Hadi Salim Message-ID: Date: Sat, 12 Jan 2019 08:59:41 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190111155538.GX22483@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-01-11 10:55 a.m., 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 ;-) > > Ah, its just test built. Works as advertised ;-> Tested-by: Jamal Hadi Salim cheers, jamal