Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2789073lqz; Wed, 3 Apr 2024 08:38:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXpoT+e1lPS/zyfXJmCESaIiTJDr0UGfHEjDTN+65WznM0D4EuCRSgppzKeU+hKJFAJDZMzOiN91HSu+KmOmZqGVoHswpif+Z3a9KqL3w== X-Google-Smtp-Source: AGHT+IG7tnmJfnxXshgvBYBUvAxKZzlJISastKBW+TvjScYM+hzIXEIkEmUXGMRpWNDbJhbDTdd2 X-Received: by 2002:a05:6358:7e12:b0:17e:8b66:a983 with SMTP id o18-20020a0563587e1200b0017e8b66a983mr3177207rwm.21.1712158718994; Wed, 03 Apr 2024 08:38:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712158718; cv=pass; d=google.com; s=arc-20160816; b=LsCz4J1O+/voN096rkqz+xI5i/N1/xdQ9mHRTxnjrPkIau/TZ+sSq48odQejQtz0VG KjlyLWydRHEsHMzu9GpYoDgV0ao4CARHYGOuBtMMZDxMUOSj7LxCPgOkQn2bvP3u73YH JYnHHclvehEaKcdQeCny4TWxIlfviiyIQCJqOVftj69yWsbq/9e2lLxmVY4JLI+zRXhv uv+Ze128ewlUKpvOGyoNmGtEiuNdY+q3yCVgruV/yymlXzWEvJoAluaLJQ9Ssxjjir+Q Xxm7UarZRqZe8FxhpFqM2ZLZcq2xDvJ+8xzoq+T0x7dmO87Ao6wqDTtNAnce9sZ6VGpA n9IQ== 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=aGjaA6uK7iELe5s2Mt4kGrj959ypfrao/zFNpn4utmA=; fh=AMiKUCw6eqf6T0i0UB7EQCeo2CYq+/k5ReflPWhnpCY=; b=XnmeKLpVkPzgXRsb9dX+/AK8jFKwjXt1kCvjEZKHb7OdsgyPzdS+gbF+lWXQdxOM8G Lcr1bR0KOcD1Sn+nLs2O5ThpbPYIopO0TsI762ANGzap3G/2y4psn8i3wN34R3kIkBgX 8H/squozyCQcl3Z85UmtPKtJSWohKkEuShA9k5BXsmbgLEvm8nxQm0DlBAB146cemJSM FJV2M3aal6n+sqJ9iJLoYQz/XG7LOCUK+Y4brTu7a7wU9zKgFKDOhpjN8iui6jnT0Gxy THTYH70G+sqb77RUYQ10padvjnIvpHGaqAH3sAsktIBAa/pQS5OGgAcobymFPjbrWdeq 7JYg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=JIbahdN3; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-130030-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130030-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id z11-20020a634c0b000000b005f0a512f885si8556149pga.224.2024.04.03.08.38.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 08:38:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-130030-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=JIbahdN3; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-130030-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130030-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 635F9B2A76B for ; Wed, 3 Apr 2024 15:06:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 052DC14A4CD; Wed, 3 Apr 2024 15:05:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="JIbahdN3" Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (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 AD46A148FE8 for ; Wed, 3 Apr 2024 15:05:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712156750; cv=none; b=ekguwjYt3ITyKEmZw+eHwCM9+vjalOi1BUpTBwFYJLdRcJB1z+mhFEqGCUpO7b0+8RRYIU/8MtWLQvU8teMqtlxxFQBNhyDTCwl8O2oU3CxibK+eOEWMoi9P1xlUHGAg7HWCjZA4RcpdzTpwc9+5Gm6unjfyH2fx1ZhpgCDOX28= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712156750; c=relaxed/simple; bh=tn60vKHjPFapgtuUkPwXfSpy/taU/QcLKMDYSThlYro=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=hqsNRvWYnZqNDfT4DvTFID10uIfamnIVYbM20t522GHON0HdmM6DTnxBGj2MDc+ibc4BOqanpmYnccdXExCqbQsa6/k13VbtvqowXfZ1Jc90kvxCfKFVXlepyJZ933fIzHr5RvQwqwBoJXEd8GDZrzKmeZIVvaiX6nYVsq2aD00= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=JIbahdN3; arc=none smtp.client-ip=209.85.214.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-1e277154d4cso138915ad.1 for ; Wed, 03 Apr 2024 08:05:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1712156748; x=1712761548; 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=aGjaA6uK7iELe5s2Mt4kGrj959ypfrao/zFNpn4utmA=; b=JIbahdN3zovO8/s0DfBu9YOmfkRB6yCWAP3KyWs7kXC0oLYeis5e8u5KucT+dkHmQ2 P4DP7KttEnH51EIwIXXGQOt+D3QI3MiQm2HpPhDbBQMXFFnT1XDegBkOKGg7PGuGVng0 JMcehjSJ70AnTf9SBfM6EAdjVrbqlHI+z9AfUsDD3lo7eDdC5zlHCPLUGb8Fyrgp4afU sY9ydBzt36+QKA1NfLiswUts6ijT50JSg8J2gztJ3ZlEoEzx2VRIOI6TlQQ6pKn4tNYQ +jDVkO8vi8DuaSobz3ra8O3FvSQkAfVa5wdxkbxURWtZcQJZfXr6UvGcMHhnzLTZ9eaW /BIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712156748; x=1712761548; 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=aGjaA6uK7iELe5s2Mt4kGrj959ypfrao/zFNpn4utmA=; b=wL+zRf18oHhvOT8wHrvaoJOiWXZjy4l631+VoC4FXGir6Q007tx7Ag4b2NcyFkLppj YbFfY587lQLah2qs/zGXwKs5t7+GMooCFiPCujW8JRV7diQtm7dcu9tDd6KhWnMwWljQ 5M4580JwxcS/Cwv4fwjJW0pnoWTi3MBLm9oBHYFRRMOPOdoyfk7z8OOtOI1ET9jtI/nr zMXKcdGyAI6uHoYwEXvGDQidpud549FFY+FQ61mSO0+IKqsP3UipPk+jRY6vP5/oqzx8 VA3rbOrqdJ66eD4PqdDgYS/LsdJRD8zamFXvaqkcSjNLOLtQq0tredo8UsiyJlr1kko2 hBbA== X-Forwarded-Encrypted: i=1; AJvYcCULDWJOEgvlL2RaZWpKvNjVT+CZueOAKOY8fVA0lXCTHQhllY9iZMmrW1c06qP1NJV2ioMfW6JZVob3AuqZCaxWaehq4MXORYhTrA9E X-Gm-Message-State: AOJu0Yy0zWFVr0P/npZefk+ADhPLy7bly8BraJkHmy/XEzTXBRQPXMen WMQ39k43nbpkk2ThlpxsFq06z/VkjNk2mdOnd4krq50U9eEUdbQODcSYfFdap2Nju8xFnBLFN4O TWBJX8DMoozr61ft6ClsrhSCVEPF50QeUwa2v X-Received: by 2002:a17:902:dacd:b0:1e0:b622:4e24 with SMTP id q13-20020a170902dacd00b001e0b6224e24mr259868plx.20.1712156747572; Wed, 03 Apr 2024 08:05:47 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240403122558.1438841-1-yangjihong@bytedance.com> In-Reply-To: From: Ian Rogers Date: Wed, 3 Apr 2024 08:05:32 -0700 Message-ID: Subject: Re: [PATCH] perf beauty: Fix AT_EACCESS undeclared build error for system with kernel versions lower than v5.8 To: Arnaldo Carvalho de Melo Cc: Yang Jihong , peterz@infradead.org, mingo@redhat.com, namhyung@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, adrian.hunter@intel.com, kan.liang@linux.intel.com, james.clark@arm.com, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Apr 3, 2024 at 7:21=E2=80=AFAM Arnaldo Carvalho de Melo wrote: > > On Wed, Apr 03, 2024 at 08:25:58PM +0800, Yang Jihong wrote: > > In the environment of ubuntu20.04 (the version of kernel headers is 5.4= ), > > there is an error in building perf: > > > > CC trace/beauty/fs_at_flags.o > > trace/beauty/fs_at_flags.c: In function =E2=80=98faccessat2__scnprint= f_flags=E2=80=99: > > trace/beauty/fs_at_flags.c:35:14: error: =E2=80=98AT_EACCESS=E2=80=99= undeclared (first use in this function); did you mean =E2=80=98DN_ACCESS= =E2=80=99? > > 35 | if (flags & AT_EACCESS) { > > | ^~~~~~~~~~ > > | DN_ACCESS > > trace/beauty/fs_at_flags.c:35:14: note: each undeclared identifier is= reported only once for each function it appears in > > > > commit 8a1ad4413519 ("tools headers: Remove now unused copies of > > uapi/{fcntl,openat2}.h and asm/fcntl.h") removes fcntl.h from tools > > headers directory, and fs_at_flags.c uses the 'AT_EACCESS' macro. > > This macro was introduced in the kernel version v5.8. > > For system with a kernel version older than this version, > > it will cause compilation to fail. > > Thanks, I test on it, but since I didn't found libtraceevent-devel > available there, then I have to build with NO_LIBTRACEEVENT=3D1 and thus > this doesn't get built :-\ > > Thanks, applying. Yang also wrote: https://lore.kernel.org/lkml/20240314063000.2139877-1-yangjihong@bytedance.= com/ that may have helped you with this. Thanks, Ian > - Arnaldo > > > Fixes: 8a1ad4413519 ("tools headers: Remove now unused copies of uapi/{= fcntl,openat2}.h and asm/fcntl.h") > > Signed-off-by: Yang Jihong > > --- > > tools/perf/trace/beauty/fs_at_flags.c | 8 ++++++++ > > 1 file changed, 8 insertions(+) > > > > diff --git a/tools/perf/trace/beauty/fs_at_flags.c b/tools/perf/trace/b= eauty/fs_at_flags.c > > index c1365e8f0b96..c200669cb944 100644 > > --- a/tools/perf/trace/beauty/fs_at_flags.c > > +++ b/tools/perf/trace/beauty/fs_at_flags.c > > @@ -10,6 +10,14 @@ > > #include > > #include > > > > +/* > > + * uapi/linux/fcntl.h does not keep a copy in tools headers directory, > > + * for system with kernel versions before v5.8, need to sync AT_EACCES= S macro. > > + */ > > +#ifndef AT_EACCESS > > +#define AT_EACCESS 0x200 > > +#endif > > + > > #include "trace/beauty/generated/fs_at_flags_array.c" > > static DEFINE_STRARRAY(fs_at_flags, "AT_"); > > > > -- > > 2.25.1 > >