Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1430281pxp; Sun, 6 Mar 2022 15:15:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJwTgOYq4lV7gnmgANoE+1IuIzSRgzmdXMU2nUnScgqFvJq3DtLtc0liMfWlhbe1U4aBInWg X-Received: by 2002:a05:6402:2987:b0:414:39b0:7fc1 with SMTP id eq7-20020a056402298700b0041439b07fc1mr8569373edb.214.1646608542259; Sun, 06 Mar 2022 15:15:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646608542; cv=none; d=google.com; s=arc-20160816; b=K0tvdiXRRmuFnFQD96cowgq/7Wz8GURueOhH7hUYy2fT7JcUnX+HMjESWt8pBmfQyG Q5GLMZBXEPgv9hn1EKj6tTc1tOhR3FPwL04r3QQg8Mfc4l39TABxLTQj9nbbWKcw8jAL KcTsJEri9iT7KD8ikXGewhKHPdzcT3GF7U3Do2tMZcREdo0pKXlv7eu65UaQbywvB7tw Jxn1zAQTydtcsXEo8kJaEV3snx4PAPNNjVDoIzRnjotgWIOP1kn9nFdunhSgwydlzfxg rgOcOEW/cIKx/mRz6q326sJptmfFsbN9sp43JDDVwH5l/tvr0DL7CclEkSFse/nj+Pob r5jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=vCBQy4KJqltdm7PE5T/0bIOOTxlcDLe86iRXNeiB2y8=; b=F5IObguGzH9K1of5Ht8EUxQcPrM71Q092xnY7R/LzsMBr86T8gz5E3OLH0GY4IVvSY kl9G2D2d01eO3qvlQT3sjLV1r18QB+Sryot0ytj2l0PWV0epUbnJjB9HamrQnGnZMYQM p2P+kdho1NvRJvIvAwDqfzmyAPwhW0gejdbnqtt1A3TsYAVgPm1197zg3kwsZubqUxJr rJsRIFf3JN7gdPIm8i2hfiVaEt6dNLxPCOjbInwLqdscy5fXrhvk128TKYBGGSvDpXnh Nx6NIA9lft72nD9SXtCLXf2UIYNmrDztmq5rGV+7x6Y+kB6ZbCYPMXViUGx89sJzgi13 GcGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="fEZugXS/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h17-20020a05640250d100b00415ed5193d3si6898189edb.498.2022.03.06.15.15.08; Sun, 06 Mar 2022 15:15:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="fEZugXS/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S233911AbiCFRaO (ORCPT + 99 others); Sun, 6 Mar 2022 12:30:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233910AbiCFRaM (ORCPT ); Sun, 6 Mar 2022 12:30:12 -0500 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E216286CC; Sun, 6 Mar 2022 09:29:18 -0800 (PST) Received: by mail-wm1-x32f.google.com with SMTP id q7-20020a7bce87000000b00382255f4ca9so9517064wmj.2; Sun, 06 Mar 2022 09:29:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=vCBQy4KJqltdm7PE5T/0bIOOTxlcDLe86iRXNeiB2y8=; b=fEZugXS/OIKaS3ixfXmb61G2hogkvJM/sDl1zeG4KZtFB9IA4RqbL0v9tmvCtB/9cG CulivxeOCACF83ITc/Itlgfoa89BCG8x6BVpa7QsBrrCqRAS5mSeBVTcx21UKQglafO9 u6UTgrogZ9vVYo6Jpku2R7kPMsS7EEfdJtw3+SzX2DJtExXoGBKvQxgQy3dCuKS9sF8B amLHQvYNSImD/ShE48SajnTNT1Us+4y05HR5kgIyEKn7irLWja2spesk/DT+epNSEMua hou54Sx51i/eSs8b5vroDkZ5FlihcKuiNGlo26Fxr3W0ZBk7GV9LWtYeDh7urFHQNiAw aq4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=vCBQy4KJqltdm7PE5T/0bIOOTxlcDLe86iRXNeiB2y8=; b=LIOF/Zv3DWwtnX1ccGX8OISOgp26dX3HwM2Jq2Yfzwi81PrddBdjNw9h1348JqsxzE rTW+ePIMvT3tXCCJZi06GCsFqKgrvRojcLQ9EM3v5FejfrpI/LAtlHLqWZn2pdMGsTUE wiD2KT1dOAiqVOiKQZYJthUJ14hJpEyr/blROpz559kndbd3epkZ+m+nfeOwQgd2Y7V8 aw8cvKR67TI5qNh1N8deUi2FdW1Ql1rL1lWmRoMzM7VaCekJYOAPBZDOyadM3kzhjp7D a764ZanFpIGsHHoLTN40W+AyzqMYTfsBhMo+VzafDmlbtI1Pt7MybgvTzn2BQ19WJRVe /yqA== X-Gm-Message-State: AOAM531jpQGh0NfyfanyRFK2/5EkxQUaCcYhQcqtBu1o6arFltzuXZdN u0C233y9aykuLPVN6L8yh80= X-Received: by 2002:a05:600c:1da7:b0:381:2262:56d2 with SMTP id p39-20020a05600c1da700b00381226256d2mr15496337wms.133.1646587756666; Sun, 06 Mar 2022 09:29:16 -0800 (PST) Received: from krava ([193.85.244.190]) by smtp.gmail.com with ESMTPSA id k10-20020adfe3ca000000b001f0329ba94csm15083787wrm.18.2022.03.06.09.29.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Mar 2022 09:29:16 -0800 (PST) Date: Sun, 6 Mar 2022 18:29:14 +0100 From: Jiri Olsa To: Andrii Nakryiko Cc: Jiri Olsa , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Masami Hiramatsu , Networking , bpf , lkml , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Steven Rostedt Subject: Re: [PATCH 07/10] libbpf: Add bpf_link_create support for multi kprobes Message-ID: References: <20220222170600.611515-1-jolsa@kernel.org> <20220222170600.611515-8-jolsa@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 04, 2022 at 03:11:16PM -0800, Andrii Nakryiko wrote: > On Tue, Feb 22, 2022 at 9:07 AM Jiri Olsa wrote: > > > > Adding new kprobe_multi struct to bpf_link_create_opts object > > to pass multiple kprobe data to link_create attr uapi. > > > > Signed-off-by: Jiri Olsa > > --- > > tools/lib/bpf/bpf.c | 7 +++++++ > > tools/lib/bpf/bpf.h | 9 ++++++++- > > 2 files changed, 15 insertions(+), 1 deletion(-) > > > > diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c > > index 418b259166f8..5e180def2cef 100644 > > --- a/tools/lib/bpf/bpf.c > > +++ b/tools/lib/bpf/bpf.c > > @@ -853,6 +853,13 @@ int bpf_link_create(int prog_fd, int target_fd, > > if (!OPTS_ZEROED(opts, perf_event)) > > return libbpf_err(-EINVAL); > > break; > > + case BPF_TRACE_KPROBE_MULTI: > > + attr.link_create.kprobe_multi.syms = OPTS_GET(opts, kprobe_multi.syms, 0); > > + attr.link_create.kprobe_multi.addrs = OPTS_GET(opts, kprobe_multi.addrs, 0); > > + attr.link_create.kprobe_multi.cookies = OPTS_GET(opts, kprobe_multi.cookies, 0); > > + attr.link_create.kprobe_multi.cnt = OPTS_GET(opts, kprobe_multi.cnt, 0); > > + attr.link_create.kprobe_multi.flags = OPTS_GET(opts, kprobe_multi.flags, 0); > > + break; > > default: > > if (!OPTS_ZEROED(opts, flags)) > > return libbpf_err(-EINVAL); > > diff --git a/tools/lib/bpf/bpf.h b/tools/lib/bpf/bpf.h > > index 16b21757b8bf..bd285a8f3420 100644 > > --- a/tools/lib/bpf/bpf.h > > +++ b/tools/lib/bpf/bpf.h > > @@ -413,10 +413,17 @@ struct bpf_link_create_opts { > > struct { > > __u64 bpf_cookie; > > } perf_event; > > + struct { > > + __u64 syms; > > + __u64 addrs; > > + __u64 cookies; > > hm, I think we can and should use proper types here, no? > > const char **syms; > const void **addrs; > const __u64 *cookies; > > ? right, will change thanks, jirka