From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753966AbbJUR0Y (ORCPT ); Wed, 21 Oct 2015 13:26:24 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:33604 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751236AbbJUR0X (ORCPT ); Wed, 21 Oct 2015 13:26:23 -0400 Subject: Re: [PATCH net-next 2/3] bpf: introduce bpf_perf_event_output() helper To: Peter Zijlstra References: <1445396556-4854-1-git-send-email-ast@kernel.org> <1445396556-4854-3-git-send-email-ast@kernel.org> <20151021120636.GB3604@twins.programming.kicks-ass.net> 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 From: Alexei Starovoitov Message-ID: <5627CABD.7030609@plumgrid.com> Date: Wed, 21 Oct 2015 10:26:21 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151021120636.GB3604@twins.programming.kicks-ass.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/21/15 5:06 AM, Peter Zijlstra wrote: >> 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? It works fine with dummy, but user space code looked odd when it perf_event_open-s dummy events and starts reading them. So I thought either to add alias: PERF_COUNT_SW_BPF_OUTPUT = PERF_COUNT_SW_DUMMY or add new number like I did above. New number is cheap and I saw that dummy used for probing, so went with new number to disambiguate.