From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB8AAC3A59D for ; Thu, 22 Aug 2019 07:47:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B5B8D206BB for ; Thu, 22 Aug 2019 07:47:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="0QYEvGju" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725857AbfHVHrw (ORCPT ); Thu, 22 Aug 2019 03:47:52 -0400 Received: from merlin.infradead.org ([205.233.59.134]:53872 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725797AbfHVHrw (ORCPT ); Thu, 22 Aug 2019 03:47:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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=EmuC6Fpk11rSVocpKbT8KYAej4t4mP+c/Oiv8Dne6MM=; b=0QYEvGjuKtc+q7j2b3hiPyDeJ mg+zKCYg+iMWtehpQ0UGDVQL+lL8lvCqx+Ir/+dDLouDYR3kku+370uVmT8IlsWWLWt5c+aUW1S2+ sOf23i/MrMkrfQ3ovgUWXSatBtVcvNoZYkZ+e9qSoJlBEqe6YW68A9ifz1pjxe2WlqFJuT0vxJl89 9e6aFuKufIXKwAkuD2WVUHN8ZjgzpMaRbhcLwTCUVlOl7Vp8CJDYIR3QjhwrUYjDwK2y+ME2HWrQd gbAWnBGY7KAl4H/UwgZJ5Jc+UznTzMhWTu+YeFw0vsuYvWqRu4Lnv6yiSZxHdOzfxg10axRX22vH1 EX2KcvCgA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1i0hoq-0000Bt-PY; Thu, 22 Aug 2019 07:47:41 +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 E693A307598; Thu, 22 Aug 2019 09:47:05 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 9034020C3BF31; Thu, 22 Aug 2019 09:47:37 +0200 (CEST) Date: Thu, 22 Aug 2019 09:47:37 +0200 From: Peter Zijlstra To: Yonghong Song Cc: Daniel Xu , "bpf@vger.kernel.org" , Song Liu , Andrii Nakryiko , "mingo@redhat.com" , "acme@kernel.org" , Alexei Starovoitov , "alexander.shishkin@linux.intel.com" , "jolsa@redhat.com" , "namhyung@kernel.org" , "linux-kernel@vger.kernel.org" , Kernel Team , Arnaldo Carvalho de Melo Subject: Re: [PATCH v3 bpf-next 1/4] tracing/probe: Add PERF_EVENT_IOC_QUERY_PROBE ioctl Message-ID: <20190822074737.GG2349@hirez.programming.kicks-ass.net> References: <20190820144503.GV2332@hirez.programming.kicks-ass.net> <20190821110856.GB2349@hirez.programming.kicks-ass.net> <62874df3-cae0-36a1-357f-b59484459e52@fb.com> <20190821183155.GE2349@hirez.programming.kicks-ass.net> <5ecdcd72-255d-26d1-baf3-dc64498753c2@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5ecdcd72-255d-26d1-baf3-dc64498753c2@fb.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On Wed, Aug 21, 2019 at 06:43:49PM +0000, Yonghong Song wrote: > On 8/21/19 11:31 AM, Peter Zijlstra wrote: > > So extending PERF_RECORD_LOST doesn't work. But PERF_FORMAT_LOST might > > still work fine; but you get to implement it for all software events. > > Could you give more specifics about PERF_FORMAT_LOST? Googling > "PERF_FORMAT_LOST" only yields two emails which we are discussing here :-( Look at what the other PERF_FORMAT_ flags do? Basically it is adding a field to the read(2) output. > >> Maybe we can still use ioctl based approach which is light weighted > >> compared to ring buffer approach? If a fd has bpf attached, nhit/nmisses > >> means the kprobe is processed by bpf program or not. > > > > There is nothing kprobe specific here. Kprobes just appear to be the > > only one actually accounting the recursion cases, but everyone has > > them. > > Sorry to be specific, kprobe is just an example, I actually refers to > any perf event where bpf can attach to, which theoretically are any > perf events which can be opened with "perf_event_open" syscall although > some of them (e.g., software events?) may not have bpf running hooks yet. Yes, BPF is sucky that way.