From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C889C433EF for ; Tue, 14 Sep 2021 23:32:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 598CA61157 for ; Tue, 14 Sep 2021 23:32:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235660AbhINXdU (ORCPT ); Tue, 14 Sep 2021 19:33:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231435AbhINXdT (ORCPT ); Tue, 14 Sep 2021 19:33:19 -0400 Received: from mail-yb1-xb31.google.com (mail-yb1-xb31.google.com [IPv6:2607:f8b0:4864:20::b31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11D92C061574 for ; Tue, 14 Sep 2021 16:32:02 -0700 (PDT) Received: by mail-yb1-xb31.google.com with SMTP id c206so1667364ybb.12 for ; Tue, 14 Sep 2021 16:32:02 -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=kON7sJv4Cf6HzD0RQzHDJdXbRd58LyswWqP+XaKeAFQ=; b=Rk3I/kLlorYgcP1f0qWttj9cfl35aMIvXkHfhYAZhj8r2cjB9HvN+9NfhsU1rFevdU fvMQb+IJiVY62xgI2LHfLviVJmY5QuYzj09QsDMEjCfJ/5XjutHr5ZizURnZLNVSIdTa M5QyOtF2uPUhQwlHcx+dxIoFXCmAaKLGYcq0PjBDMT541F8rXLjUbmGX/pfg4B2bzzaM ZRZSNGUmP4Q5eJHJbddyRHX3rc0y6aqsgu8m/DaCXxsPffrmsJqYp2R8Xsq8OLqKKEJ7 JmwJ7DZ1gQg79zaAC+dMzSq+T2ic8xhNIQbmWOM0aJXRbKUg57cqGL+OlP2oK7WpvqMw u3Gg== 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=kON7sJv4Cf6HzD0RQzHDJdXbRd58LyswWqP+XaKeAFQ=; b=NEYUYPQUggX2UU3nVGX20ku/FGJd4Y0CBRiusS/HmRyLh6Fiv5YymAz9b3BnhMO4nU j/cWfAlw9/aXWqN6uEOfNtzxpD8cg5USx6wBCJP6+0NavJt7csMbP1Ol5MtKiRyr2OvD 06IIQbgg+WnYfcTh5rYyWy0hO0F7YpWZU2V3195W+wHoCfedlBS/x00+yF+KSCt6IsgM jwx+k2DRaB+aALlEnHr5BKCuU1MrtI/I/nqK75D6qAU9ZxfeK+oMK7luDydNjcaRZg1l THfQhvHXM8xTJvi0Ew+Wz2mH2rjQcA/1RUCMgA380R1CacDzsErcN17v+EVSJG6nZinJ wt6Q== X-Gm-Message-State: AOAM533JX/x/+oPYQBtfXnt0xTabq53QUBju99Z3SJXQE7ArnWvv/HTs /xCvxjaBzPiHI7zjd2ZADnQQQqdJ7k3WuqCzgYJs062q X-Google-Smtp-Source: ABdhPJxbtfC08tmZv+BKavAfTUryTGTRlWldzKzdye9X03gXfMk1JSuOFg6BYuK0LJDWWckce2Xn58+6guKzi1/VIn0= X-Received: by 2002:a25:1bc5:: with SMTP id b188mr2193827ybb.267.1631662321336; Tue, 14 Sep 2021 16:32:01 -0700 (PDT) MIME-Version: 1.0 References: <20210913155122.3722704-1-yhs@fb.com> <20210913155211.3728854-1-yhs@fb.com> <0031e9f3-6b01-373e-3b0e-2efdb6bd4ea9@fb.com> In-Reply-To: <0031e9f3-6b01-373e-3b0e-2efdb6bd4ea9@fb.com> From: Andrii Nakryiko Date: Tue, 14 Sep 2021 16:31:50 -0700 Message-ID: Subject: Re: [PATCH bpf-next v2 09/11] selftests/bpf: test BTF_KIND_TAG for deduplication To: Yonghong Song Cc: bpf , Alexei Starovoitov , Andrii Nakryiko , Daniel Borkmann , Kernel Team Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On Tue, Sep 14, 2021 at 12:39 PM Yonghong Song wrote: > > > > On 9/13/21 10:38 PM, Andrii Nakryiko wrote: > > On Mon, Sep 13, 2021 at 8:52 AM Yonghong Song wrote: > >> > >> Add unit tests for BTF_KIND_TAG deduplication for > >> - struct and struct member > >> - variable > >> - func and func argument > >> > > > > Can you please also add tests where you have duplicated struct, > > variable, and func (three different tests), and each copy has two > > currently, variable won't be deduplicated so I will skip variable > and add tests for func/argument and struct/member. oh, right, yeap, it makes sense only for struct/union and func > > > tags: one with common value (e.g., common_val) and one with unique > > value (uniq_val1 and uniq_val2, one for each copy of a > > struct/var/func). End result should be a single struct/var/func with > > three different tags pointing to it (e.g., common_val, uniq_val1, > > uniq_val2). I.e., those tags are "inherited" by the deduplicated > > entity and only a unique set of them is left. > > > >> Signed-off-by: Yonghong Song > >> --- > >> tools/testing/selftests/bpf/prog_tests/btf.c | 91 ++++++++++++++++---- > >> 1 file changed, 74 insertions(+), 17 deletions(-) > >> > > > > [...] > >