]> granicus.if.org Git - strace/commitdiff
sched.c: introduce do_sched_rr_get_interval
authorDmitry V. Levin <ldv@altlinux.org>
Sat, 4 May 2019 23:15:52 +0000 (23:15 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 4 May 2019 23:15:52 +0000 (23:15 +0000)
This is going to be used to implement a parser of
sched_rr_get_interval_time64 syscall.

* sched.c (do_sched_rr_get_interval): New function.
(SYS_FUNC(sched_rr_get_interval)): Turn into a thin wrapper around
do_sched_rr_get_interval.

sched.c

diff --git a/sched.c b/sched.c
index 4bc0d98cbf239393b5982c87a80237d27882193f..ff0889a0ba83aeaaf723fe205f8e67a88897bd71 100644 (file)
--- a/sched.c
+++ b/sched.c
@@ -61,7 +61,9 @@ SYS_FUNC(sched_get_priority_min)
        return RVAL_DECODED;
 }
 
-SYS_FUNC(sched_rr_get_interval)
+static int
+do_sched_rr_get_interval(struct tcb *const tcp,
+                        const print_obj_by_addr_fn print_ts)
 {
        if (entering(tcp)) {
                tprintf("%d, ", (int) tcp->u_arg[0]);
@@ -69,11 +71,16 @@ SYS_FUNC(sched_rr_get_interval)
                if (syserror(tcp))
                        printaddr(tcp->u_arg[1]);
                else
-                       print_timespec(tcp, tcp->u_arg[1]);
+                       print_ts(tcp, tcp->u_arg[1]);
        }
        return 0;
 }
 
+SYS_FUNC(sched_rr_get_interval)
+{
+       return do_sched_rr_get_interval(tcp, print_timespec);
+}
+
 static void
 print_sched_attr(struct tcb *const tcp, const kernel_ulong_t addr,
                 unsigned int usize)