Skip to contentSkip to conversation

delayacct: fix build regression on accounting tool

PATCH Applied Arnd Bergmann 2 participants 2 messages Feb 10 – Feb 13 Task delay monitoring tools

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 delayacct: fix build regression on accounting tool

From: Arnd Bergmann <[email protected]>

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.

Fixes 503efe850c74 ("delayacct: add timestamp of delay max")
Fixes f06e31eef4c1 ("delayacct: fix uapi timespec64 definition")
---
 tools/accounting/getdelays.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
tools/accounting/getdelays.c +6 -6
index 64796c0223be..50792df27707 100644
@@ -196,20 +196,20 @@ static int get_family_id(int sd)
 #define delay_ms(t) (t / 1000000ULL)
 
 /*
- * Format timespec64 to human readable string (YYYY-MM-DD HH:MM:SS)
+ * Format __kernel_timespec to human readable string (YYYY-MM-DD HH:MM:SS)
  * Returns formatted string or "N/A" if timestamp is zero
  */
-static const char *format_timespec64(struct timespec64 *ts)
+static const char *format_timespec(struct __kernel_timespec *ts)
 {
 	static char buffer[32];
 	struct tm tm_info;
-	time_t time_sec;
+	__kernel_time_t time_sec;
 
 	/* Check if timestamp is zero (not set) */
 	if (ts->tv_sec == 0 && ts->tv_nsec == 0)
 		return "N/A";
 
-	time_sec = (time_t)ts->tv_sec;
+	time_sec = ts->tv_sec;
 
 	/* Use thread-safe localtime_r */
 	if (localtime_r(&time_sec, &tm_info) == NULL)
@@ -257,7 +257,7 @@ static const char *format_timespec64(struct timespec64 *ts)
 				average_ms((double)(t)->cpu_delay_total, (t)->cpu_count), \
 				delay_ms((double)(t)->cpu_delay_max), \
 				delay_ms((double)(t)->cpu_delay_min), \
-				format_timespec64(&(t)->cpu_delay_max_ts)); \
+				format_timespec(&(t)->cpu_delay_max_ts)); \
 		} else if (version >= 16) { \
 			printf("%-10s%15s%15s%15s%15s%15s%15s%15s\n", \
 				"CPU", "count", "real total", "virtual total", \
@@ -316,7 +316,7 @@ static const char *format_timespec64(struct timespec64 *ts)
 				average_ms((double)(t)->total, (t)->count), \
 				delay_ms((double)(t)->max), \
 				delay_ms((double)(t)->min), \
-				format_timespec64(&(t)->max_ts)); \
+				format_timespec(&(t)->max_ts)); \
 		} else if (version >= 16) { \
 			printf("%-10s%15s%15s%15s%15s%15s\n", \
 				name, "count", "delay total", "delay average", \
Signature · 1 line
2.39.5
#1 lore raw
Quoted 11 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

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)
| ^~~~~~~~~~

Quoted 6 lines

Change the tool to match the updated header.

Fixes 503efe850c74 ("delayacct: add timestamp of delay max")
Fixes f06e31eef4c1 ("delayacct: fix uapi timespec64 definition")

JFTR, this commit was rebased, and is now commit 90079798f1d748e9 ("delayacct: fix uapi timespec64 definition") upstream.

Fixes 90079798f1d748e9 ("delayacct: fix uapi timespec64 definition")
Quoted 1 line

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds