Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1698162pxb; Wed, 9 Feb 2022 02:30:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJz4Hv9Qq0YEJno/Css6yk8a3CnPOKEJQrvAVRwCnW33sGRBtD3zC3tcuHIEWor3AO4ykgph X-Received: by 2002:a63:8842:: with SMTP id l63mr1323511pgd.421.1644402608171; Wed, 09 Feb 2022 02:30:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644402608; cv=none; d=google.com; s=arc-20160816; b=Lm7Ag3df3mxk3EE7dvIWiU5Mi7glF29i/CRBgHBN18V4S1eTGgtsnSsV9rBnXmUNuc Qu11eIuyfC5akuLVmXb5AHbTjQbyV/YvbyjbSWhIRGHcT2Y2uu1jS1stSaU36F634ha6 4BKaf5yG8Z+UCAaZahVZRrpnvnTwBoYQ7dBprKrbV8TiwdBSiVGvJlOWW7iQboIg/w+q HzYG6dkUhwdr/gGmVUIOodF6Noj36mZA2CQV6LsfhiaVzR+dBhy04gIymA7NSbzXM4Gv qRIl/DFpWm2mnu283ytt3nGPjt/Eyj+tnN//IdAfufGP+mLrdipDhof2oDfAUWNlToZu zHUw== 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=aQUC+1hSWX9c74JSGFIRouvl2dTObm6AQTxbt8zkabA=; b=dQZroz2r1l56hzfij3yMRWX/na1jkKWe0iwDTlfPgRb3weqGsa7uwnMDygAlaBFDO1 ADOzrEfPH86ElfMj/BmE7PbzIwSchFPsu9+p7m+JOMz64tMvAfvkiXStoR6aaBWCbotH n310zfDyb08QnIQbnZHKmb3E1WbA4dDKt8Ir0rcfLQLyff0gkoAmQxGk/r5IJDD3NMrz R2YS+ZAHOPmLPlT+bi27gKii3D0crjI+I51jEYpTqluQRY/H5ybbQMvHHaUajGjoou51 /7Q8Rz7TLHvynt9ydBHI7eZjqtktFJJZvABQeQG9CszpIoC8kymMLU0XH1KFJumE3viQ tCUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=igrmkX4T; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id l64si752975pgd.768.2022.02.09.02.29.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 02:30:08 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=igrmkX4T; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 10E0FE0A0EB9; Wed, 9 Feb 2022 01:21:34 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353012AbiBHJIp (ORCPT + 99 others); Tue, 8 Feb 2022 04:08:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352896AbiBHJIm (ORCPT ); Tue, 8 Feb 2022 04:08:42 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 563DEC03FEC3 for ; Tue, 8 Feb 2022 01:08:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644311320; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=aQUC+1hSWX9c74JSGFIRouvl2dTObm6AQTxbt8zkabA=; b=igrmkX4TN6tWe8zRzOo7L4dY1bXXWIODHaPqy0Inmoo1jD9rwnR/W0RTmjZdMjOICvN8Ig +Y6Rt1dsKOUVROhAjjGZTM5WWY892HUqOMuE6R3TFAb/wcm6xbovZn4RHtGeVgbFB5rZMk ofiBzHOVkfCzu4KsnVumDzr5RECEbHI= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-533-s7du9Yq2NESbDmEGY5lNMQ-1; Tue, 08 Feb 2022 04:08:38 -0500 X-MC-Unique: s7du9Yq2NESbDmEGY5lNMQ-1 Received: by mail-ej1-f72.google.com with SMTP id ky6-20020a170907778600b0068e4bd99fd1so5447545ejc.15 for ; Tue, 08 Feb 2022 01:08:38 -0800 (PST) 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=aQUC+1hSWX9c74JSGFIRouvl2dTObm6AQTxbt8zkabA=; b=FX+gO+DkALwh85M6uQI9PtZoR37qyAWhgzlj/TaI0Ujufi5r3oLx3FHcNFYHXLMD4N ReyydxkOlzcHUTjdGRxxZVknGs7WGPFSZjJs4ltCEft8oeg9N1J1Z5oWBPH9WxkbmQRm +riFGFaHZTU6hFw6pBkbsMdowdKmv5ADS7ay/4gUtPBdtV4xnDhhzWW31jrE6IAph6Yk zgLoJPduDMtn20SW91KB6pR6MmK79P927bOsspGGhsY1G//hj6WFk5G1e6S4tiTA+r2z 1MusWxkJhdi5YCyU+LsKXPjE1OqGlTXhC2wW5MbOSy8Cb4hYfyv1csKXwbjdX/T1vRi3 nf4A== X-Gm-Message-State: AOAM531nHhjjmFnULbD0hF3luHaaazmAHDc6F/OfTGvtNL4mi14boe6Y vE4D7mjgrrl4F0sjopSPX+pGzYTXLunrcZfALSG1rsK5U8xcATglnn6XZ7UQxBiQ/xY5g7K65qj oSLwPeGfkCFGopst684LR7g6R X-Received: by 2002:a17:907:72c6:: with SMTP id du6mr2862974ejc.220.1644311317660; Tue, 08 Feb 2022 01:08:37 -0800 (PST) X-Received: by 2002:a17:907:72c6:: with SMTP id du6mr2862960ejc.220.1644311317471; Tue, 08 Feb 2022 01:08:37 -0800 (PST) Received: from krava (nat-pool-brq-u.redhat.com. [213.175.37.12]) by smtp.gmail.com with ESMTPSA id k13sm1871112ejz.167.2022.02.08.01.08.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 01:08:36 -0800 (PST) Date: Tue, 8 Feb 2022 10:08:34 +0100 From: Jiri Olsa To: Andrii Nakryiko 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 , Jiri Olsa Subject: Re: [PATCH 4/8] libbpf: Add libbpf__kallsyms_parse function Message-ID: References: <20220202135333.190761-1-jolsa@kernel.org> <20220202135333.190761-5-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.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Mon, Feb 07, 2022 at 10:59:24AM -0800, Andrii Nakryiko wrote: > On Wed, Feb 2, 2022 at 5:54 AM Jiri Olsa wrote: > > > > Move the kallsyms parsing in internal libbpf__kallsyms_parse > > function, so it can be used from other places. > > > > It will be used in following changes. > > > > Signed-off-by: Jiri Olsa > > --- > > tools/lib/bpf/libbpf.c | 62 ++++++++++++++++++++------------- > > tools/lib/bpf/libbpf_internal.h | 5 +++ > > 2 files changed, 43 insertions(+), 24 deletions(-) > > > > diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c > > index 1b0936b016d9..7d595cfd03bc 100644 > > --- a/tools/lib/bpf/libbpf.c > > +++ b/tools/lib/bpf/libbpf.c > > @@ -7165,12 +7165,10 @@ static int bpf_object__sanitize_maps(struct bpf_object *obj) > > return 0; > > } > > > > -static int bpf_object__read_kallsyms_file(struct bpf_object *obj) > > +int libbpf__kallsyms_parse(void *arg, kallsyms_cb_t cb) > > please call it libbpf_kallsyms_parse(), internal APIs don't use > "object oriented" double underscore separator > > also this "arg" is normally called "ctx" in similar APIs in libbpf and > is passed the last, can you please adjust all that for consistency? ok, thanks jirka > > > { > > char sym_type, sym_name[500]; > > unsigned long long sym_addr; > > - const struct btf_type *t; > > - struct extern_desc *ext; > > int ret, err = 0; > > FILE *f; > > > > [...] >