Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4748409pxf; Tue, 30 Mar 2021 16:31:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybKotj1yYOhrXGH3BGkYVC4Ph7+hBvOLxbOfg5XK6sWZN3JdGOvQ7w6QMJqH3WzoVIcdqc X-Received: by 2002:a17:906:b2cd:: with SMTP id cf13mr584627ejb.181.1617147100802; Tue, 30 Mar 2021 16:31:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617147100; cv=none; d=google.com; s=arc-20160816; b=Fxa9O6E/IULBtSr11/Lwf91FlgMp9gm+PQqFa2WolE0YzbJcbl0W0j7kfLUq60pCC4 EyZvNQG+LRQ7MynkYzHCmVuhehx/Esg4wOXsUc60i1NfUAq1d+f/HBsIAg9luwj3uf7J 6w6bd/J362vwtCUY530KSG8wtBIOvdGKfatM+Gf3qfQR4wDaFq1BPpmunTFgKAhKJigC tSO5bJmI1ESTEU91GkBKZTYHU805rt8YtEZRCrG/04HsXcJZOsR5B8uEKGZUtxnaRWiW L3woqxYzHGV5g92n9tA+Vh3Asp2iS3dbRUWlru9EnmFe6BDPxH4ba/b/AYqY/+4vSIXj DU4Q== 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=7P9evhC2fefpJxi9njQ79qnjbEyr4RKoQ+V/DRcy07E=; b=JLZNDdwsZbeQNPK8v7cMY/IGU1MKrV3m1jEgLYhCPMD+Pd35dU7o6rKGzNoash0UBT db48xT+DSJaQAEjxdyDnZFnj974J4zAYH53UMtCK2jZ2LkFOlTHZdPFdHvrWTpCstQCv w1JtwT24yoA72P1y30ecy7orZuYgbX2Rw+3wKtyKn65fPjx8JmeERjWScAi/253leyrL oipHM42NY2IOBYEse0lvM3WbsVI9LBXp4plHdalAepnNWX1/C9XS1I6VoS8yG8rKINUp OC/etFotAaBuO3j6XwxC6y9Na5aolkiHwerre0AfvDLQgr3KPN3Grks1KPtPn7uzecj8 9f7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gRjJO0F4; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p5si400839edt.116.2021.03.30.16.31.17; Tue, 30 Mar 2021 16:31:40 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=gRjJO0F4; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232685AbhC3X15 (ORCPT + 99 others); Tue, 30 Mar 2021 19:27:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232667AbhC3X1e (ORCPT ); Tue, 30 Mar 2021 19:27:34 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7AE1C061574; Tue, 30 Mar 2021 16:27:33 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id b14so26316732lfv.8; Tue, 30 Mar 2021 16:27: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=7P9evhC2fefpJxi9njQ79qnjbEyr4RKoQ+V/DRcy07E=; b=gRjJO0F4OMhIooibcLON9pujbXZ59O41HRnUtt0/UijBRPCbr4+6oJ29xjGXXAdUj9 L2f7Xsd8LRe47nEdTnNPDyigfE7dlaHQSSAmNySQLb1hM2kSZETM18mtX+Hp86o2/AfP QaNYPvg4VS6ySLEH5mGsvB3ljo+yoVdxMFSCaAJ8jNMxhO80vY0J0IsAhgoe2nzDVyvt v6Hk3bfXZwU3G/g+bflxpRrAvFUq51dRvDq1HmzrTNgmO1k8QXpQz7Blwkv7f86fjQFY bTLqkOz8KupSCvqdGHkpb/ELoZCbHrkgazfEmo9WC51hmOksLS5clZ1JYnwPgRT67QTc IwvA== 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=7P9evhC2fefpJxi9njQ79qnjbEyr4RKoQ+V/DRcy07E=; b=LZQ6zEDHRpaLAR498ZdIvd0rhPEqwxoEwd1Mqws6//vMkl+TmL05eTDFobszPBpOug 48E9p5cr2q4JJDwlBpbd5JIr2GWpHQy6Rwqp+B9uhk7E+FHCaKEnbNvTCWL95i/zyPRW WjZKJ5BPBjRkxgkDLuQLoU0DvdmznkXey3Npc225rH6BXlA0Vu6JsQzFFj2GRV28QrPH Xvz3ZyzjaXjSWeuEcn43T6pWFW+Hs9yzwsYOhM8xZ5mGZ08bBo36cxEyxiX3+bijEZf+ 9ttUWdlY0joIAIDvubcak9FqUXGmvaofaDJz+XsxlY6aLLStQs3NnQzzSMVlqSH3S3Sz pB4Q== X-Gm-Message-State: AOAM533bz+4qoBGlvsG1QpwgQnxbokVW+skZaQ3zslOpWYAGCy0/Pp6I 2MZ9qW/EQRqB+BaUqIaAZgUB2ggzgmI0R81AbDw= X-Received: by 2002:ac2:5ec2:: with SMTP id d2mr375043lfq.214.1617146852070; Tue, 30 Mar 2021 16:27:32 -0700 (PDT) MIME-Version: 1.0 References: <20210325120020.236504-1-memxor@gmail.com> <20210325120020.236504-6-memxor@gmail.com> <20210327021534.pjfjctcdczj7facs@ast-mbp> <20210329014044.fkmusoeaqs2hjiek@ast-mbp> <20210330032846.rg455fe2danojuus@ast-mbp> In-Reply-To: From: Alexei Starovoitov Date: Tue, 30 Mar 2021 16:27:20 -0700 Message-ID: Subject: Re: [PATCH bpf-next 5/5] libbpf: add selftests for TC-BPF API To: Andrii Nakryiko Cc: Kumar Kartikeya Dwivedi , bpf , Jesper Dangaard Brouer , =?UTF-8?B?VG9rZSBIw7hpbGFuZC1Kw7hyZ2Vuc2Vu?= , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Shuah Khan , "David S. Miller" , Jakub Kicinski , Jesper Dangaard Brouer , Peter Zijlstra , open list , Networking , "open list:KERNEL SELFTEST FRAMEWORK" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 30, 2021 at 1:28 PM Andrii Nakryiko wrote: > > > > In the other thread you've proposed to copy paste hash implemenation > > into pahole. That's not ideal. If we had libbpfutil other projects > > could have used that without copy-paste. > > I know it's not ideal. But I don't think libbpf should be in the > business of providing generic data structures with stable APIs either. There is a need for hash in pahole and it's already using libbpf. Would be good to reuse the code. > > that's today. Plus mandatory libelf and libz. > > I would like to have libsysbpf that doesn't depend on libelf/libz > > for folks that don't need it. > > TBH, bpf.c is such a minimal shim on top of bpf() syscall, that > providing all of its implementation as a single .h wouldn't be too > horrible. Then whatever applications want those syscall wrappers would > just include bpf/bpf.h and have no need for the library at all. 1k line bpf.h. hmm. That's not going to be a conventional C header, but it could work I guess. > > Also I'd like to see symbolizer to be included in "libbpf package". > > Currently it's the main component that libbcc offers, but libbpf doesn't. > > Say we don't split libbpf. Then symbolizer will bring some dwarf library > > (say libdwarves ~ 1Mbyte) and libiberty ~ 500k (for c++ demangle). > > Now we're looking at multi megabyte libbpf package. > > Right, which is one of the reasons why it probably doesn't belong in > libbpf at all. Another is that it's not BPF-specific functionality at > all. symbolizer, usdt, python and lua bindings is what made libbcc successful. I think "libbpf package" should include everything that bpf tracing folks might need. Getting -l flags correct from a single package isn't a big deal compared with the need to deal with different packages that depend on each other. > I'm against pro-active splitting just in case. I'd rather discuss > specific problems when we get to them. I think it's premature right > now to split libbpf. Fine. I'm mainly advocating to change the mental model to see libbpf as a collection of tools and libraries and not just single libbpf.a