Skip to contentSkip to conversation

cobalt/posix: Remove duplicate clock_getres trace events

PATCH Applied Guangfeng Wang 2 participants 2 messages Nov 28 – Nov 29

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cobalt/posix: Remove duplicate clock_getres trace events

Both clock_getres and clock_getres64 emit a cobalt_clock_getres trace event in their syscall handlers, although __cobalt_clock_getres() already emits the same event.

Testing on native x86_64 with Linux 6.12.90-cip24 showed that ten successful clock_getres64 calls generated twenty events before the fix and ten afterwards.

Additional tests covering both syscall interfaces, three clock IDs, NULL pointers, inaccessible user addresses and invalid clock IDs passed before and after the fix. The number of clock resolution events decreased from eighteen to ten, with unchanged return values and clock resolutions.

Fixes 8325e4c3076f ("cobalt/posix/clock: prepare for 32bit syscall emulation")
---
 kernel/cobalt/posix/clock.c | 4 ----
 1 file changed, 4 deletions(-)
kernel/cobalt/posix/clock.c +0 -4
index e6c187ca4..696705bd0 100644
@@ -88,8 +88,6 @@ COBALT_SYSCALL(clock_getres, current,
 	if (u_ts && cobalt_put_old_timespec(u_ts, &ts))
 		return -EFAULT;
 
-	trace_cobalt_clock_getres(clock_id, &ts);
-
 	return 0;
 }
 
@@ -106,8 +104,6 @@ COBALT_SYSCALL(clock_getres64, current,
 	if (u_ts && cobalt_put_timespec64(&ts, u_ts))
 		return -EFAULT;
 
-	trace_cobalt_clock_getres(clock_id, &ts);
-
 	return 0;
 }
 
Signature · 1 line
2.47.3
Applied
#1 lore raw
Quoted 35 lines · Guangfeng Wang

Both clock_getres and clock_getres64 emit a cobalt_clock_getres trace event in their syscall handlers, although __cobalt_clock_getres() already emits the same event.

Testing on native x86_64 with Linux 6.12.90-cip24 showed that ten successful clock_getres64 calls generated twenty events before the fix and ten afterwards.

Additional tests covering both syscall interfaces, three clock IDs, NULL pointers, inaccessible user addresses and invalid clock IDs passed before and after the fix. The number of clock resolution events decreased from eighteen to ten, with unchanged return values and clock resolutions.

Fixes 8325e4c3076f ("cobalt/posix/clock: prepare for 32bit syscall emulation")
---
 kernel/cobalt/posix/clock.c | 4 ----
 1 file changed, 4 deletions(-)
kernel/cobalt/posix/clock.c +0 -2
index e6c187ca4..696705bd0 100644
@@ -88,8 +88,6 @@ COBALT_SYSCALL(clock_getres, current,
 	if (u_ts && cobalt_put_old_timespec(u_ts, &ts))
 		return -EFAULT;
 
-	trace_cobalt_clock_getres(clock_id, &ts);
-
 	return 0;
 }
 

kernel/cobalt/posix/clock.c COBALT_SYSCALL(clock_getres64, current, · line 109

Quoted 8 lines
kernel/cobalt/posix/clock.c +0 -2
@@ -106,8 +104,6 @@ COBALT_SYSCALL(clock_getres64, current,
 	if (u_ts && cobalt_put_timespec64(&ts, u_ts))
 		return -EFAULT;
 
-	trace_cobalt_clock_getres(clock_id, &ts);
-
 	return 0;
 }
 

That's another old one, indeed.

Thanks, applied.

Jan

Signature · 2 lines
Siemens AG, Foundational Technologies
Linux Expert Center