Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

delayacct: fix build regression on accounting tool

The accounting tool was modified for the original ABI using a custom
'timespec64' type in linux/taskstats.h, which I changed to use the regular
__kernel_timespec type, causing a build failure:

getdelays.c:202:45: warning: 'struct timespec64' declared inside parameter list will not be visible outside of this definition or declaration

202 | static const char *format_timespec64(struct timespec64 *ts)
| ^~~~~~~~~~

Change the tool to match the updated header.

Link: https://lkml.kernel.org/r/20260210103427.2984963-1-arnd@kernel.org
Fixes: 503efe850c74 ("delayacct: add timestamp of delay max")
Fixes: f06e31eef4c1 ("delayacct: fix uapi timespec64 definition")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/r/202602091611.lxgINqXp-lkp@intel.com/
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Arnd Bergmann and committed by
Andrew Morton
9333980c 0dddf20b

+6 -6
+6 -6
tools/accounting/getdelays.c
··· 196 196 #define delay_ms(t) (t / 1000000ULL) 197 197 198 198 /* 199 - * Format timespec64 to human readable string (YYYY-MM-DD HH:MM:SS) 199 + * Format __kernel_timespec to human readable string (YYYY-MM-DD HH:MM:SS) 200 200 * Returns formatted string or "N/A" if timestamp is zero 201 201 */ 202 - static const char *format_timespec64(struct timespec64 *ts) 202 + static const char *format_timespec(struct __kernel_timespec *ts) 203 203 { 204 204 static char buffer[32]; 205 205 struct tm tm_info; 206 - time_t time_sec; 206 + __kernel_time_t time_sec; 207 207 208 208 /* Check if timestamp is zero (not set) */ 209 209 if (ts->tv_sec == 0 && ts->tv_nsec == 0) 210 210 return "N/A"; 211 211 212 - time_sec = (time_t)ts->tv_sec; 212 + time_sec = ts->tv_sec; 213 213 214 214 /* Use thread-safe localtime_r */ 215 215 if (localtime_r(&time_sec, &tm_info) == NULL) ··· 257 257 average_ms((double)(t)->cpu_delay_total, (t)->cpu_count), \ 258 258 delay_ms((double)(t)->cpu_delay_max), \ 259 259 delay_ms((double)(t)->cpu_delay_min), \ 260 - format_timespec64(&(t)->cpu_delay_max_ts)); \ 260 + format_timespec(&(t)->cpu_delay_max_ts)); \ 261 261 } else if (version >= 16) { \ 262 262 printf("%-10s%15s%15s%15s%15s%15s%15s%15s\n", \ 263 263 "CPU", "count", "real total", "virtual total", \ ··· 316 316 average_ms((double)(t)->total, (t)->count), \ 317 317 delay_ms((double)(t)->max), \ 318 318 delay_ms((double)(t)->min), \ 319 - format_timespec64(&(t)->max_ts)); \ 319 + format_timespec(&(t)->max_ts)); \ 320 320 } else if (version >= 16) { \ 321 321 printf("%-10s%15s%15s%15s%15s%15s\n", \ 322 322 name, "count", "delay total", "delay average", \