Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1253534ybm; Tue, 21 May 2019 10:59:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqyLcjfJqj7HICpToF1x9r68HBkAwKjGxmKS4Rnapw6FxxYmFTnD/lGlXdM7KjMqANW2zAhT X-Received: by 2002:a65:578b:: with SMTP id b11mr83721024pgr.446.1558461567961; Tue, 21 May 2019 10:59:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558461567; cv=none; d=google.com; s=arc-20160816; b=uFB1tvTZ/UIDam4kqxWdWWYr+ltTKC2zjChlLOze8jZpLu+BNZl+039a8jRnYSUI4E EQGS/ulLPCpvEMWHde+6Et1QfCv5HYocci5uvtppSTELawDErYgcFyFzpG2ZAuRM857O MjHdlqHNbGRi8fPyItVKqW53XYAQL+4ld5W74+fPoSxXTyRRsL0Sjrtr4jgDhGBvncH/ koINYVV6Fy7fDwvk9i9tlWoUuv1Nj2hw3BkSa0IdRJpZeCCvzRbGZP7urn1QH1+bftk2 7ZFHd7k2F2kZqmA235uDzKpWCN/HUdAtyNtL7mvpbf7gAOIYmOgztz2tpiFhbwiQWbVO 0/lQ== 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=FbUU/EROxa+2gIry4MHohDpJnUD0iabB83okgZNIc04=; b=Zwbiy9jl1mW4Ef/6CRFuXxnsbTd6WgLJsu3q6XciUItcNowEAQiUgC+K3kMnKg/6no AUOwOeRo15qJCZ5llT9rFefjKmiX5MgGORgEDVeewskZpKlGRjfmWrwCi6ywjR/8+ToK Pf84u7rbSioA+Mg38kv0/z/fgRtMgKTb5Nrtqmw4EkCtBhA6lW6/ZHTVoMcANodjtO6y LwH4zI/VH+3JbqIbs80lj9TYhN1Tl2PoYMshq3dZ2OyEnGY6NQJIyZPkBlE3ktczWDqp 5m5iobCiNlhUl0Usu3oaVPs9GkW3YKMSityS1soQ+KkUF5vc99uR0UlpS0f1uB6xZ+D5 InxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=A9l63JLo; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d2si20994024plr.138.2019.05.21.10.59.12; Tue, 21 May 2019 10:59:27 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=A9l63JLo; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729258AbfEUR4V (ORCPT + 99 others); Tue, 21 May 2019 13:56:21 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:45885 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726900AbfEUR4V (ORCPT ); Tue, 21 May 2019 13:56:21 -0400 Received: by mail-pg1-f194.google.com with SMTP id i21so8935983pgi.12; Tue, 21 May 2019 10:56:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=FbUU/EROxa+2gIry4MHohDpJnUD0iabB83okgZNIc04=; b=A9l63JLobrODFKSiZjPIwZQwRFFUX/GwQzTZ02aEzGt3720G+1fRDJpZmxQH9KWP/t oXuT/hzpOTcCJAgBGHN63EmpNPuI3lcNWXJ7gO+i72zueZSPTi+X+AoyX6WPAurrOExa IHxk+dneIbgnWAYF7bZr2xjb0TGwtqmTk26VMK68efrkSIrm67ziYaz8XCey733yfORK 3blPoWofHrXEgHwt2x0pBRBgbgPJmi6IhnvZBukzfSs/zNffyTtnyz9vLu3/pq24S/i4 lMW2j3pyeLVb1jhTamJC51XNc6dhDaFkQulDMtqkbgdy3RSSXWuIDubblJoHDhz89Hl8 DqIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=FbUU/EROxa+2gIry4MHohDpJnUD0iabB83okgZNIc04=; b=ZaAzbNBhzBfT2aexHpqDFAWLx135LPtFbXIgmCEMXrb1nxWslkBnLMmLUTH95E57Sj CCmDduoNsIle7oiiLRmkVkgRPpfpJCKnDDqbjL3zYyXI/ufXYSlzpu3AEkMCgH7Dp08m j7NFa30RdxpJUHvk/OrmAjYv63CmxB5fAmHuLmeH48XhzCS7oLzJwAmYfIz6deNZ9OsY D9LLq4YzdvOwdcwXDZwXtgmbDABrtrNxLbEB1rmZ9VKYJne+99giL71A/7qOE/e0V5Pn TFIkiW5Q0vwLePXVZCIVQVY5Bl861+Vhavh/9kT2XH+YmDOTSf8AlK62lglaDmkASKj6 R5lA== X-Gm-Message-State: APjAAAWnAYjpaDzM6NPEVLy6pVPHzZ/B4IB7L8sm+1cSUmmJEShTWBBk j8Q/I9ey5FCcgLIHKSkyt2VLbW5S X-Received: by 2002:a62:1b85:: with SMTP id b127mr61348467pfb.165.1558461380471; Tue, 21 May 2019 10:56:20 -0700 (PDT) Received: from ast-mbp.dhcp.thefacebook.com ([2620:10d:c090:200::1:1eff]) by smtp.gmail.com with ESMTPSA id i12sm26796352pfd.33.2019.05.21.10.56.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 May 2019 10:56:19 -0700 (PDT) Date: Tue, 21 May 2019 10:56:18 -0700 From: Alexei Starovoitov To: Kris Van Hees Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, dtrace-devel@oss.oracle.com, linux-kernel@vger.kernel.org, rostedt@goodmis.org, mhiramat@kernel.org, acme@kernel.org, ast@kernel.org, daniel@iogearbox.net, peterz@infradead.org Subject: Re: [RFC PATCH 00/11] bpf, trace, dtrace: DTrace BPF program type implementation and sample use Message-ID: <20190521175617.ipry6ue7o24a2e6n@ast-mbp.dhcp.thefacebook.com> References: <201905202347.x4KNl0cs030532@aserv0121.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201905202347.x4KNl0cs030532@aserv0121.oracle.com> User-Agent: NeoMutt/20180223 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 20, 2019 at 11:47:00PM +0000, Kris Van Hees wrote: > > 2. bpf: add BPF_PROG_TYPE_DTRACE > > This patch adds BPF_PROG_TYPE_DTRACE as a new BPF program type, without > actually providing an implementation. The actual implementation is > added in patch 4 (see below). We do it this way because the > implementation is being added to the tracing subsystem as a component > that I would be happy to maintain (if merged) whereas the declaration > of the program type must be in the bpf subsystem. Since the two > subsystems are maintained by different people, we split the > implementing patches across maintainer boundaries while ensuring that > the kernel remains buildable between patches. None of these kernel patches are necessary for what you want to achieve. Feel free to add tools/dtrace/ directory and maintain it though. The new dtrace_buffer doesn't need to replicate existing bpf+kernel functionality and no changes are necessary in kernel/events/ring_buffer.c either. tools/dtrace/ user space component can use either per-cpu array map or hash map as a buffer to store arbitrary data into and use existing bpf_perf_event_output() to send it to user space via perf ring buffer. See, for example, how bpftrace does that.