mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/3 v4] delaytop: add delay max, timestamp and sorting for top latency analysis 
@ 2026-09-08 14:50 wang.yaxin
  2026-09-08 14:52 ` [PATCH 1/3 v4] delaytop: add delay max for delaytop wang.yaxin
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: wang.yaxin @ 2026-09-08 14:50 UTC (permalink / raw)
  To: akpm, fan.yu9, yang.yang29, thomas.weissschuh
  Cc: corbet, linux-kernel, linux-doc, xu.xin16, wang.yaxin

From: Wang Yaxin <wang.yaxin@zte.com.cn>

Previously delaytop only showed average delays. This patch adds:

1. delay_max fields to track the maximum delay value for each delay type
   (cpu, blkio, irq, swapin, freepages, thrashing, compact, wpcopy)
   per task.

2. The -t/--type option displays only the specified delay type with avg/max
   values side by side, allowing focused analysis:
     delaytop -t cpu    # Show only CPU delay with avg/max
     delaytop -t wpcopy # Show Copy-on-Write delay with avg/max

3. Wall-clock timestamp when each maximum delay occurred, displayed in the
   MAX_TIMESTAMP column when using -t/--type option. This enables:
   - Identifying the time when a process experienced an abnormal delay max
   - Correlating delay max across multiple processes at the same timestamp
   - Cross-referencing with logs, traces, or other metrics at that time

4. When using -t/--type option, tasks are sorted by maximum delay value in
   descending order (largest delay first), enabling quick identification of
   top N processes with highest delay spikes.

Signed-off-by: Wang Yaxin <wang.yaxin@zte.com.cn>

v3->v4:
[patch 3/3]
1. Fix ReST syntax errors (indentation, list formatting) that triggered
warnings when running 'make htmldocs'. No content changes are made.

v2->v3:
[patch 1/3]
1. fix get_field_by_name() MODE_TYPE filter breaking --sort for non-type fields
2. zero-init stats struct and cap memcpy size in netlink response parsing
3. fix compare_tasks() count field read as unsigned long long for 32-bit safety

[patch 2/3]
1. fix 32-bit time_t overflow check to use max representable value instead of (time_t)-1
2. fix gmtime() pointer aliasing by assigning timespec64 tv_sec to local time_t

[patch 3/3]
1. fixed Y2038 overflow false negative in format_kernel_timespec()
2. switched to localtime_r() with stack `struct tm` for thread safety.

Wang Yaxin (3):
  delaytop: add delay max for delaytop
  delaytop: add timestamp of delay max
  delaytop: sort by max delay to highlight top latency processes

 Documentation/accounting/delay-accounting.rst |  87 ++++--
 Documentation/sphinx/maintainers_include.py   |   2 +-
 tools/accounting/delaytop.c                   | 286 +++++++++++++++---
 tools/accounting/getdelays.c                  |   5 +
 4 files changed, 319 insertions(+), 61 deletions(-)

-- 
2.47.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-09-08 18:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-08 14:50 [PATCH 0/3 v4] delaytop: add delay max, timestamp and sorting for top latency analysis wang.yaxin
2026-09-08 14:52 ` [PATCH 1/3 v4] delaytop: add delay max for delaytop wang.yaxin
2026-09-08 14:54 ` [PATCH 2/3 v4] delaytop: add timestamp of delay max wang.yaxin
2026-09-08 14:55 ` [PATCH 3/3 v4] delaytop: sort by max delay to highlight top latency processes wang.yaxin
2026-09-08 18:23 ` [PATCH 0/3 v4] delaytop: add delay max, timestamp and sorting for top latency analysis Andrew Morton

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®