From: Ian Rogers <irogers@google.com>
To: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Namhyung Kim <namhyung@kernel.org>, Jiri Olsa <jolsa@kernel.org>,
Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>,
James Clark <james.clark@linaro.org>,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v1] perf clang-format: Prioritize Python.h and expand other categories
Date: Tue, 26 May 2026 14:39:11 -0700 [thread overview]
Message-ID: <20260526213911.3993710-1-irogers@google.com> (raw)
- Prioritize Python.h by sorting it first (Priority 0).
- Shift other header priorities down to accommodate Python.h.
- Sanity check and complete "C Standard Library Headers" up to C23
(added stdbit.h, stdckdint.h).
- Sanity check and complete "OS/System-Specific Headers" based on
actual usage in tools/perf (added asm-generic, uapi, and various
flat POSIX/system headers).
Signed-off-by: Ian Rogers <irogers@google.com>
Assisted-by: Antigravity:gemini-3.5-flash
---
tools/perf/.clang-format | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/tools/perf/.clang-format b/tools/perf/.clang-format
index 902b2f7456f6..68b1c073d070 100644
--- a/tools/perf/.clang-format
+++ b/tools/perf/.clang-format
@@ -2,19 +2,22 @@ BasedOnStyle: InheritParentConfig
SortIncludes: true
IncludeBlocks: Regroup
IncludeCategories:
+ # Python.h must be first
+ - Regex: '^<Python\.h>'
+ Priority: 0
# Implicitly the corresponding header for the C file has Priority 0
# C Standard Library Headers
- - Regex: '^<(assert|complex|ctype|errno|fenv|float|inttypes|iso646|limits|locale|math|setjmp|signal|stdalign|stdarg|stdatomic|stdbool|stddef|stdint|stdio|stdlib|stdnoreturn|string|tgmath|threads|time|uchar|wchar|wctype)\.h>'
- Priority: 1
- # OS/System-Specific Headers (directories)
- - Regex: '^<(sys|linux|asm|arpa|net|netinet|x86_64|machine)/.*>'
+ - Regex: '^<(assert|complex|ctype|errno|fenv|float|inttypes|iso646|limits|locale|math|setjmp|signal|stdalign|stdarg|stdatomic|stdbit|stdbool|stdckdint|stddef|stdint|stdio|stdlib|stdnoreturn|string|tgmath|threads|time|uchar|wchar|wctype)\.h>'
Priority: 2
+ # OS/System-Specific Headers (directories)
+ - Regex: '^<(arpa|asm|asm-generic|linux|machine|net|netinet|sys|uapi|x86_64)/.*>'
+ Priority: 3
# OS/System-Specific Headers (POSIX/System flat headers)
- - Regex: '^<(unistd|pthread|fcntl|dirent|dlfcn|poll|sched|semaphore|spawn|syslog|termios|pwd|grp|netdb|sysexits|err|paths|pty|utmp|resolv|ifaddrs|elf|libelf|gelf)\.h>'
- Priority: 2
+ - Regex: '^<(aio|byteswap|dirent|dlfcn|elf|endian|err|execinfo|fcntl|features|fnmatch|ftw|gelf|getopt|grp|ifaddrs|libelf|libgen|malloc|memory|mntent|netdb|numa|numaif|paths|poll|pthread|pty|pwd|regex|resolv|sched|semaphore|spawn|strings|syscall|sysexits|syslog|termios|unistd|utmp|x86intrin)\.h>'
+ Priority: 3
# Third-Party Library Headers
- Regex: '^<.*>'
- Priority: 3
+ Priority: 4
# Your Project's Other Headers
- Regex: '^".*"'
- Priority: 4
+ Priority: 5
--
2.54.0.823.g6e5bcc1fc9-goog
next reply other threads:[~2026-05-26 21:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-26 21:39 Ian Rogers [this message]
2026-05-26 22:42 ` [PATCH v2] " Ian Rogers
2026-06-05 6:24 ` [PATCH v3] " Ian Rogers
2026-07-12 6:56 ` Namhyung Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260526213911.3993710-1-irogers@google.com \
--to=irogers@google.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=james.clark@linaro.org \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®