Linux Documentation
 help / color / mirror / Atom feed
* [PATCH 0/3] tools/accounting: refactor delay fields and share format_timespec()
@ 2026-07-11  9:31 wang.yaxin
  2026-07-11  9:32 ` [PATCH 1/3] delaytop: refactor repetitive delay fields into array with enum wang.yaxin
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: wang.yaxin @ 2026-07-11  9:31 UTC (permalink / raw)
  To: akpm, fan.yu9, yang.yang29
  Cc: corbet, linux-kernel, linux-doc, xu.xin16, wang.yaxin

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

- Convert per-field delay members in struct task_info to an array indexed
  by enum delay_type, eliminating offsetof() pointer arithmetic.

- Factor out a common format_timespec() implementation shared by getdelays
  and delaytop, using strftime for cleaner timestamp formatting.

- Replace the complex sizeof/ULL/shift Y2038 guard with a direct narrowing
  truncation check ((long long)time_sec != ts->tv_sec).

Wang Yaxin (3):
  delaytop: refactor repetitive delay fields into array with enum
  tools/accounting: factor out shared format_timespec() implementation
  tools/accounting: simplify 32-bit time_t overflow check in
    format_timespec()

 tools/accounting/Makefile             |  12 +-
 tools/accounting/delaytop.c           | 261 +++++++++-----------------
 tools/accounting/format_timespec.c    |  37 ++++
 tools/accounting/format_timespec.h    |   9 +
 tools/accounting/getdelays.c          |  32 +---
 tools/include/uapi/linux/time_types.h |  18 ++
 6 files changed, 169 insertions(+), 200 deletions(-)
 create mode 100644 tools/accounting/format_timespec.c
 create mode 100644 tools/accounting/format_timespec.h
 create mode 100644 tools/include/uapi/linux/time_types.h

-- 
2.27.0

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

end of thread, other threads:[~2026-07-14  3:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-11  9:31 [PATCH 0/3] tools/accounting: refactor delay fields and share format_timespec() wang.yaxin
2026-07-11  9:32 ` [PATCH 1/3] delaytop: refactor repetitive delay fields into array with enum wang.yaxin
2026-07-14  3:07   ` xu.xin16
2026-07-11  9:33 ` [PATCH 2/3] tools/accounting: factor out shared format_timespec() implementation wang.yaxin
2026-07-11  9:34 ` [PATCH 3/3] tools/accounting: simplify 32-bit time_t overflow check in format_timespec() wang.yaxin
2026-07-14  2:48 ` [PATCH 0/3] tools/accounting: refactor delay fields and share format_timespec() Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox