Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp25100iob; Wed, 27 Apr 2022 18:01:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvy4MTMnhyDARczDLCeByqkwAxInYOV8bg5U3po+j4G9ilpjqpy7zUm1Ye7q+VXfU+zVxX X-Received: by 2002:a17:902:c952:b0:15d:150f:344c with SMTP id i18-20020a170902c95200b0015d150f344cmr18143784pla.40.1651107706529; Wed, 27 Apr 2022 18:01:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651107706; cv=none; d=google.com; s=arc-20160816; b=B2tGGmoWTEmm3IXfTiPs/4R5M/Uf7Ny5PRdxv+t7dJVloxEAfSmG/Ceku5nFB3VecN 0g6vE3Xbn9ImCPpXzOcyibAZNkswWOGqWDVzPhiUwa02GYyh1+Y9Jx4Ayxj8AqcUtcZK R4Lgg3oPVetpnXztWRLagojPGUbltkfoEmBXZLeXEDscvq2DXaJvI5jnUQpwLtcsy7aR Udu48XeutP8Bqm8tKona/GN3Ykhfvk6BEzAEdrfYYSXsdw2ClR7CPof/WGjfcj2n7dE/ 8sUiVsCvnk3r0JP3886xrYI11lLrKc3Ma4MCzqvFJrnpQUaj1mqbNVwxDaMAQqg8EXic X5uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=zK0x5V23Ijp3kvL3sTcP9SmR0ORqkAvgSHxRNnAKJXM=; b=gbatDeuD91tYPj5Gmbpdyz9dPzcAPEmtqFN6tQRuY1MdOL6RC4ca9t1TyYUwhE535f 7zvdmQEnnwJa/5y9AUdCCb687jDoII3NOP6lOc+xM1cyDFUqEXL06wopAFwEwNy9EW0p JK2aAzAPvjYH2grcPfDbgGidbfykcaCNI3wNiXAFNPf6KTUC2+vMiJ0LUNeMkZT+Z43z UeeZAx98S8yjq2BplPeCV9O74JhLjUNy6rRRqB45GhgT0m1QD/8cMYedDCoqd/n8wDul nowUglFcwxmWCDFm4INTGkJVB99549XkWolQRkfc1+lf2cnx0eYHZB9OrocR1mqH0Gnc 4ZuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TJN0iE3I; 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 d13-20020a65620d000000b003aa8b889ad2si2933906pgv.594.2022.04.27.18.01.30; Wed, 27 Apr 2022 18:01:46 -0700 (PDT) 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=TJN0iE3I; 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 S231805AbiD0X1n (ORCPT + 99 others); Wed, 27 Apr 2022 19:27:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230053AbiD0X1l (ORCPT ); Wed, 27 Apr 2022 19:27:41 -0400 Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8642E44; Wed, 27 Apr 2022 16:24:28 -0700 (PDT) Received: by mail-io1-xd32.google.com with SMTP id e3so1104610ios.6; Wed, 27 Apr 2022 16:24:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zK0x5V23Ijp3kvL3sTcP9SmR0ORqkAvgSHxRNnAKJXM=; b=TJN0iE3IAWEply8eeJAOuWrie9rvmG8P4MVzGFISS0BZhGoXf6iQV4zJ/Nldl0cZWu 9jAibiHwuGIj+qwizJ1+JVP5/x3ONDUfo+/ga4PkzdMZDjXaiZDnFkXzWBRhhVKG4VV0 +2Xq/jHT1NgaXdPPrJQxXwlV9UOsR0+H9+Va+yuysrcKPPJbM8JVoefTBFSjDzWD2wUX kXMkQS712vws6S+6z/OzwHiQEVTc6KIy9Yn/TsTHHVGQxCIABccLYyjZjK/kfmkI98Zb 0IAEqxwvgy5AfGJ1U1tXm4EeqSBOfvqihMhMPl8B3MROidPey5tjErXX13NYejG8YUxI dDYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zK0x5V23Ijp3kvL3sTcP9SmR0ORqkAvgSHxRNnAKJXM=; b=yn9eJ28QY+Pynm2efNyhECSDGBFbsfUgEa3BHWX7vQ09xMpKJGJGoHs1DMLQByW/kU l3pblCEaOh7b4KTbBVMcZwjvbbIzBr9l20ldH8Z9z4xNwcnUnQtbSedEnVKgkcoOG0H+ +hwNuloZ410sKVI2rEyzII0fi1GbLIIEKBhkuvGZPuVPJ6Z3YANcFY78WrGiiQ/E6fx4 bwNQq/YWmP53ro9aWQuObtxTt7MZzHg0YszhH0y/nw9etwNSbXIo0APPh+T2dZpNgXYo 2Zx5TX8NV0Px9u+YTYEpAAPViJjIp3XFe02oZ1m0MrxKwUwFLTBAAIIsyqLZLE1+XFXL MDAA== X-Gm-Message-State: AOAM532HVH+YjTXlDEqWNsnvw4LCgcV27OCbO5FezBBVtrW7ofRws3KN smrYzqr5WEgyV40GQhMB4Yf3DsTmI8/1DnBRj1o= X-Received: by 2002:a05:6638:16c9:b0:328:5569:fe94 with SMTP id g9-20020a05663816c900b003285569fe94mr13658972jat.145.1651101868173; Wed, 27 Apr 2022 16:24:28 -0700 (PDT) MIME-Version: 1.0 References: <20220427210345.455611-1-jolsa@kernel.org> <20220427210345.455611-3-jolsa@kernel.org> In-Reply-To: <20220427210345.455611-3-jolsa@kernel.org> From: Andrii Nakryiko Date: Wed, 27 Apr 2022 16:24:17 -0700 Message-ID: Subject: Re: [PATCHv3 bpf-next 2/5] ftrace: Add ftrace_lookup_symbols function To: Jiri Olsa Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Masami Hiramatsu , Networking , bpf , lkml , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Steven Rostedt Content-Type: text/plain; charset="UTF-8" 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 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 Wed, Apr 27, 2022 at 2:04 PM Jiri Olsa wrote: > > Adding ftrace_lookup_symbols function that resolves array of symbols > with single pass over kallsyms. > > The user provides array of string pointers with count and pointer to > allocated array for resolved values. > > int ftrace_lookup_symbols(const char **sorted_syms, size_t cnt, > unsigned long *addrs) > > It iterates all kalsyms symbols and tries to loop up each in provided typo: kallsyms > symbols array with bsearch. The symbols array needs to be sorted by > name for this reason. > > We also check each symbol to pass ftrace_location, because this API > will be used for fprobe symbols resolving. > > Suggested-by: Andrii Nakryiko > Signed-off-by: Jiri Olsa > --- LGTM. Acked-by: Andrii Nakryiko > include/linux/ftrace.h | 6 ++++ > kernel/kallsyms.c | 1 + > kernel/trace/ftrace.c | 62 ++++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 69 insertions(+) > [...]