Skip to content

Commit 9333980

Browse files
arndbakpm00
authored andcommitted
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: 503efe8 ("delayacct: add timestamp of delay max") Fixes: f06e31e ("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>
1 parent 0dddf20 commit 9333980

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

tools/accounting/getdelays.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,20 +196,20 @@ static int get_family_id(int sd)
196196
#define delay_ms(t) (t / 1000000ULL)
197197

198198
/*
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)
200200
* Returns formatted string or "N/A" if timestamp is zero
201201
*/
202-
static const char *format_timespec64(struct timespec64 *ts)
202+
static const char *format_timespec(struct __kernel_timespec *ts)
203203
{
204204
static char buffer[32];
205205
struct tm tm_info;
206-
time_t time_sec;
206+
__kernel_time_t time_sec;
207207

208208
/* Check if timestamp is zero (not set) */
209209
if (ts->tv_sec == 0 && ts->tv_nsec == 0)
210210
return "N/A";
211211

212-
time_sec = (time_t)ts->tv_sec;
212+
time_sec = ts->tv_sec;
213213

214214
/* Use thread-safe localtime_r */
215215
if (localtime_r(&time_sec, &tm_info) == NULL)
@@ -257,7 +257,7 @@ static const char *format_timespec64(struct timespec64 *ts)
257257
average_ms((double)(t)->cpu_delay_total, (t)->cpu_count), \
258258
delay_ms((double)(t)->cpu_delay_max), \
259259
delay_ms((double)(t)->cpu_delay_min), \
260-
format_timespec64(&(t)->cpu_delay_max_ts)); \
260+
format_timespec(&(t)->cpu_delay_max_ts)); \
261261
} else if (version >= 16) { \
262262
printf("%-10s%15s%15s%15s%15s%15s%15s%15s\n", \
263263
"CPU", "count", "real total", "virtual total", \
@@ -316,7 +316,7 @@ static const char *format_timespec64(struct timespec64 *ts)
316316
average_ms((double)(t)->total, (t)->count), \
317317
delay_ms((double)(t)->max), \
318318
delay_ms((double)(t)->min), \
319-
format_timespec64(&(t)->max_ts)); \
319+
format_timespec(&(t)->max_ts)); \
320320
} else if (version >= 16) { \
321321
printf("%-10s%15s%15s%15s%15s%15s\n", \
322322
name, "count", "delay total", "delay average", \

0 commit comments

Comments
 (0)