Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5527332pxb; Wed, 26 Jan 2022 14:11:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJxEBkfk0m2aluYguFWyxQTy7qMC1e8WN2TDpgzTx3KuRoKPNh4IYTvxBYNFRhvdTatxNyEt X-Received: by 2002:a50:858b:: with SMTP id a11mr948332edh.303.1643235081889; Wed, 26 Jan 2022 14:11:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643235081; cv=none; d=google.com; s=arc-20160816; b=jObmt+d9kIdLzKS+aYdFo6j7QiaAStaCTqJZznEeR12GABUppgAC6cu0JZZDp1oTAA l0d5EpVPq5416yazAh1v63H7y+u8c1k+lotUAcDnDfseilR9gOYdjS2awl266qrUeYqY KMjRzlXAgCIqEhwPN5Qy8NvZTtNPyc4UkqDCiajYcYb0ZnkRrDGqUQBaLwLZFoxOsEzc EeLs/WWaniaDmIho/lJ6yM9Ql4BGrmJP7jEvXjtZEqSAb7y54I3ghdzkBoguxFQkBVeV 9iVfvfb1F++T1K72Iiwx7nACzcFvZex8jrw62VO+r2gmMYLjJEGUyrHxQTxV7O9jWObN wAbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=04DsGcoeiV1UKOshEfwnr8b9BbL8Aqn+qfurJw8kMKI=; b=D+2tAV2xCh8HAk5yyWRA7kL5+LEAtZHz4cKKtqIBgAHp/eD5VsOT90iUJlWK0HNHO6 TWfHPNvCC79c27Ho86Udf/vHLvnhqaJHlUsMVj7qvTfvubuFntEdE0ijvlLKTJ0msJgA mQPj2xiVl7JWdMLf9kVFNFGNmgs7hAHN65WA0XzEPv/D31CK5OzdPvB79ZR+yQqKcl9r EOmUsOrY6vlddiYV6fSbHTtABjTB2K+c8oOuQktClBcx2hlNRWA7xQkkeMdgMBA6apyS mglkJaw6qH782bghOYXZjbZ46YPMUwDVsco92OHSTNTT/XU86FzdwAvg9K3aoNtUnTIA aX6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nWldkKNr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id du21si292413ejc.54.2022.01.26.14.10.56; Wed, 26 Jan 2022 14:11:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nWldkKNr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233469AbiAZQAC (ORCPT + 99 others); Wed, 26 Jan 2022 11:00:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229764AbiAZQAB (ORCPT ); Wed, 26 Jan 2022 11:00:01 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E162C06161C; Wed, 26 Jan 2022 08:00:01 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C079CB81F03; Wed, 26 Jan 2022 15:59:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D4E9CC340E6; Wed, 26 Jan 2022 15:59:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643212798; bh=X+RmX5LveR/DElha+H9g+z55A6Rjf/XcNDFPYxv/WHk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=nWldkKNrXR+KFVYNGhlWGOo0277tEiT3oaCIKp3KoD/Ux7kulKTIzau9dhz3Dgx+r jmS8Y9zjmJpEFfJduRqsoZg0jqGJ96f7XXfaKMUo8e+v4PLuY6fm7QbSLg5siQ6gHk n6cwv99n7eNy45xPNXt5FubG7ffOczJ+2y68v57Bacorf3/ajYTWeD5l4I6Dplf/yd QfhbDhcnS0TGGtcihwq+gYRO1tVi6TAvpo8jOufEVsGAuY6WRV3HvQUj6j+FTZtwDw /o+G1tckj1rPi0u9tpI7OunrCnDmc3rNVKoR+aynKTd0J38NDy+TlVa3rqNpUZ2its yCGHK5c0jVe4w== Date: Thu, 27 Jan 2022 00:59:52 +0900 From: Masami Hiramatsu To: Masami Hiramatsu Cc: Jiri Olsa , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , netdev@vger.kernel.org, bpf@vger.kernel.org, lkml , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Steven Rostedt , "Naveen N . Rao" , Anil S Keshavamurthy , "David S . Miller" Subject: Re: [PATCH v5 2/9] fprobe: Add ftrace based probe APIs Message-Id: <20220127005952.42dd07ff5f275e61be638283@kernel.org> In-Reply-To: <20220126115022.fda21a3face4e97684f5bab9@kernel.org> References: <164311269435.1933078.6963769885544050138.stgit@devnote2> <164311271777.1933078.9066058105807126444.stgit@devnote2> <20220126115022.fda21a3face4e97684f5bab9@kernel.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 26 Jan 2022 11:50:22 +0900 Masami Hiramatsu wrote: > > one more question.. > > > > I'm adding support for user to pass function symbols to bpf fprobe link > > and I thought I'd pass symbols array to register_fprobe, but I'd need to > > copy the whole array of strings from user space first, which could take > > lot of memory considering attachment of 10k+ functions > > > > so I'm thinking better way is to resolve symbols already in bpf fprobe > > link code and pass just addresses to register_fprobe > > That is OK. Fprobe accepts either ::syms or ::addrs. > > > > > I assume you want to keep symbol interface, right? could we have some > > flag ensuring the conversion code is skipped, so we don't go through > > it twice? > > Yeah, we still have many unused bits in fprobe::flags. :) Instead of that, according to Steve's comment, I would like to introduce 3 registration APIs. int register_fprobe(struct fprobe *fp, const char *filter, const char *notrace); int register_fprobe_ips(struct fprobe *fp, unsigned long *addrs, int num); int register_fprobe_syms(struct fprobe *fp, const char **syms, int num); The register_fprobe_ips() will not touch the @addrs. You have to set the correct ftrace location address in the @addrs. Thank you, -- Masami Hiramatsu