From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754751AbbJUMGu (ORCPT ); Wed, 21 Oct 2015 08:06:50 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:47746 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754664AbbJUMGs (ORCPT ); Wed, 21 Oct 2015 08:06:48 -0400 Date: Wed, 21 Oct 2015 14:06:36 +0200 From: Peter Zijlstra To: Alexei Starovoitov Cc: "David S. Miller" , Ingo Molnar , Wang Nan , He Kuang , Arnaldo Carvalho de Melo , Daniel Borkmann , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next 2/3] bpf: introduce bpf_perf_event_output() helper Message-ID: <20151021120636.GB3604@twins.programming.kicks-ass.net> References: <1445396556-4854-1-git-send-email-ast@kernel.org> <1445396556-4854-3-git-send-email-ast@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1445396556-4854-3-git-send-email-ast@kernel.org> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 20, 2015 at 08:02:34PM -0700, Alexei Starovoitov wrote: > This helper is used to send raw data from eBPF program into > special PERF_TYPE_SOFTWARE/PERF_COUNT_SW_BPF_OUTPUT perf_event. > User space needs to perf_event_open() it (either for one or all cpus) and > store FD into perf_event_array (similar to bpf_perf_event_read() helper) > before eBPF program can send data into it. > > diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h > index 2881145cda86..d3c417615361 100644 > --- a/include/uapi/linux/perf_event.h > +++ b/include/uapi/linux/perf_event.h > @@ -110,6 +110,7 @@ enum perf_sw_ids { > PERF_COUNT_SW_ALIGNMENT_FAULTS = 7, > PERF_COUNT_SW_EMULATION_FAULTS = 8, > PERF_COUNT_SW_DUMMY = 9, > + PERF_COUNT_SW_BPF_OUTPUT = 10, > > PERF_COUNT_SW_MAX, /* non-ABI */ > }; Do you really need the new type? Can't you use DUMMY for this?