From: William Manley Date: Fri, 9 Aug 2013 17:04:11 +0000 (+0100) Subject: Add support for decoding sync_file_range X-Git-Tag: v4.9~182 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=16b9dcf8b870f47305aa2db174f5abccefb7cd94;p=strace Add support for decoding sync_file_range * file.c (sync_file_range_flags): New xlat structure. (sys_sync_file_range, sys_sync_file_range2): New functions. * linux/syscall.h (sys_sync_file_range, sys_sync_file_range2): New prototypes. * linux/dummy.h (sys_sync_file_range, sys_sync_file_range2): Remove. * linux/mips/syscallent-o32.h: Set the number of sync_file_range arguments to 7. --- diff --git a/file.c b/file.c index 9a832875..016fc94d 100644 --- a/file.c +++ b/file.c @@ -2686,6 +2686,41 @@ sys_fadvise64_64(struct tcb *tcp) return 0; } +static const struct xlat sync_file_range_flags[] = { + { SYNC_FILE_RANGE_WAIT_BEFORE, "SYNC_FILE_RANGE_WAIT_BEFORE" }, + { SYNC_FILE_RANGE_WRITE, "SYNC_FILE_RANGE_WRITE" }, + { SYNC_FILE_RANGE_WAIT_AFTER, "SYNC_FILE_RANGE_WAIT_AFTER" }, + { 0, NULL } +}; + +int +sys_sync_file_range(struct tcb *tcp) +{ + if (entering(tcp)) { + int argn; + printfd(tcp, tcp->u_arg[0]); + argn = printllval(tcp, ", %lld, ", 1); + argn = printllval(tcp, "%lld, ", argn); + printflags(sync_file_range_flags, tcp->u_arg[argn], + "SYNC_FILE_RANGE_???"); + } + return 0; +} + +int +sys_sync_file_range2(struct tcb *tcp) +{ + if (entering(tcp)) { + int argn; + printfd(tcp, tcp->u_arg[0]); + printflags(sync_file_range_flags, 1, + "SYNC_FILE_RANGE_???"); + argn = printllval(tcp, ", %lld, ", 2); + argn = printllval(tcp, "%lld, ", argn); + } + return 0; +} + static const struct xlat inotify_modes[] = { { 0x00000001, "IN_ACCESS" }, { 0x00000002, "IN_MODIFY" }, diff --git a/linux/dummy.h b/linux/dummy.h index 9d33fe18..6af5ec7b 100644 --- a/linux/dummy.h +++ b/linux/dummy.h @@ -47,8 +47,6 @@ #define sys_name_to_handle_at printargs #define sys_open_by_handle_at printargs #define sys_request_key printargs -#define sys_sync_file_range printargs -#define sys_sync_file_range2 printargs #define sys_sysfs printargs #define sys_vm86old printargs #define sys_vm86 printargs diff --git a/linux/mips/syscallent-o32.h b/linux/mips/syscallent-o32.h index 3431b814..0608f9da 100644 --- a/linux/mips/syscallent-o32.h +++ b/linux/mips/syscallent-o32.h @@ -305,7 +305,7 @@ { 5, TD, sys_ppoll, "ppoll" }, /* 4302 */ { 1, TP, sys_unshare, "unshare" }, /* 4303 */ { 6, TD, sys_splice, "splice" }, /* 4304 */ - { 6, TD, sys_sync_file_range, "sync_file_range" }, /* 4305 */ + { 7, TD, sys_sync_file_range, "sync_file_range" }, /* 4305 */ { 4, TD, sys_tee, "tee" }, /* 4306 */ { 4, TD, sys_vmsplice, "vmsplice" }, /* 4307 */ { 6, TM, sys_move_pages, "move_pages" }, /* 4308 */ diff --git a/linux/syscall.h b/linux/syscall.h index f6afcac0..502e8eb5 100644 --- a/linux/syscall.h +++ b/linux/syscall.h @@ -267,6 +267,8 @@ int sys_statfs64(); int sys_stime(); int sys_swapon(); int sys_symlinkat(); +int sys_sync_file_range(); +int sys_sync_file_range2(); int sys_sysctl(); int sys_sysinfo(); int sys_syslog();