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=-7.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 41F46C4338F for ; Tue, 27 Jul 2021 20:56:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1E2BD60F6C for ; Tue, 27 Jul 2021 20:56:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231270AbhG0U4f (ORCPT ); Tue, 27 Jul 2021 16:56:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229681AbhG0U4f (ORCPT ); Tue, 27 Jul 2021 16:56:35 -0400 Received: from mail-yb1-xb2f.google.com (mail-yb1-xb2f.google.com [IPv6:2607:f8b0:4864:20::b2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07EA3C061757 for ; Tue, 27 Jul 2021 13:56:34 -0700 (PDT) Received: by mail-yb1-xb2f.google.com with SMTP id q15so271066ybu.2 for ; Tue, 27 Jul 2021 13:56:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lYMu/sY1z4ifRcW8GzBl3sFAq3YLkWqzKTTW/VVJUfQ=; b=ntmnfvE/uCne7Fcpx2gbt3g0r8W/bKFfFjshyjT+zji4mqN+YIfnpPVQ1VlUAAuWsU 9vZHjuNAUR52PINM3xyksvj4qTGi+jQ2275CIr5Kc4exV5M6Kof796GZs5zIRW7lGb/Y u08li74k/8QVg5ooP+NZcCYr8xX9M+Wrgh3Qw44V4dyIbvad2+GOiSWtN6q8MQ6p9+h3 9L1utrV1yC5qhwMOWgVmL71dG7+EtpPipeESLmvbGW5Tgz6LlvbNnFegZuya1XydpIQB /NR/nhZnSEUnfddXiBVM7hGgJOiGPuZga24hH8JCzMrL3y2y1UDijTVGYbk/1MGpFZLP P6Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lYMu/sY1z4ifRcW8GzBl3sFAq3YLkWqzKTTW/VVJUfQ=; b=pXcsFUCx2dhOG+L/V+9UfP9Bl5AVSKtfkroYLosa1POfDQCZarkHGe8e3D2r9pizee mXJJPSUWrSt9RPIblHoocLH5dPs4WEVF00JwpvZ3wktoO4yvs/9yfvSJRA2A2ymOoeU3 fXgAIdwYPsGn9WatU+yQUtg7LwSTDNAJH/J01KJmoFdihqpDUXLql/vvwgpv8BR7m/nE /8kvGhTDttCaKUczgsGsbGXHfun/Nas6QG+SDPOj2R1eBDl4ECiYRGaqiD/dfw4XYg41 nUfAXt+2/CwTmwhzG8d3YQkO01EKnC/vCzajctTR7a1xGuZt7KtZNwxKBuWeZw7Ma3dg SgkA== X-Gm-Message-State: AOAM53023KQcjpDaIxaSlrZwfqUv5fFq/iEtUfdLs08Q/BTWMDr57Va9 EHvd0EtAZzAnZLU43m6RlqHsQr78LHgIKT2p+O4= X-Google-Smtp-Source: ABdhPJxNt1H12qGb6lV/ojrbiYzF1EhZ/vCbkbUaT/GYRPBLmFmfj7CNmheKgGvFkorw7btl5uaScZTunZFxVVnHSEE= X-Received: by 2002:a25:2901:: with SMTP id p1mr22851155ybp.459.1627419393225; Tue, 27 Jul 2021 13:56:33 -0700 (PDT) MIME-Version: 1.0 References: <20210726161211.925206-1-andrii@kernel.org> <20210726161211.925206-5-andrii@kernel.org> In-Reply-To: From: Andrii Nakryiko Date: Tue, 27 Jul 2021 13:56:22 -0700 Message-ID: Subject: Re: [PATCH v2 bpf-next 04/14] bpf: implement minimal BPF perf link To: Peter Zijlstra Cc: Andrii Nakryiko , bpf , Alexei Starovoitov , Daniel Borkmann , Kernel Team Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On Tue, Jul 27, 2021 at 2:15 AM Peter Zijlstra wrote: > > On Mon, Jul 26, 2021 at 09:12:01AM -0700, Andrii Nakryiko wrote: > > diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h > > index ad413b382a3c..8ac92560d3a3 100644 > > --- a/include/linux/trace_events.h > > +++ b/include/linux/trace_events.h > > @@ -803,6 +803,9 @@ extern void ftrace_profile_free_filter(struct perf_event *event); > > void perf_trace_buf_update(void *record, u16 type); > > void *perf_trace_buf_alloc(int size, struct pt_regs **regs, int *rctxp); > > > > +int perf_event_set_bpf_prog(struct perf_event *event, struct bpf_prog *prog); > > +void perf_event_free_bpf_prog(struct perf_event *event); > > + > > void bpf_trace_run1(struct bpf_prog *prog, u64 arg1); > > void bpf_trace_run2(struct bpf_prog *prog, u64 arg1, u64 arg2); > > void bpf_trace_run3(struct bpf_prog *prog, u64 arg1, u64 arg2, > > Oh, I just noticed, is this the right header to put these in? Should > this not go into include/linux/perf_event.h ? Not that I care much, but this one has perf_event_attach_bpf_prog() and perf_event_detach_bpf_prog(), so it felt appropriate to put it here. perf_event.h only seems to have perf_event_bpf_event() for BPF-related stuff (which seems to be just notification events, not really BPF functionality per se). But let me know if you prefer to add these new ones to perf_event.h.