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=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable 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 DEA22C352A9 for ; Thu, 26 Sep 2019 12:43:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BF6E321655 for ; Thu, 26 Sep 2019 12:43:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726722AbfIZMnf (ORCPT ); Thu, 26 Sep 2019 08:43:35 -0400 Received: from www62.your-server.de ([213.133.104.62]:56860 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726351AbfIZMnf (ORCPT ); Thu, 26 Sep 2019 08:43:35 -0400 Received: from [178.197.248.15] (helo=localhost) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1iDT7J-0002X9-00; Thu, 26 Sep 2019 14:43:29 +0200 Date: Thu, 26 Sep 2019 14:43:28 +0200 From: Daniel Borkmann To: Andrii Nakryiko Cc: bpf@vger.kernel.org, netdev@vger.kernel.org, ast@fb.com, andrii.nakryiko@gmail.com, kernel-team@fb.com Subject: Re: [PATCH bpf] libbpf: teach btf_dumper to emit stand-alone anonymous enum definitions Message-ID: <20190926124328.GA6563@pc-63.home> References: <20190925203745.3173184-1-andriin@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190925203745.3173184-1-andriin@fb.com> User-Agent: Mutt/1.12.1 (2019-06-15) X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.101.4/25584/Thu Sep 26 10:24:31 2019) Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On Wed, Sep 25, 2019 at 01:37:45PM -0700, Andrii Nakryiko wrote: > BTF-to-C converter previously skipped anonymous enums in an assumption > that those are embedded in struct's field definitions. This is not > always the case and a lot of kernel constants are defined as part of > anonymous enums. This change fixes the logic by eagerly marking all > types as either referenced by any other type or not. This is enough to > distinguish two classes of anonymous enums and emit previously omitted > enum definitions. > > Signed-off-by: Andrii Nakryiko Applied, thanks!