Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp19598lqd; Tue, 23 Apr 2024 13:07:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXxg03sPw+W5cVG81Ii/T3T+ejA08ZsC/GCUwhss2bKaPkqnhl/Ozsmyz+CGRfMcTo3ZRtt+xvyxOEdMU8wdlkS+HLFQdEXaBoVAFoO0Q== X-Google-Smtp-Source: AGHT+IGTPuFHGfnj2gqRQvl3fAiIPJja8XIvwJHu1876aSa86a+wQkjfSSNiswQSJgo6bCjQcLYP X-Received: by 2002:a05:6e02:1d13:b0:36a:fe3d:157d with SMTP id i19-20020a056e021d1300b0036afe3d157dmr710978ila.25.1713902878664; Tue, 23 Apr 2024 13:07:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713902878; cv=pass; d=google.com; s=arc-20160816; b=dioR9kO4VBCgjmJzY8EoVJtmoIOgRNgEQZGXaaTuKloLK7O+aXFjW+gwb2VszRZHHo 7kW8jDnQunyxPKLlc5JWn5FkrX82VQAW45frdQpTuhkXJuYxSr/JbC9aRApjn51s+rx5 StDkVpGRqYutx/qGJ+Z5mRpnmyu9SjUejOeMBGVMGrmI1myIZRuIcEa/sIdlMuPDlr6+ QoY0kRhUGObMoY3SRNmKh80LAnsT4S09e6Z/wO74WzmYyMqOe24Jstaq8Bo4Uh8VuyZF NAvo9Hx+KYz7VoWM6wnDfQ2TSNtR9luPXSjh1OaMYQRuZfWGJDM4Oq7wap59c52W+uUT hqpw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=tOzJACYI75DXa64mDxT0BmWWLnTe9c4GzpRxBJzXQ4I=; fh=dHTVQHsdGtQUjvzJcaykAYCd5qnOqlfcoc9W7INt0HQ=; b=r2R3BJa3J9FDQsQ3aFdbw+mNzP9SNi2hpGQmpmAJFK8OenKo3ZxoxKX9IKARqK9sln ushoR7sYsO6o7/IT+n3R+YPin4WZcCpBtGVprzhA6G3eRtWPRXUuCjKpOQ+E0kZhQjyU r483ujw91Ulc8/81T0qXCJSTfPoaUgO69phGXc1MJyKtzcpvrsozZWBX+soRGUmIRgpC M5aaOVmV1funmaNAb15THl99lU39CP2qcUvxHR3hUvz3xNUsErgvgDMB3u3TcEErVkZQ JFjWu9i+sv4cJp3cwcIqMWHhsrLNiFOEZu+KEXKOdt34iUMtgItgeRi2kflQKnQoNHwR NyJA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=un+zBBTN; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-155836-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155836-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id m70-20020a633f49000000b005f7a9c5ff88si8560498pga.425.2024.04.23.13.07.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 13:07:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-155836-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=un+zBBTN; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-155836-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155836-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 5DB60286124 for ; Tue, 23 Apr 2024 20:07:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 37609142649; Tue, 23 Apr 2024 20:07:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="un+zBBTN" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 59B7A1422BB for ; Tue, 23 Apr 2024 20:07:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713902869; cv=none; b=oa6YETUfHfTxTD15GgrYbdVrRAO4KJeA4cNDZUhAdoZ6Fgihggac9t4r1NqnFXAvwBc4awBcDT3U8TAxsa1iQ7NE8jTkoUhjWukaxSXd2rn3nOt3vi2CMfeHsMWyLmEL8KKYmgooEHzuDiMGO9Pegp8SNTw7TP/4CiHbvKJ1Nv8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713902869; c=relaxed/simple; bh=JOx2IlpV2RVCi9C1wxvCwugZvnMEUALYhbRJEjRIV4Y=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GBk09N8O/yXaMgH6ePQy2OV3wAYfQOxCg8ieWEKmZn+3oZNf9SI0XtNZKubLwe8d5c8sDAHcP2BY23ULD0x9QIG7vXhLSUPpWXR9rYt/aUnXfuGwu6nAznPl6Zs25k/2RJqMm5yE1ggapipd0rqiHSW0X6XgZ6Coa3UwJUDKFrA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=un+zBBTN; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58066C116B1; Tue, 23 Apr 2024 20:07:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713902868; bh=JOx2IlpV2RVCi9C1wxvCwugZvnMEUALYhbRJEjRIV4Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=un+zBBTNHVE60Y0f7g2c0LW4mp3s1H2PbT4U5mrxuOC64cK/4QUnk5TusO5y1TdUm oFaDhlKOhIhBAqlvRKIT4fGq9vukCLmupqFCoz77HIVt5fCwcjiC007RRX7UkAQ9JH JV8aA/jXzD7E1ye4ESwI4qMuAoUAUenrFqkLdcFXhzSVjSQd5GJ8HHS18UQqX0sAbd 7tBeQGL3BYoeIPddJq+ncO9vPDO/Al4RNZCEnRpBaMl2xBr3IMKpoZ5TlyXIuJw40O psdMVLBFqM391tmIgCXDxHWEtaVehzW7dSiXUmWs4hYD6ssWz9VL0emdh3mHjOr6HA ifkQRQGW3/ZbA== Date: Tue, 23 Apr 2024 17:07:45 -0300 From: Arnaldo Carvalho de Melo To: Andy Shevchenko Cc: linux-kernel@vger.kernel.org, Willy Tarreau , Thomas =?iso-8859-1?Q?Wei=DFschuh?= , Andrew Morton , willy@infradead.org, Namhyung Kim Subject: Re: limits.h in tools/ Message-ID: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Tue, Apr 23, 2024 at 10:29:31PM +0300, Andy Shevchenko wrote: > On Tue, Apr 23, 2024 at 04:22:01PM -0300, Arnaldo Carvalho de Melo wrote: > > On Tue, Apr 23, 2024 at 09:58:07PM +0300, Andy Shevchenko wrote: > > > It seems tons of the code in tools include linux/limits.h. But I haven't found > > > where do we copy it. Any pointers? > > > Based on the discussion 20220603183231.15159C385A9@smtp.kernel.org. > > But then is for building tools/, not the kernel, right? The discussion > > you said this question was based on is about changing > > include/linux/xarray.h, a kernel file, so should really be including > > just kernel headers, files in the kernel source tree, outside tools/, I > > don't see where what tools/ uses to build is relevant here? Can you > > please elaborate? > > I believe the tool in question is tools/testing/radix-tree/xarray.c. And it is including stuff from the kernel directly, something we stopped doing long ago in tools/ to avoid breakage when a kernel developer changes kernel code: ⬢[acme@toolbox perf-tools-next]$ cd tools/testing/radix-tree/ ⬢[acme@toolbox radix-tree]$ grep -A1 -- -I Makefile # SPDX-License-Identifier: GPL-2.0 CFLAGS += -I. -I../../include -I../../../lib -g -Og -Wall \ -D_LGPL_SOURCE -fsanitize=address -fsanitize=undefined ⬢[acme@toolbox radix-tree]$ realpath ../../include /home/acme/git/perf-tools-next/tools/include So far so good, no kernel files included, only tools/ stuff, but then: ⬢[acme@toolbox radix-tree]$ grep xarray *.c | grep include xarray.c:#include "../../../lib/xarray.c" xarray.c:#include "../../../lib/test_xarray.c" ⬢[acme@toolbox radix-tree]$ realpath ../../../lib/xarray.c /home/acme/git/perf-tools-next/lib/xarray.c ⬢[acme@toolbox radix-tree]$ And this in turn will: ⬢[acme@toolbox radix-tree]$ grep ^#include ../../../lib/xarray.c #include #include #include #include #include #include "radix-tree.h" ⬢[acme@toolbox radix-tree]$ Includes kernel headers, as it _is_ kernel code. Perhaps since it does that we need to add -I../../../include to the include path to really include kernel headers? ⬢[acme@toolbox radix-tree]$ pwd /home/acme/git/perf-tools-next/tools/testing/radix-tree ⬢[acme@toolbox radix-tree]$ realpath ../../../include /home/acme/git/perf-tools-next/include ⬢[acme@toolbox radix-tree]$ - Arnaldo