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=-14.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no 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 97681C433E2 for ; Fri, 11 Sep 2020 15:58:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 53C0421D7E for ; Fri, 11 Sep 2020 15:58:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="rLp1NySz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725904AbgIKP6I (ORCPT ); Fri, 11 Sep 2020 11:58:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726582AbgIKP5t (ORCPT ); Fri, 11 Sep 2020 11:57:49 -0400 Received: from mail-qv1-xf42.google.com (mail-qv1-xf42.google.com [IPv6:2607:f8b0:4864:20::f42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8575AC061786 for ; Fri, 11 Sep 2020 08:57:49 -0700 (PDT) Received: by mail-qv1-xf42.google.com with SMTP id h1so5425702qvo.9 for ; Fri, 11 Sep 2020 08:57:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7EL5QIMCol+nNuuhHrYx3NpBAz3xMq+uHFMPEPZUHdY=; b=rLp1NySzNWm5L4jWo+hY0vSfl0/xqBuHjKQVwf1WDpdwjdJGu9skxJVSHfNRONDd93 L5E5R/usjyvzxijBipEXLFNLPt3qmHFasqjd3+Xsn+NIggx/Et6Z1oGCA/hbhTO9YVeL +VS0Nv8c5s69q4OTqKMh+hYiQQFY5RkcvplUV5xeL6SlCupRhLqqc+cT/s6U/MLlbLoO XbxbDzDGDwiLlOse0Y2lryfCcNSXigxKe3q/bG+tJ7o4fddNC2pV1FMf++YPCGyBywuy eTfxn81+HM1asfkTRTxjn2wmjAQrGpJH6KXtFXYjb7k+etQ7fotosxILtlgQwX3ybBcv qCow== 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=7EL5QIMCol+nNuuhHrYx3NpBAz3xMq+uHFMPEPZUHdY=; b=aW6eiTe9Aa1p2Yo9WYPPcxk6D9cn1U3fvMBRaDyF68hiILd0F11Rb+ZygiOgyTbj/k jvzpR2gb+K547yUSXD9wQBgvrlp8K8JhaHEJFwVKgNP0s2jSC/am6JV6sVBEmbDzzJjR PYZlm3TmTDvCRK3+un6+ggGThALdMuTgXVx07ZAl6RZxwv54rF5YHMB4zMmu8jf/OL2e OhePIWMAbhTvx4gmVJr37cnFwCf/sonjm9gtuE6MOLT3uc0EtngxQMdYuQvwcCHLZrnl 4Z239JNZD6NgL1TP/stfneEBQZ8N9cyJcIWkWOGxgXaxRzEXqZBBUkd7U/NKISc/zH+i buTw== X-Gm-Message-State: AOAM531+IH/GHdBmnLrhi/xP7ra/FMG+25rOuDIJT2BLBlt+AFzq/Js/ ClpM0G5/yoplf9KbC/Et8KGFKHe8A1qz3nKWeo5YEQ== X-Google-Smtp-Source: ABdhPJwzpIi715JRPFgu5PGIdnTrR5aO+y3zA2nI0tnr33CzB4RLydg7fngEbyQDu3GTloB40l4orxrYchhLrB3iztA= X-Received: by 2002:a0c:f48e:: with SMTP id i14mr2598321qvm.5.1599839868533; Fri, 11 Sep 2020 08:57:48 -0700 (PDT) MIME-Version: 1.0 References: <20200909182406.3147878-1-sdf@google.com> <20200909182406.3147878-6-sdf@google.com> In-Reply-To: From: Stanislav Fomichev Date: Fri, 11 Sep 2020 08:57:37 -0700 Message-ID: Subject: Re: [PATCH bpf-next v4 5/5] selftests/bpf: Test load and dump metadata with btftool and skel To: Andrii Nakryiko Cc: Networking , bpf , "David S. Miller" , Alexei Starovoitov , Daniel Borkmann , YiFei Zhu , YiFei Zhu Content-Type: text/plain; charset="UTF-8" Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On Thu, Sep 10, 2020 at 12:59 PM Andrii Nakryiko wrote: > > On Wed, Sep 9, 2020 at 11:25 AM Stanislav Fomichev wrote: > > > > From: YiFei Zhu > > > > This is a simple test to check that loading and dumping metadata > > in btftool works, whether or not metadata contents are used by the > > program. > > > > A C test is also added to make sure the skeleton code can read the > > metadata values. > > > > Cc: YiFei Zhu > > Signed-off-by: YiFei Zhu > > Signed-off-by: Stanislav Fomichev > > --- > > It would be good to test that libbpf does bind .rodata even if BPF > program doesn't use it. So for metadata_unused you can get > bpf_prog_info and check that it does contain the id of .rodata? Good idea, will add that. > > +const char bpf_metadata_a[] SEC(".rodata") = "foo"; > > +const int bpf_metadata_b SEC(".rodata") = 1; > > please add volatile to ensure these are not optimized away Ack, ty!