From patchwork Thu Jan 25 14:06:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaldo Carvalho de Melo X-Patchwork-Id: 192089 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:e09d:b0:103:945f:af90 with SMTP id gm29csp1112dyb; Thu, 25 Jan 2024 06:08:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IGo1wirQPFNDIsXZTjrBbDHWxb/RoFmna+wuJtE6m9woDE5pdUZIvz2qrrhzqKwzQKYvZEE X-Received: by 2002:a05:6808:140d:b0:3bd:6978:4577 with SMTP id w13-20020a056808140d00b003bd69784577mr1139168oiv.116.1706191724047; Thu, 25 Jan 2024 06:08:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706191724; cv=pass; d=google.com; s=arc-20160816; b=jxY+A0FlvsQ5HasVmxGKIf+IEUCci6wex2dUrxUtlbY10aZ0d9+1t2vwOj2gwjZxlo 2m19EeQEYtm0C3MBwqc4cyNMohppFBpNQ8ptFNyo/hNZOawCcmciy9N0MqqUiODjOLrx hzF1QYq2P6veGJt+jC0H2uiT/9cpOW4QBzs8eRF+2aZDdvd3z6pJz6azEYJM+UlSVXqo Uk+bFD+OeIOtkcVkpIMUnxl0ehJMM91HFtqDIkQeVUKAsymAblQrs9hQ3Fc+38mrllJd eL8vb1/XGJ3F4m2sjlJCGwVRKPn8tQl1OUTp8KBOAQVYS63IsiGtrulj3Fh3KeRPLgD3 la4Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=OpT9fVhXn2OKzvV3wdfopXWlz3skYM1BXX5Eh9PyXw4=; fh=yaikJKAeI1QkjfdwgJqOJXIpid67syzaL1sDEh2cqfc=; b=oS1h0r92W8Sr9/2Zbo2UT09HyrK63QkV1501IJs+PlbQX/ilZx/vZVwoKN8/s4JeRn YNxlY+0wWu7yQjCuG6amshzXo/Utm12yES8oHDb6agu1FlT3hJqYKduoXAqbFZ68hz4/ ao5A29PG95lf1OhixPl3MbIE702uZHpGbl4dzkkzv0pd6MEAA+PxU03XxhEOUzQshKgh QFdd4Yk3OlSCVgBb7f4o47h6KYY1sKgf/sAjwW2BI27eP5JTVxzcEVrKPi8d4zwJtL7z tYm7OFx2oU//P1yph6MICZS4H6s/NLBJSSo+e2BmE1uB1RksoVOlsKwmSLlkaIhVGbgU DEMQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iSRZD0iL; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-38701-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38701-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id x38-20020a634a26000000b005ce03fe3665si13028162pga.879.2024.01.25.06.08.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:08:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-38701-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iSRZD0iL; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-38701-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-38701-ouuuleilei=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 09C55B23450 for ; Thu, 25 Jan 2024 14:06:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BD521633E4; Thu, 25 Jan 2024 14:06:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iSRZD0iL" 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 2A4D062A1A for ; Thu, 25 Jan 2024 14:06:14 +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=1706191575; cv=none; b=h+LOliIuGs6f81MSGCuyVPPfHo9uHFQjhb/V7OrerujT6sQ2/kLe+rWms2m98T7myXqLO9vxGYRfH+D2kbNFA3JoBu+HAwFzqWYHUpF4eRln0mzXmKa9zK5S/tDfjLT5mQIIZ8GXbpJc8B9U17CX7/ATIa/YkgA5C4n/zrBdSqo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706191575; c=relaxed/simple; bh=pF9eMAEsaNVu4u9UZfIsGZ92b3kYhUox8LYXXuff8CM=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=DG2GdM4rVQNI7qjQGm87hkn/0IOfCo5PBMXK2EDj2uO/DoaJSvOzLX+pFHuIVqaoJZdu7MGWRg+3O+77fhVABha63thz+/Peu1+TZLp/P4NdgE7ClTAw4E2NFXlIPGBSVZ38sUnf2zQ37TqrR4554+62cfMT3xRpD+IjLpR8gno= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iSRZD0iL; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F1C8C43390; Thu, 25 Jan 2024 14:06:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706191574; bh=pF9eMAEsaNVu4u9UZfIsGZ92b3kYhUox8LYXXuff8CM=; h=Date:From:To:Cc:Subject:From; b=iSRZD0iLzupqOaXeh8HrSqyQk9pbAjt/gNyuOfbAjFDzaDE7aP1w6jYApGmckzvdY 6qkV6tbJcMTwc6ZFRiB+MAOPN1VD6jhqxNihiNj6x+fx0ZmCy6vPGy/UNVpvIrH3H+ YBfQl+bx5A14eqRtOwRVeEGvuuRMBbdJsjCJTnmLcQSqBuuMvyPddWmj6sfM2eBnKS kxgJk2DDWX/OpukuesmQn75suZLYGhkiTetwZwEhvI4JOBCK4qzwLg9FxPIQ+tL38I ht38fnEB1UegAL2So2mOrjSu3Btmo1mH65oB2uMW4MNcOgOrNxpxrg3HLpkx821c+y iXsiLnSdVuxSg== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 7EA91405B2; Thu, 25 Jan 2024 11:06:11 -0300 (-03) Date: Thu, 25 Jan 2024 11:06:11 -0300 From: Arnaldo Carvalho de Melo To: Linux Kernel Mailing List Cc: Miklos Szeredi , Christian Brauner , Adrian Hunter , Ian Rogers , Jiri Olsa , Namhyung Kim Subject: [PATCH 1/1 FYI] tools headers uapi: Sync linux/stat.h with the kernel sources to pick STATX_MNT_ID_UNIQUE Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789071692826366840 X-GMAIL-MSGID: 1789071692826366840 tldr; Just FYI, I'm carrying this on the perf tools tree. - Arnaldo Full explanation: There used to be no copies, with tools/ code using kernel headers directly. From time to time tools/perf/ broke due to legitimate kernel hacking. At some point Linus complained about such direct usage. Then we adopted the current model. The way these headers are used in perf are not restricted to just including them to compile something. There are sometimes used in scripts that convert defines into string tables, etc, so some change may break one of these scripts, or new MSRs may use some different #define pattern, etc. E.g.: $ ls -1 tools/perf/trace/beauty/*.sh | head -5 tools/perf/trace/beauty/arch_errno_names.sh tools/perf/trace/beauty/drm_ioctl.sh tools/perf/trace/beauty/fadvise.sh tools/perf/trace/beauty/fsconfig.sh tools/perf/trace/beauty/fsmount.sh $ $ tools/perf/trace/beauty/fadvise.sh static const char *fadvise_advices[] = { [0] = "NORMAL", [1] = "RANDOM", [2] = "SEQUENTIAL", [3] = "WILLNEED", [4] = "DONTNEED", [5] = "NOREUSE", }; $ The tools/perf/check-headers.sh script, part of the tools/ build process, points out changes in the original files. So its important not to touch the copies in tools/ when doing changes in the original kernel headers, that will be done later, when check-headers.sh inform about the change to the perf tools hackers. --- To pick the changes from: 98d2b43081972abe ("add unique mount ID") That add STATX_MNT_ID_UNIQUE that was manually added to tools/perf/trace/beauty/statx.c, at some point this should move to the shell based automated way. This silences this perf build warning: Warning: Kernel ABI header differences: diff -u tools/include/uapi/linux/stat.h include/uapi/linux/stat.h Cc: Adrian Hunter Cc: Christian Brauner Cc: Ian Rogers Cc: Jiri Olsa Cc: Miklos Szeredi Cc: Namhyung Kim Link: https://lore.kernel.org/lkml/ Signed-off-by: Arnaldo Carvalho de Melo --- tools/include/uapi/linux/stat.h | 1 + tools/perf/trace/beauty/statx.c | 1 + 2 files changed, 2 insertions(+) diff --git a/tools/include/uapi/linux/stat.h b/tools/include/uapi/linux/stat.h index 7cab2c65d3d7fce9..2f2ee82d55175d05 100644 --- a/tools/include/uapi/linux/stat.h +++ b/tools/include/uapi/linux/stat.h @@ -154,6 +154,7 @@ struct statx { #define STATX_BTIME 0x00000800U /* Want/got stx_btime */ #define STATX_MNT_ID 0x00001000U /* Got stx_mnt_id */ #define STATX_DIOALIGN 0x00002000U /* Want/got direct I/O alignment info */ +#define STATX_MNT_ID_UNIQUE 0x00004000U /* Want/got extended stx_mount_id */ #define STATX__RESERVED 0x80000000U /* Reserved for future struct statx expansion */ diff --git a/tools/perf/trace/beauty/statx.c b/tools/perf/trace/beauty/statx.c index 5f5320f7c6e27d17..dc5943a6352d91dc 100644 --- a/tools/perf/trace/beauty/statx.c +++ b/tools/perf/trace/beauty/statx.c @@ -67,6 +67,7 @@ size_t syscall_arg__scnprintf_statx_mask(char *bf, size_t size, struct syscall_a P_FLAG(BTIME); P_FLAG(MNT_ID); P_FLAG(DIOALIGN); + P_FLAG(MNT_ID_UNIQUE); #undef P_FLAG