Go to file
Fan Yu 085dece6cc tools/getdelays: add backward compatibility for taskstats version
Add version checks to print_delayacct() to handle differences in struct
taskstats across kernel versions.  Field availability depends on taskstats
version (t->version), corresponding to TASKSTATS_VERSION in kernel headers
(see include/uapi/linux/taskstats.h).

Version feature mapping:
- version >= 11  - supports COMPACT statistics
- version >= 13  - supports WPCOPY statistics
- version >= 14  - supports IRQ statistics
- version >= 16  - supports *_max and *_min delay statistics

This ensures the tool works correctly with both older and newer kernel
versions by conditionally printing fields based on the reported version.

eg.1
bash# grep -r "#define TASKSTATS_VERSION" /usr/include/linux/taskstats.h
"#define TASKSTATS_VERSION       10"
bash# ./getdelays -d -p 1
CPU                 count     real total  virtual total    delay total  delay average
                     7481     3786181709     3807098291       36393725          0.005ms
IO                  count    delay total  delay average
                      369     1116046035          3.025ms
SWAP                count    delay total  delay average
                        0              0          0.000ms
RECLAIM             count    delay total  delay average
                        0              0          0.000ms
THRASHING           count    delay total  delay average
                        0              0          0.000ms

eg.2
bash# grep -r "#define TASKSTATS_VERSION" /usr/include/linux/taskstats.h
"#define TASKSTATS_VERSION       14"
bash# ./getdelays -d -p 1
CPU                 count     real total  virtual total    delay total  delay average
                    68862   163474790046   174584722267    19962496806          0.290ms
IO                  count    delay total  delay average
                        0              0          0.000ms
SWAP                count    delay total  delay average
                        0              0          0.000ms
RECLAIM             count    delay total  delay average
                        0              0          0.000ms
THRASHING           count    delay total  delay average
                        0              0          0.000ms
COMPACT             count    delay total  delay average
                        0              0          0.000ms
WPCOPY              count    delay total  delay average
                        0              0          0.000ms
IRQ                 count    delay total  delay average
                        0              0          0.000ms

Link: https://lkml.kernel.org/r/20250731225326549CttJ7g9NfjTlaqBwl015T@zte.com.cn
Signed-off-by: Fan Yu <fan.yu9@zte.com.cn>
Cc: Fan Yu <fan.yu9@zte.com.cn>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Wang Yaxin <wang.yaxin@zte.com.cn>
Cc: xu xin <xu.xin16@zte.com.cn>
Cc: Yang Yang <yang.yang29@zte.com.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-08-02 12:01:41 -07:00
Documentation delaytop: enhance error logging and add PSI feature description 2025-08-02 12:01:41 -07:00
LICENSES
arch KVM: x86: fix typo "notifer" 2025-08-02 12:01:39 -07:00
block
certs
crypto lib/raid6: replace custom zero page with ZERO_PAGE 2025-07-09 22:57:54 -07:00
drivers net: mvneta: fix typo "notifer" 2025-08-02 12:01:40 -07:00
fs fat: fix too many log in fat_chain_add() 2025-08-02 12:01:40 -07:00
include xen/xenbus: fix typo "notifer" 2025-08-02 12:01:40 -07:00
init init/Kconfig: restore CONFIG_BROKEN help text 2025-08-02 12:01:37 -07:00
io_uring
ipc
kernel ucount: use atomic_long_try_cmpxchg() in atomic_long_inc_below() 2025-08-02 12:01:38 -07:00
lib kho: add test for kexec handover 2025-08-02 12:01:41 -07:00
mm vfs-6.16-rc5.fixes 2025-07-04 09:06:49 -07:00
net Including fixes from Bluetooth. 2025-07-03 09:18:55 -07:00
rust
samples samples: Kconfig: fix spelling mistake "instancess" -> "instances" 2025-08-02 12:01:41 -07:00
scripts scripts/spelling.txt: add notifer||notifier to spelling.txt 2025-08-02 12:01:40 -07:00
security
sound
tools tools/getdelays: add backward compatibility for taskstats version 2025-08-02 12:01:41 -07:00
usr
virt
.clang-format
.clippy.toml
.cocciconfig
.editorconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap mailmap: update Sachin Mokashi's email address 2025-07-09 22:57:56 -07:00
.pylintrc
.rustfmt.toml
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS kho: add test for kexec handover 2025-08-02 12:01:41 -07:00
Makefile Linux 6.16-rc5 2025-07-06 14:10:26 -07:00
README

README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the reStructuredText markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.