From: Victor Krapivensky Date: Sat, 15 Apr 2017 08:43:12 +0000 (+0300) Subject: Update statx parser and syscall entries lists to the upstream X-Git-Tag: v4.17~90 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f67d2ba565d953b3555d3a74d400f523d7fc2645;p=strace Update statx parser and syscall entries lists to the upstream * linux/32/syscallent.h [291]: Add statx entry. * linux/64/syscallent.h [291]: Likewise. * linux/arm/syscallent.h [397]: Likewise. * linux/m68k/syscallent.h [379]: Likewise. * linux/mips/syscallent-n32.h [6330]: Likewise. * linux/mips/syscallent-n64.h [5326]: Likewise. * linux/mips/syscallent-o32.h [4366]: Likewise. * linux/powerpc/syscallent.h [383]: Likewise. * linux/s390/syscallent.h [379]: Likewise. * linux/s390x/syscallent.h [379]: Likewise. * linux/xtensa/syscallent.h [351]: Likewise. * statx.h (struct_statx): Update. * statx.c (SYS_FUNC(statx)): Print struct_statx.stx_attributes_mask. * tests/xstatx.c (print_stat, main): Update to test decoding of struct_statx.stx_attributes_mask. --- diff --git a/linux/32/syscallent.h b/linux/32/syscallent.h index c5457e9e..7b609cbf 100644 --- a/linux/32/syscallent.h +++ b/linux/32/syscallent.h @@ -281,6 +281,7 @@ [288] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, [289] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, [290] = { 1, 0, SEN(pkey_free), "pkey_free" }, +[291] = { 5, TD|TF, SEN(statx), "statx" }, #undef sys_ARCH_mmap #undef ARCH_WANT_SYNC_FILE_RANGE2 diff --git a/linux/64/syscallent.h b/linux/64/syscallent.h index 2575c584..d137d246 100644 --- a/linux/64/syscallent.h +++ b/linux/64/syscallent.h @@ -274,3 +274,4 @@ [288] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, [289] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, [290] = { 1, 0, SEN(pkey_free), "pkey_free" }, +[291] = { 5, TD|TF, SEN(statx), "statx" }, diff --git a/linux/arm/syscallent.h b/linux/arm/syscallent.h index d404355b..a74d7ac5 100644 --- a/linux/arm/syscallent.h +++ b/linux/arm/syscallent.h @@ -421,6 +421,7 @@ [394] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, [395] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, [396] = { 1, 0, SEN(pkey_free), "pkey_free" }, +[397] = { 5, TD|TF, SEN(statx), "statx" }, #ifdef __ARM_EABI__ # define ARM_FIRST_SHUFFLED_SYSCALL 400 diff --git a/linux/m68k/syscallent.h b/linux/m68k/syscallent.h index cd61a37c..abde584b 100644 --- a/linux/m68k/syscallent.h +++ b/linux/m68k/syscallent.h @@ -404,6 +404,7 @@ [376] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, [377] = { 6, TD, SEN(preadv2), "preadv2" }, [378] = { 6, TD, SEN(pwritev2), "pwritev2" }, +[379] = { 5, TD|TF, SEN(statx), "statx" }, #define SYS_socket_subcall 400 #include "subcall.h" diff --git a/linux/mips/syscallent-n32.h b/linux/mips/syscallent-n32.h index 7ff61a1a..5d5ce9c2 100644 --- a/linux/mips/syscallent-n32.h +++ b/linux/mips/syscallent-n32.h @@ -330,6 +330,7 @@ [6327] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, [6328] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, [6329] = { 1, 0, SEN(pkey_free), "pkey_free" }, +[6330] = { 5, TD|TF, SEN(statx), "statx" }, # define SYS_socket_subcall 6400 # include "subcall.h" diff --git a/linux/mips/syscallent-n64.h b/linux/mips/syscallent-n64.h index 4079c64d..271c7be6 100644 --- a/linux/mips/syscallent-n64.h +++ b/linux/mips/syscallent-n64.h @@ -326,6 +326,7 @@ [5323] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, [5324] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, [5325] = { 1, 0, SEN(pkey_free), "pkey_free" }, +[5326] = { 5, TD|TF, SEN(statx), "statx" }, # define SYS_socket_subcall 5400 # include "subcall.h" diff --git a/linux/mips/syscallent-o32.h b/linux/mips/syscallent-o32.h index e0943552..1ba14935 100644 --- a/linux/mips/syscallent-o32.h +++ b/linux/mips/syscallent-o32.h @@ -366,6 +366,7 @@ [4363] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, [4364] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, [4365] = { 1, 0, SEN(pkey_free), "pkey_free" }, +[4366] = { 5, TD|TF, SEN(statx), "statx" }, # define SYS_socket_subcall 4400 # include "subcall.h" diff --git a/linux/powerpc/syscallent.h b/linux/powerpc/syscallent.h index 3bcb79d1..dc8be613 100644 --- a/linux/powerpc/syscallent.h +++ b/linux/powerpc/syscallent.h @@ -409,6 +409,7 @@ [380] = { 6, TD, SEN(preadv2), "preadv2" }, [381] = { 6, TD, SEN(pwritev2), "pwritev2" }, [382] = { 5, TD, SEN(kexec_file_load), "kexec_file_load" }, +[383] = { 5, TD|TF, SEN(statx), "statx" }, #define SYS_socket_subcall 400 #include "subcall.h" diff --git a/linux/s390/syscallent.h b/linux/s390/syscallent.h index a3fd6f83..805756df 100644 --- a/linux/s390/syscallent.h +++ b/linux/s390/syscallent.h @@ -406,6 +406,8 @@ [375] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, [376] = { 6, TD, SEN(preadv2), "preadv2" }, [377] = { 6, TD, SEN(pwritev2), "pwritev2" }, +[378] = { }, +[379] = { 5, TD|TF, SEN(statx), "statx" }, #define SYS_socket_subcall 400 #include "subcall.h" diff --git a/linux/s390x/syscallent.h b/linux/s390x/syscallent.h index 6179f346..67fb0ee0 100644 --- a/linux/s390x/syscallent.h +++ b/linux/s390x/syscallent.h @@ -390,6 +390,8 @@ [375] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, [376] = { 6, TD, SEN(preadv2), "preadv2" }, [377] = { 6, TD, SEN(pwritev2), "pwritev2" }, +[378] = { }, +[379] = { 5, TD|TF, SEN(statx), "statx" }, #define SYS_socket_subcall 400 #include "subcall.h" diff --git a/linux/xtensa/syscallent.h b/linux/xtensa/syscallent.h index dd8e3b59..43b8c5fd 100644 --- a/linux/xtensa/syscallent.h +++ b/linux/xtensa/syscallent.h @@ -336,3 +336,5 @@ [345] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, [346] = { 6, TD, SEN(preadv2), "preadv2" }, [347] = { 6, TD, SEN(pwritev2), "pwritev2" }, +[348 ... 350] = { }, +[351] = { 5, TD|TF, SEN(statx), "statx" }, diff --git a/statx.c b/statx.c index 7c647fa3..c53f29c2 100644 --- a/statx.c +++ b/statx.c @@ -94,6 +94,11 @@ SYS_FUNC(statx) if (!abbrev(tcp)) { PRINT_FIELD_U(stx_blocks); + + tprints(", stx_attributes_mask="); + printflags(statx_attrs, stx.stx_attributes_mask, + "STATX_ATTR_???"); + PRINT_FIELD_TIME(stx_atime); PRINT_FIELD_TIME(stx_btime); PRINT_FIELD_TIME(stx_ctime); diff --git a/statx.h b/statx.h index d946291a..20372870 100644 --- a/statx.h +++ b/statx.h @@ -51,7 +51,8 @@ typedef struct { uint64_t stx_ino; /* Inode number */ uint64_t stx_size; /* File size */ uint64_t stx_blocks; /* Number of 512-byte blocks allocated */ - uint64_t reserved1[1]; + uint64_t stx_attributes_mask; /* Mask to show what's supported in + stx_attributes */ struct_statx_timestamp stx_atime; /* Last access time */ struct_statx_timestamp stx_btime; /* File creation time */ diff --git a/tests/xstatx.c b/tests/xstatx.c index 774aae00..f4e1a90f 100644 --- a/tests/xstatx.c +++ b/tests/xstatx.c @@ -224,6 +224,10 @@ print_stat(const STRUCT_STAT *st) PRINT_FIELD_U(stx_ino); PRINT_FIELD_U(stx_size); PRINT_FIELD_U(stx_blocks); + + printf(", stx_attributes_mask="); + printflags(statx_attrs, st->stx_attributes_mask, "STATX_ATTR_???"); + PRINT_FIELD_TIME(stx_atime); PRINT_FIELD_TIME(stx_btime); PRINT_FIELD_TIME(stx_ctime); @@ -338,6 +342,7 @@ main(void) LOG_STAT_OFFSETOF_SIZEOF(*st, stx_ino); LOG_STAT_OFFSETOF_SIZEOF(*st, stx_size); LOG_STAT_OFFSETOF_SIZEOF(*st, stx_blocks); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_attributes_mask); LOG_STAT_OFFSETOF_SIZEOF(*st, stx_atime); LOG_STAT_OFFSETOF_SIZEOF(*st, stx_btime); LOG_STAT_OFFSETOF_SIZEOF(*st, stx_ctime);