Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2331198lqz; Tue, 2 Apr 2024 14:09:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXKXpsKOMRSm7c19Gr9CxB7me71wc+TYLMF7jN8gM5AP5LDWkTlvnxi/Gdmx/+0fXF9tqfSL0ac8/6jSHSFRskQDtPENuTG0a4+YD7MMw== X-Google-Smtp-Source: AGHT+IFY8kdJURcgxU26/Bo1OT/F7/ceJ7MsOIs1ztsBo0/nBTzrmR0YGK0nfy9CqcjBE7t14VSq X-Received: by 2002:a05:6870:c14b:b0:221:8dd0:9920 with SMTP id g11-20020a056870c14b00b002218dd09920mr15744173oad.47.1712092198718; Tue, 02 Apr 2024 14:09:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712092198; cv=pass; d=google.com; s=arc-20160816; b=Ymic8EVck2lTJVSJcmjvWT8Nfsplmdto7ckzIBSswAjHEKami/ZIOBR0mCB0ZilxsO wV1I+yzdLDqfpiJW43D4a1mYNdUYfwyDZUoCr1zEiwQyMhFB+cCAZZimJntqSIfbOBgp V/UHrizHvFcKuvMLiBdXV4Gw5ZIX1yo9ERRfMutgBrlBUSbAKTCB3HdGLfhi0MkxrzoH IKfoeKM+jDWOrd71BaU2aREkO2f4zA0IFgjfHGyqKlj6DlmABY7zSj191CpB7V61b+1s S/+TwhATsWhv9ZA3WkjT7Lf6BN59SVpXF89Gfdp1hVdYKPl0FmT4P89dgWbogmgTudW1 WshA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=T71MZZYbHh/QHnIoLQj8nkValmMmnPqckXdi1WN9EEI=; fh=X7/bqEy5ZZkU7ChT5gAiPSls4uMjrxg/wO1Uv+dPqYU=; b=usIqFPskasSjlCGJ0lpsp2TP4d0fkc0+rgcA3oZrPdpGtw/ZIN+dXl8r2fCYh3BZY/ FgCfOuerVLCd8KRVl7yYw7+yAYeDI7YTcsz7ffIZ025qjIExvUfFB9KLIKa4G5L9uvSz zQhkZml1yMyS9Krk9h2aorGGZc87hX5A43noR52y7mLDy0Ut0HaqdidiHy+iRxf9CAc3 CWN0sD7YxYEmR626jCt86Bd2u8H6ztycWVaNwauCRRGhliSlvXiHDdk0epFATtO9QXqR CrTKmROlBEA+yFargfLFWbDuFwHsIx6SzTJWyRe8UN9cAyZ1ZCMrMrzbsC/qG+xK9SpH YgGQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=j5gzK1aB; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-128707-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128707-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id u2-20020ac858c2000000b00432093a43bdsi13128698qta.53.2024.04.02.14.09.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 14:09:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-128707-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=j5gzK1aB; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-128707-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-128707-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 6F56C1C239DB for ; Tue, 2 Apr 2024 21:09:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B9C9A15E5A7; Tue, 2 Apr 2024 21:09:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="j5gzK1aB" Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com [209.85.160.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 48C8979DD4 for ; Tue, 2 Apr 2024 21:09:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712092188; cv=none; b=N7RgcXHLxVkghvfpXQUHMJEdBOJOovN42UEXOazyUlkI4uerdgHTLqs8COD1LZgpv9goXRglZhLNdFIrMHEbagDRemVMBjZpJc49Tu1geO2wNEVywU5foe/4YbrJv8Bwa+XVxYcjslKJRNF/ejz80BUsNOOrwOfcoLHS10I/KGA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712092188; c=relaxed/simple; bh=T71MZZYbHh/QHnIoLQj8nkValmMmnPqckXdi1WN9EEI=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=qS0vBVQuNRbr1USzAD2u9+hS8L5p5FT2l+/ndtYuwc9yag/7CyUBIEFZ6Hes+KWR720lazasmfN67U2mnu+FZDyQVPN4NVmSzs/SWgUQL7FUOElqn62cZYEkDl4jIt9zUL6WNLlBEVWhycD62h8TIjOL5Itk96QsTbi2NjoPUk8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=j5gzK1aB; arc=none smtp.client-ip=209.85.160.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-qt1-f171.google.com with SMTP id d75a77b69052e-432b5b3dad7so31680931cf.0 for ; Tue, 02 Apr 2024 14:09:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1712092185; x=1712696985; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=T71MZZYbHh/QHnIoLQj8nkValmMmnPqckXdi1WN9EEI=; b=j5gzK1aBAkzzfg6oQwkHrJmUYYFHQWxOdxkKBUx82p1X3ad3TD1519OqOsn5RERxoU 4VjhgQj3FJpiiJT+qJPQWPXKLGkX+ja8jPNjwt/Bey/TlH31Le4Y6ccnoHyax9NAzp1L YtXLnn0Dg+dmhfNqFmd7qygkLkpUl8wzeEpzU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712092185; x=1712696985; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=T71MZZYbHh/QHnIoLQj8nkValmMmnPqckXdi1WN9EEI=; b=fcB3z7c7DrQKz1R/Lt6tX59ZFwdGAORIPq0jmk+1wJqrP/Vl5p/+IUzUvCXkXWa9OF pBaoDiztdvauvtebW/+L6CRBwfHNuCNAx5k2yvT88JqYPffZxgvK7x4h0Wap2mpmcHvQ zD8V/no/rziU98PQZ+PPoUubW3HBSQprNuTUDxQgf06EuVXpgozVolUFWCN1hA/oP1CD In3G+muEnOP07tsqOEyJ1fpaH1R2K7D0oYopLHGyIxRb0h2boC+N66Vj7VSBScA+75cN P3syaWTg/63LpJoG8sE4ap7kEYFASXY8sr/4jxnI4D33O4OHriVis4V2fLGs0ZZ19I+q f9OA== X-Forwarded-Encrypted: i=1; AJvYcCWX9ZkE6t00/8Mxj3v1mwByUCv9G6Pnm/Ja2zZzdolIkNjoMAc7YXNgMuPkEmcvb706lZR7J/uJQL+IIwagu+yiV8FnNyyTQJSKnVto X-Gm-Message-State: AOJu0YyAlS+AANPfOylG3lWIdaOQ7HXEVHxo76+sgql9w7FCF7/4K5PT m+MmwMsEvl0kQ8D4J1LCGbq/PJjoNOqwLKaU0tNhBrML/96ksGvyO2LRlD2ojJPU4BRMSiWMxR4 = X-Received: by 2002:a05:622a:202:b0:431:80cf:5281 with SMTP id b2-20020a05622a020200b0043180cf5281mr14632077qtx.43.1712092185695; Tue, 02 Apr 2024 14:09:45 -0700 (PDT) Received: from mail-qt1-f174.google.com (mail-qt1-f174.google.com. [209.85.160.174]) by smtp.gmail.com with ESMTPSA id cq5-20020a05622a424500b00430dcca3fb5sm5871239qtb.16.2024.04.02.14.09.43 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 02 Apr 2024 14:09:44 -0700 (PDT) Received: by mail-qt1-f174.google.com with SMTP id d75a77b69052e-431347c6c99so91351cf.0 for ; Tue, 02 Apr 2024 14:09:43 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCVAXC7ogttFbPX7tDnZXdi7Tl0MTrWGw1V0NZTzjw94yre30qcy4C7Ab2ztGmenYsSymknWFZBq+H3RukEHjF88k/JOzV8xwjVzxtjz X-Received: by 2002:a05:622a:407:b0:431:68e6:314c with SMTP id n7-20020a05622a040700b0043168e6314cmr12641qtx.29.1712092183245; Tue, 02 Apr 2024 14:09:43 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240315091434.10622-1-dmitrii.bundin.a@gmail.com> In-Reply-To: From: Khazhy Kumykov Date: Tue, 2 Apr 2024 14:09:30 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] tools/resolve_btfids: Include linux/types.h To: Dmitrii Bundin Cc: Alexei Starovoitov , LKML , Daniel Xu , Viktor Malik , Alexei Starovoitov , Andrii Nakryiko , Nick Desaulniers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Mar 21, 2024 at 12:51=E2=80=AFPM Dmitrii Bundin wrote: > > On Mon, Mar 18, 2024 at 7:56=E2=80=AFPM Khazhy Kumykov wrote: > > I'm also seeing this, on clang. > > I think the error is more related to the libc version. I updated the > libc6 to 2.35 and noticed that the header is included > indirectly through . The relevant sample of the include > hierarchy for with libc6 v2.35 looks as follows: > > . /usr/include/x86_64-linux-gnu/sys/stat.h > .. /usr/include/x86_64-linux-gnu/bits/stat.h > ... /usr/include/x86_64-linux-gnu/bits/struct_stat.h > .. /usr/include/x86_64-linux-gnu/bits/statx.h > ... /linux/tools/include/uapi/linux/stat.h > .... /linux/tools/include/linux/types.h > > The is included on the latest line of the sample. > Starting the version 2.28 there's an inclusion of which > was not presented in 2.27. > > When building the resolve_btfids with the libc6 version 2.27 > is not included through . The include > hierarchy for with libc6 v2.27 looks as follows: > > . /usr/include/x86_64-linux-gnu/sys/stat.h > .. /usr/include/x86_64-linux-gnu/bits/stat.h > . /usr/include/fcntl.h > > To avoid being dependent on the inclusion of at some > other place it looks reasonable to include it explicitly to bring all > the necessary declarations before their usage. I would agree - include what you use. The u32 type is defined in linux/types.h, relying on indirect includes seems fragile (and in this case, does seem to break folks). > > What do you think?