Re: GSOC:Microproject

2018-02-23 Thread Eugene Syromyatnikov
On Fri, Feb 23, 2018 at 8:47 AM, Masatake YAMATO  wrote:
> How about allowing a user to define ones' own class in ~/.strace?

By the way, since you've mentioned that, we've been thinking about
some options for configuration file for quite some time (not only for
custom group generation, but also for color output configuration, lua
invasiveness and other not-yet-merged stuff). Does anyone have any
ideas regarding a good configuration file syntax?

The other question is about prefix for user-configurable groups, it
probably shouldn't conflict with any existing syscall qualification
syntax, but, for example, "%%%" looks too unwieldy.

-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


[strace PATCH v2] Introduce s390_sthyi system call decoder

2018-01-22 Thread Eugene Syromyatnikov
* s390.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* linux/s390/syscallent.h ([380]): Change decoder to s390_sthyi.
* linux/s390x/syscallent.h: Likewise.
* xlat/s390_sthyi_function_codes.in: New file.
---
 Makefile.am   |1 +
 linux/s390/syscallent.h   |1 +
 linux/s390x/syscallent.h  |1 +
 s390.c| 1033 +
 xlat/s390_sthyi_function_codes.in |1 +
 5 files changed, 1037 insertions(+)
 create mode 100644 s390.c
 create mode 100644 xlat/s390_sthyi_function_codes.in

diff --git a/Makefile.am b/Makefile.am
index db822c5..7355ec9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -269,6 +269,7 @@ strace_SOURCES =\
rtnl_rule.c \
rtnl_tc.c   \
rtnl_tc_action.c \
+   s390.c  \
sched.c \
sched_attr.h\
scsi.c  \
diff --git a/linux/s390/syscallent.h b/linux/s390/syscallent.h
index 5482c53..dd1fbb1 100644
--- a/linux/s390/syscallent.h
+++ b/linux/s390/syscallent.h
@@ -409,6 +409,7 @@
 [377] = { 6,   TD, SEN(pwritev2),  "pwritev2"  
},
 [378] = { 2,   0,  SEN(printargs), 
"s390_guarded_storage"  },
 [379] = { 5,   TD|TF|TSTA, SEN(statx), "statx" 
},
+[380] = { 4,   0,  SEN(s390_sthyi),"s390_sthyi"
},
 
 #define SYS_socket_subcall 400
 #include "subcall.h"
diff --git a/linux/s390x/syscallent.h b/linux/s390x/syscallent.h
index 36b1aef..fe5b252 100644
--- a/linux/s390x/syscallent.h
+++ b/linux/s390x/syscallent.h
@@ -393,6 +393,7 @@
 [377] = { 6,   TD, SEN(pwritev2),  "pwritev2"  
},
 [378] = { 2,   0,  SEN(printargs), 
"s390_guarded_storage"  },
 [379] = { 5,   TD|TF|TSTA, SEN(statx), "statx" 
},
+[380] = { 4,   0,  SEN(s390_sthyi),"s390_sthyi"
},
 
 #define SYS_socket_subcall 400
 #include "subcall.h"
diff --git a/s390.c b/s390.c
new file mode 100644
index 000..0f49369
--- /dev/null
+++ b/s390.c
@@ -0,0 +1,1033 @@
+/*
+ * s390-specific syscalls decoders.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "defs.h"
+
+#if defined S390 || defined S390X
+
+#include 
+
+#include "print_fields.h"
+
+#include "xlat/s390_sthyi_function_codes.h"
+
+/*
+ * Since, for some reason, kernel doesn't expose all these nice constants and
+ * structures in UAPI, we have to re-declare them ourselves.
+ */
+
+/**
+ * "The header section is placed at the beginning of the response buffer and
+ * identifies the location and length of all other sections. Valid sections 
have
+ * nonzero offset values in the header. Each section provides information about
+ * validity of fields within that section."
+ */
+struct sthyi_hdr {
+   /**
+* Header Flag Byte 1 - These flag settings indicate the environment
+* that the instruction was executed in and may influence the value of
+* the validity bits. The validity bits, and not these flags, should be
+* used to determine if a field is valid.
+*  - 0x80 - Global Performance Data unavailable
+*  - 0x40 - One or more hypervisor levels below this level does not
+*   support the STHYI instruction. When this flag is set the
+*   value of INFGPDU is not meaningful because the state of the
+

[strace PATCH v2] tests: check s390_sthyi system call decoder

2018-01-22 Thread Eugene Syromyatnikov
* configure.ac (AC_CHECK_FUNCS): Add iconv_open.
(AC_CHECK_HEADERS): Add iconv.h.
* tests/s390_sthyi-v.c: New file.
* tests/s390_sthyi.c: Likewise.
* tests/.gitignore: Add s390_sthyi, s390_sthyi-v.
* tests/pure_executables.list: Likewise.
* tests/gen_tests.in (s390_sthyi, s390_sthyi): New tests.
---
 configure.ac|   2 +
 tests/.gitignore|   2 +
 tests/gen_tests.in  |   2 +
 tests/pure_executables.list |   2 +
 tests/s390_sthyi-v.c|   2 +
 tests/s390_sthyi.c  | 786 
 6 files changed, 796 insertions(+)
 create mode 100644 tests/s390_sthyi-v.c
 create mode 100644 tests/s390_sthyi.c

diff --git a/configure.ac b/configure.ac
index d962f19..001dfa8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -287,6 +287,7 @@ AC_CHECK_FUNCS(m4_normalize([
fstatat
ftruncate
futimens
+   iconv_open
if_indextoname
open64
prctl
@@ -394,6 +395,7 @@ AC_CHECK_HEADERS(m4_normalize([
asm/sysmips.h
bluetooth/bluetooth.h
elf.h
+   iconv.h
inttypes.h
linux/bsg.h
linux/cryptouser.h
diff --git a/tests/.gitignore b/tests/.gitignore
index 4c54589..19aa493 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -357,6 +357,8 @@ rt_sigsuspend
 rt_sigtimedwait
 rt_tgsigqueueinfo
 run_expect_termsig
+s390_sthyi
+s390_sthyi-v
 sched_get_priority_mxx
 sched_rr_get_interval
 sched_xetaffinity
diff --git a/tests/gen_tests.in b/tests/gen_tests.in
index 93b1687..968f6e4 100644
--- a/tests/gen_tests.in
+++ b/tests/gen_tests.in
@@ -303,6 +303,8 @@ rt_sigreturn-esignal='!USR1'
 rt_sigsuspend  -a20 -esignal=none
 rt_sigtimedwait-a38
 rt_tgsigqueueinfo  -esignal=none
+s390_sthyi -a47
+s390_sthyi-v   -e trace=s390_sthyi -a47
 sched  test_trace_expr times -e/sched
 sched_get_priority_mxx -a33 -e 
trace=sched_get_priority_min,sched_get_priority_max
 sched_rr_get_interval  -a31
diff --git a/tests/pure_executables.list b/tests/pure_executables.list
index 8f5ff31..d8b997d 100755
--- a/tests/pure_executables.list
+++ b/tests/pure_executables.list
@@ -296,6 +296,8 @@ rt_sigreturn
 rt_sigsuspend
 rt_sigtimedwait
 rt_tgsigqueueinfo
+s390_sthyi
+s390_sthyi-v
 sched_get_priority_mxx
 sched_rr_get_interval
 sched_xetaffinity
diff --git a/tests/s390_sthyi-v.c b/tests/s390_sthyi-v.c
new file mode 100644
index 000..8605520
--- /dev/null
+++ b/tests/s390_sthyi-v.c
@@ -0,0 +1,2 @@
+#define VERBOSE 1
+#include "s390_sthyi.c"
diff --git a/tests/s390_sthyi.c b/tests/s390_sthyi.c
new file mode 100644
index 000..8b241dd
--- /dev/null
+++ b/tests/s390_sthyi.c
@@ -0,0 +1,786 @@
+/*
+ * Check decoding of s390_sthyi syscall.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "tests.h"
+#include 
+
+#if defined HAVE_ICONV_H && defined HAVE_ICONV_OPEN && defined __NR_s390_sthyi
+
+# include 
+# include 
+# include 
+# include 
+# include 
+# include 
+# include 
+
+# include 
+
+# define EBCDIC_MAX_LEN 16
+
+# ifndef VERBOSE
+#  define VERBOSE 0
+# endif
+
+static bool
+print_0x8(const char *prefix, unsigned char *buf, unsigned int offs, bool zero)
+{
+   if (!zero && !buf[offs])
+   return false;
+
+   printf("%s=%#02hhx", prefix, buf[offs]);
+
+   return true;
+}
+
+static bool
+print_u8(const char *prefix, unsigned char *buf, unsigned int offs, bool zero)
+{
+   if (!zero && !buf[offs])
+   return false;
+
+   printf("%s=%hhu", prefix, buf[offs]);
+
+   return true;
+}
+

[PATCH 1/2] Implement decoding of riscv_flush_icache syscall

2018-01-22 Thread Eugene Syromyatnikov
* linux/riscv/syscallent.h ([259]): Add riscv_flush_icache entry.
* riscv.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* xlat/riscv_flush_icache_flags.in: New file.
* NEWS: Mention it.
---
 Makefile.am  |  1 +
 NEWS |  1 +
 linux/riscv/syscallent.h |  3 +++
 riscv.c  | 53 
 xlat/riscv_flush_icache_flags.in |  1 +
 5 files changed, 59 insertions(+)
 create mode 100644 riscv.c
 create mode 100644 xlat/riscv_flush_icache_flags.in

diff --git a/Makefile.am b/Makefile.am
index db822c5..f8061df 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -253,6 +253,7 @@ strace_SOURCES =\
regs.h  \
renameat.c  \
resource.c  \
+   riscv.c \
rt_sigframe.c   \
rt_sigreturn.c  \
rtc.c   \
diff --git a/NEWS b/NEWS
index c1ff7b0..e0f3eb9 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,7 @@ Noteworthy changes in release ?.?? (-??-??)
   * Enhanced decoding of get_thread_area, memfd_create, modify_ldt,
 perf_event_open, reboot, set_thread_area, and shmget syscalls.
   * Implemented decoding of KVM_* and DM_LIST_DEVICES ioctl commands.
+  * Implemented decoding of riscv_flush_icache syscall.
   * Enhanced decoding of getsockopt and setsockopt syscalls for SOL_NETLINK
 level.
   * Enhanced decoding of BPF_MAP_CREATE command of bpf syscall.
diff --git a/linux/riscv/syscallent.h b/linux/riscv/syscallent.h
index 7c416ef..3dfed89 100644
--- a/linux/riscv/syscallent.h
+++ b/linux/riscv/syscallent.h
@@ -1 +1,4 @@
 #include "64/syscallent.h"
+
+/* #define __NR_riscv_flush_icache (__NR_arch_specific_syscall + 15) */
+[259] = { 3,   TM, SEN(riscv_flush_icache),
"riscv_flush_icache"},
diff --git a/riscv.c b/riscv.c
new file mode 100644
index 000..aaa3932
--- /dev/null
+++ b/riscv.c
@@ -0,0 +1,53 @@
+/*
+ * RISC-V-specific syscall decoders.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "defs.h"
+
+#ifdef RISCV
+
+# include "xlat/riscv_flush_icache_flags.h"
+
+SYS_FUNC(riscv_flush_icache)
+{
+   /* uintptr_t start */
+   printaddr(tcp->u_arg[0]);
+
+   /* uintptr_t end */
+   tprints(", ");
+   printaddr(tcp->u_arg[1]);
+
+   /* uintptr_t flags */
+   tprints(", ");
+   printflags64(riscv_flush_icache_flags, tcp->u_arg[2],
+"SYS_RISCV_FLUSH_ICACHE_???");
+
+   return RVAL_DECODED;
+}
+
+#endif /* RISCV */
diff --git a/xlat/riscv_flush_icache_flags.in b/xlat/riscv_flush_icache_flags.in
new file mode 100644
index 000..173da07
--- /dev/null
+++ b/xlat/riscv_flush_icache_flags.in
@@ -0,0 +1 @@
+SYS_RISCV_FLUSH_ICACHE_LOCAL 1
-- 
2.1.4


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


[PATCH 2/2] tests: check riscv_flush_icache syscall decoder

2018-01-22 Thread Eugene Syromyatnikov
* tests/riscv_flush_icache.c: New file.
* tests/.gitignore: Add riscv_flush_icache.
* tests/gen_tests.in: Likewise.
* tests/pure_executables.list: Likewise.
---
 tests/.gitignore|  1 +
 tests/gen_tests.in  |  1 +
 tests/pure_executables.list |  1 +
 tests/riscv_flush_icache.c  | 93 +
 4 files changed, 96 insertions(+)
 create mode 100644 tests/riscv_flush_icache.c

diff --git a/tests/.gitignore b/tests/.gitignore
index 4c54589..2a95c6c 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -347,6 +347,7 @@ renameat
 renameat2
 request_key
 restart_syscall
+riscv_flush_icache
 rmdir
 rt_sigaction
 rt_sigpending
diff --git a/tests/gen_tests.in b/tests/gen_tests.in
index 93b1687..7ede93b 100644
--- a/tests/gen_tests.in
+++ b/tests/gen_tests.in
@@ -295,6 +295,7 @@ rename  -a35
 renameat
 renameat2
 request_key-a33 -s12
+riscv_flush_icache -a34
 rmdir  -a22
 rt_sigpending  -a20
 rt_sigprocmask
diff --git a/tests/pure_executables.list b/tests/pure_executables.list
index 8f5ff31..710d76e 100755
--- a/tests/pure_executables.list
+++ b/tests/pure_executables.list
@@ -287,6 +287,7 @@ rename
 renameat
 renameat2
 request_key
+riscv_flush_icache
 rmdir
 rt_sigaction
 rt_sigpending
diff --git a/tests/riscv_flush_icache.c b/tests/riscv_flush_icache.c
new file mode 100644
index 000..8aaeda5
--- /dev/null
+++ b/tests/riscv_flush_icache.c
@@ -0,0 +1,93 @@
+/*
+ * Check decoding of riscv_flush_icache syscall.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "tests.h"
+
+#include 
+
+#include "scno.h"
+
+#ifdef __NR_riscv_flush_icache
+
+# include 
+# include 
+# include 
+
+int main(void)
+{
+   static struct {
+   kernel_ulong_t addr;
+   const char *str;
+   } addrs[] = {
+   { (kernel_ulong_t) (uintptr_t) ARG_STR(NULL) },
+   { (kernel_ulong_t) 0xbadc0deddeadf157ULL,
+   sizeof(kernel_ulong_t) == 8 ? "0xbadc0deddeadf157" :
+   "0xdeadf157" },
+   };
+   static struct {
+   kernel_ulong_t val;
+   const char *str;
+   } flags[] = {
+   { ARG_STR(0) },
+   { 1, "SYS_RISCV_FLUSH_ICACHE_LOCAL" },
+   { (kernel_ulong_t) 0xfacefeedfffeULL,
+   sizeof(kernel_ulong_t) == 8 ?
+   "0xfacefeedfffe /* SYS_RISCV_FLUSH_ICACHE_??? */" :
+   "0xfffe /* SYS_RISCV_FLUSH_ICACHE_??? */" },
+   { (kernel_ulong_t) 0xfacefeedULL,
+   sizeof(kernel_ulong_t) == 8 ?
+   "SYS_RISCV_FLUSH_ICACHE_LOCAL|0xfacefeedfffe" :
+   "SYS_RISCV_FLUSH_ICACHE_LOCAL|0xfffe" },
+   };
+
+   for (size_t i = 0; i < ARRAY_SIZE(addrs); i++) {
+   for (size_t j = 0; j < ARRAY_SIZE(addrs); j++) {
+   for (size_t k = 0; k < ARRAY_SIZE(flags); k++) {
+   long rc = syscall(__NR_riscv_flush_icache,
+ addrs[i].addr,
+ addrs[j].addr,
+ flags[k].val);
+
+   printf("riscv_flush_icache(%s, %s, %s) = %s\n",
+  addrs[i].str, addrs[j].str, flags[k].str,
+  sprintrc(rc));
+   }
+   }
+   }
+
+   p

[PATCH v2] mpers: implement gawk 3 support

2018-01-21 Thread Eugene Syromyatnikov
Some old systems that still make some sense to be supported have only
gawk 3, so let's support them for now.

In order to achieve that, multiple changes have been implemented:
 - Multidimensional arrays are replaced with single-dimensional ones.
   In most places it's a "][" -> ", " replacement, as awk allows some
   kind of emulation of multidimensional arrays that way, but in several
   occasions (specifically for storing name and special fields) we have
   to iterate over them later, so we store that information in
   additional arrays in order to get the keys.
 - "switch" statements are replaced with sets of "if ... else if ...
   else" statements.  This change is trivial, except we've added
   a temporary variable in what_is order to store expression value, for
   readability purposes.
 - No support for array iteration ordering.  This one is most ugly of
   them all.  Luckily, not that ugly, we've just had to process index a
   bit in order to make it lexicographically sortable and add two
   temporary arrays containing sorted indices in order to sort over them
   instead of those two arrays that we've added in order to work around
   lack of multidimensional array support.

* mpers.awk (compare_indices): Remove unused function.
(array_get, update_upper_bound, /^DW_AT_data_member_location/,
/^DW_AT_byte_size/, /^DW_AT_encoding/): Replace multidimensional array
access with comma-concatenated index.
(norm_idx): New function.
(array_seq): Replace multidimensional array access with
comma-concatenated index.  Use comma-concatenated pair of (array_idx,
"seq") in order to check presence of the item in an array.
(what_is): Add enc and i local variables.  Store the value of
array[what_idx, "encoding"] in it.  Replace "switch" statements with
sets of "if ... else if ... else" statements.  Replace multidimensional
array access with comma-concatenated index. Use for (... ; ...; ...)
iteration over aparents_keys instead of iteration over array.
(/^<[[:xdigit:]]+>/): Store idx as norm_idx(matches[2]).  Replace
multidimensional array access with comma-concatenated index.  Store an
additional flag in array_names array.
(/^DW_AT_name/): Replace multidimensional array access with
comma-concatenated index.  Add a flag to array_names for that idx.
(/^DW_AT_type/): Do not capture "0x" as a part of a group, normalise
the captured group.  Replace multidimensional array access with
comma-concatenated index.
(/^Abbrev Number:[^(]+\(DW_TAG_/): Replace multidimensional array access
with comma-concatenated index.  Store additional flags in
array_special and array_parents arrays.
(END): Remove PROCINFO["sorted_in"] setup.  Sort array_parents.  Replace
multidimensional array access with comma-concatenated index.  Iterate
over array_special to go over all the items that have "special" field.
Iterate over array_names to go over all items that have "name" field.
---
 mpers.awk | 129 +++---
 1 file changed, 56 insertions(+), 73 deletions(-)

diff --git a/mpers.awk b/mpers.awk
index 9f8cb64..0d0ffb2 100644
--- a/mpers.awk
+++ b/mpers.awk
@@ -27,19 +27,10 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-function compare_indices(i1, v1, i2, v2, \
-c1, c2)
-{
-   c1 = strtonum(sprintf("%s", i1))
-   c2 = strtonum(sprintf("%s", i2))
-   if (c1 < c2)
-   return -1
-   return (c1 != c2)
-}
 function array_get(array_idx, array_member, \
   array_return)
 {
-   array_return = array[array_idx][array_member]
+   array_return = array[array_idx, array_member]
if ("" == array_return) {
printf("%s: index [%s] without %s\n",
   FILENAME, array_idx, array_member) > "/dev/stderr"
@@ -47,12 +38,16 @@ function array_get(array_idx, array_member, \
}
return array_return
 }
+function norm_idx(idx)
+{
+   return sprintf("%016s", idx)
+}
 function array_seq(array_idx)
 {
-   if ("seq" in array[array_idx])
-   return array[array_idx]["seq"]
+   if ((array_idx, "seq") in array)
+   return array[array_idx, "seq"]
index_seq++
-   array[array_idx]["seq"] = index_seq
+   array[array_idx, "seq"] = index_seq
return index_seq
 }
 function enter(array_idx,
@@ -75,72 +70,63 @@ function leave(array_idx, to_return)
 function update_upper_bound(idx, val, \
count)
 {
-   count = array[idx]["count"]
+   count = array[idx, "count"]
if (count == "")
count = 1
-   array[idx]["count"] = count * val
-   array[idx]["upper_bound"] = array[idx]["upper_bound"] "[" val "]"
+   array[idx, "count"] = count * val
+   array[idx, "upper_bound"] = array[idx, "upper_bound"] "[" val "]"
 }
 function what_is(what_idx, \
 item, loc_diff, location, prev_loca

[RFC PATCH] mpers.awk: enable support for gawk 3

2018-01-18 Thread Eugene Syromyatnikov
---
 mpers.awk | 132 +++---
 1 file changed, 58 insertions(+), 74 deletions(-)

diff --git a/mpers.awk b/mpers.awk
index 6545052..8374b3b 100644
--- a/mpers.awk
+++ b/mpers.awk
@@ -27,19 +27,10 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-function compare_indices(i1, v1, i2, v2, \
-c1, c2)
-{
-   c1 = strtonum(sprintf("%s", i1))
-   c2 = strtonum(sprintf("%s", i2))
-   if (c1 < c2)
-   return -1
-   return (c1 != c2)
-}
 function array_get(array_idx, array_member, \
   array_return)
 {
-   array_return = array[array_idx][array_member]
+   array_return = array[array_idx, array_member]
if ("" == array_return) {
printf("%s: index [%s] without %s\n",
   FILENAME, array_idx, array_member) > "/dev/stderr"
@@ -47,12 +38,16 @@ function array_get(array_idx, array_member, \
}
return array_return
 }
+function norm_idx(idx)
+{
+   return sprintf("%016s", idx)
+}
 function array_seq(array_idx)
 {
-   if ("seq" in array[array_idx])
-   return array[array_idx]["seq"]
+   if ((array_idx, "seq") in array)
+   return array[array_idx, "seq"]
index_seq++
-   array[array_idx]["seq"] = index_seq
+   array[array_idx, "seq"] = index_seq
return index_seq
 }
 function enter(array_idx,
@@ -75,72 +70,63 @@ function leave(array_idx, to_return)
 function update_upper_bound(idx, val, \
count)
 {
-   count = array[idx]["count"]
+   count = array[idx, "count"]
if (count == "")
count = 1
-   array[idx]["count"] = count * val
-   array[idx]["upper_bound"] = array[idx]["upper_bound"] "[" val "]"
+   array[idx, "count"] = count * val
+   array[idx, "upper_bound"] = array[idx, "upper_bound"] "[" val "]"
 }
 function what_is(what_idx, \
 item, loc_diff, location, prev_location, prev_returned_size, \
-special, to_return, type_idx)
+special, to_return, type_idx, enc)
 {
enter(what_idx)
special = array_get(what_idx, "special")
-   switch (special) {
-   case "base_type":
-   switch (array_get(what_idx, "encoding")) {
-   case 5: # signed
+   if (special == "base_type") {
+   enc = array_get(what_idx, "encoding")
+   if (enc == 5) { # signed
printf("int%s_t ",
   8 * array_get(what_idx, "byte_size"))
-   break
-   case 7: # unsigned
+   } else if (enc == 7) { # unsigned
printf("uint%s_t ",
   8 * array_get(what_idx, "byte_size"))
-   break
-   default: # float, signed/unsigned char
+   } else { # float, signed/unsigned char
printf("%s ", array_get(what_idx, "name"))
-   break
}
returned_size = array_get(what_idx, "byte_size")
-   break
-   case "enumeration_type":
+   } else if (special == "enumeration_type") {
returned_size = array_get(what_idx, "byte_size")
printf("uint%s_t ", 8 * returned_size)
-   break
-   case "pointer_type":
+   } else if (special == "pointer_type") {
printf("mpers_ptr_t ")
returned_size = array_get(what_idx, "byte_size")
-   break
-   case "array_type":
+   } else if (special == "array_type") {
type_idx = array_get(what_idx, "type")
what_is(type_idx)
-   to_return = array[what_idx]["upper_bound"]
+   to_return = array[what_idx, "upper_bound"]
if ("" == to_return)
to_return = "[0]"
-   returned_size = array[what_idx]["count"] * returned_size
+   returned_size = array[what_idx, "count"] * returned_size
return leave(what_idx, to_return)
-   break
-   case "structure_type":
+   } else if (special == "structure_type") {
print "struct {"
prev_location = 0
location = 0
returned_size = 0
prev_returned_size = 0
-   for (item in array) {
-   if ("parent" in array[item] && \
-   array_get(item, "parent") == what_idx) {
-   location = array_get(item, "location")
+   for (item = 1; item <= parents_cnt; item+=1) {
+   if (array_parents[aparents_sorted[item]] == what_idx) {
+   location = array_get(aparents_sorted[item], 
"locatio

[strace PATCH 00/12] s390 architecture support improvements

2018-01-17 Thread Eugene Syromyatnikov
Hello.

This patch set introduces compat personality support on s390x along with
decoders of s390-specific system calls.

Unfortunately, I am no s390 expert by any means, so I likely have missed
something.  I also have little idea regarding applications where these
s390-specific system calls are used, so the feedback regarding quality
of the decoders is also welcome.

Eugene Syromyatnikov (12):
  Add compat support for s390x
  Add print_quoted_string flag to generate comment
  print_fields.h: add macro to print hexadecimal array field
  Introduce s390_sthyi system call decoder
  tests: check s390_sthyi system call decoder
  Introduce s390_guarded_storage system call decoder
  tests: check s390_guarded_storage system call decoder
  Introduce s390_runtime_instr system call decoder
  tests: check s390_runtime_instr system call decoder
  Introduce s390_pci_mmio_read, s390_pci_mmio_write system call decoders
  tests: check s390_pci_mmio_read and s390_pci_mmio_write decoders
  Update NEWS

 Makefile.am   |1 +
 NEWS  |5 +-
 configure.ac  |7 +-
 defs.h|3 +-
 linux/s390/arch_defs.h|1 +
 linux/s390/arch_sigreturn.c   |   16 +-
 linux/s390/get_error.c|   10 +-
 linux/s390/get_scno.c |8 +-
 linux/s390/get_syscall_args.c |   16 +-
 linux/s390/set_error.c|8 +-
 linux/s390/set_scno.c |6 +-
 linux/s390/syscallent.h   |9 +-
 linux/s390x/arch_defs.h   |1 +
 linux/s390x/arch_regs.c   |   37 +-
 linux/s390x/arch_regs.h   |3 +-
 linux/s390x/arch_rt_sigframe.c|5 +-
 linux/s390x/arch_sigreturn.c  |   26 +
 linux/s390x/errnoent1.h   |1 +
 linux/s390x/get_error.c   |   23 +-
 linux/s390x/get_scno.c|   21 +-
 linux/s390x/get_syscall_args.c|   22 +-
 linux/s390x/ioctls_arch1.h|1 +
 linux/s390x/ioctls_inc1.h |1 +
 linux/s390x/set_error.c   |   34 +-
 linux/s390x/set_scno.c|   21 +-
 linux/s390x/signalent1.h  |1 +
 linux/s390x/syscallent.h  |9 +-
 linux/s390x/syscallent1.h |1 +
 mem.c |4 +-
 pathtrace.c   |2 +-
 print_fields.h|9 +
 s390.c| 1277 +
 supported_personalities.h |1 +
 tests/.gitignore  |6 +
 tests/gen_tests.in|6 +
 tests/pure_executables.list   |6 +
 tests/s390_guarded_storage-v.c|2 +
 tests/s390_guarded_storage.c  |  229 ++
 tests/s390_pci_mmio_read_write.c  |  159 
 tests/s390_runtime_instr.c|   99 +++
 tests/s390_sthyi-v.c  |2 +
 tests/s390_sthyi.c|  786 
 tests/strace-V.test   |2 +-
 util.c|9 +-
 xlat/s390_guarded_storage_commands.in |5 +
 xlat/s390_runtime_instr_commands.in   |2 +
 xlat/s390_sthyi_function_codes.in |1 +
 47 files changed, 2863 insertions(+), 41 deletions(-)
 create mode 100644 linux/s390x/errnoent1.h
 create mode 100644 linux/s390x/ioctls_arch1.h
 create mode 100644 linux/s390x/ioctls_inc1.h
 create mode 100644 linux/s390x/signalent1.h
 create mode 100644 linux/s390x/syscallent1.h
 create mode 100644 s390.c
 create mode 100644 tests/s390_guarded_storage-v.c
 create mode 100644 tests/s390_guarded_storage.c
 create mode 100644 tests/s390_pci_mmio_read_write.c
 create mode 100644 tests/s390_runtime_instr.c
 create mode 100644 tests/s390_sthyi-v.c
 create mode 100644 tests/s390_sthyi.c
 create mode 100644 xlat/s390_guarded_storage_commands.in
 create mode 100644 xlat/s390_runtime_instr_commands.in
 create mode 100644 xlat/s390_sthyi_function_codes.in

-- 
2.1.4


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


[strace PATCH 01/12] Add compat support for s390x

2018-01-17 Thread Eugene Syromyatnikov
By very popular demand.

While we are here, let's refactor the condition for old_mmap_pgoff into
an arch-specific one, as it is used more than in one place.

* NEWS: Mention this.
* configure.ac (case "$host_cpu" in) : Set arch_m32 to s390, set
cc_flags_m32 to -m31.
(st_MPERS([m32])): Add s390x.
* defs.h [S390X]: Define NEED_UID16_PARSERS.
* linux/s390/arch_sigreturn.c [!S390_FRAME_PTR] (S390_FRAME_PTR): New
macro, define to s390_frame_ptr.
[!SIGNAL_FRAMESIZE] (SIGNAL_FRAMESIZE): New macro, define to
__SIGNAL_FRAMESIZE.
[!PTR_TYPE] (PTR_TYPE): New macro, define to unsigned long.
(arch_sigreturn): Use S390_FRAME_PTR, SIGNAL_FRAMESIZE, and PTR_TYPE
instead of s390_frame_ptr, __SIGNAL_FRAMESIZE, and pointer-sized type,
respectively.
* linux/s390/get_error.c [!ARCH_REGSET] (ARCH_REGSET): New macro, define
* to s390_regset.
(get_error): Use it instead of s390_regset.
* linux/s390/get_scno.c (arch_get_scno): Likewise.
* linux/s390/get_syscall_args.c (get_syscall_args): Likewise.
* linux/s390/set_error.c (arch_set_error, arch_set_success): Likewise.
* linux/s390/set_scno.c (arch_set_scno): Likewise.
* linux/s390x/arch_regs.c (psw_compat_t, s390_compat_regs,
s390x_regs_union, s390_frame_ptr, s390x_frame_ptr, s390x_io): New
variable.
(s390_regset, s390x_regset, ARCH_REGS_FOR_GETREGSET,
ARCH_IOVEC_FOR_GETREGSET, ARCH_PC_REG, ARCH_PERSONALITY_0_IOV_SIZE,
ARCH_PERSONALITY_1_IOV_SIZE): New macro.
* linux/s390x/arch_regs.h (s390_frame_ptr, s390x_frame_ptr): New
external definitions.
* linux/s390x/arch_rt_sigframe.c: Behave based on tcp->currpers.
* linux/s390x/arch_sigreturn.c: Likewise.
* linux/s390x/get_error.c: Likewise.
* linux/s390x/get_scno.c: Likewise.
* linux/s390x/get_syscall_args.c: Likewise.
* linux/s390x/set_error.c: Likewise.
* linux/s390x/set_scno.c: Likewise.
* linux/s390x/errnoent1.h: New file.
* linux/s390x/ioctls_arch1.h: Likewise.
* linux/s390x/ioctls_inc1.h: Likewise.
* linux/s390x/signalent1.h: Likewise.
* linux/s390x/syscallent1.h: Likewise.
* supported_personalities.h [S390X]: Define SUPPORTED_PERSONALITIES to
2.
* tests/strace-V.test: Add s390 to the list of architectures that have
m32 personality.
* linux/s390/arch_defs.h (HAVE_ARCH_OLD_MMAP_PGOFF): New definition.
* linux/s390x/arch_defs.h: Likewise.
* mem.c: Replace #ifdef S390 with #ifdef HAVE_ARCH_OLD_MMAP_PGOFF.
* pathtrace.c: Likewise.
---
 NEWS   |  1 +
 configure.ac   |  4 +++-
 defs.h |  2 +-
 linux/s390/arch_defs.h |  1 +
 linux/s390/arch_sigreturn.c| 16 +---
 linux/s390/get_error.c | 10 +++---
 linux/s390/get_scno.c  |  8 ++--
 linux/s390/get_syscall_args.c  | 16 ++--
 linux/s390/set_error.c |  8 ++--
 linux/s390/set_scno.c  |  6 +-
 linux/s390x/arch_defs.h|  1 +
 linux/s390x/arch_regs.c| 37 -
 linux/s390x/arch_regs.h|  3 ++-
 linux/s390x/arch_rt_sigframe.c |  5 -
 linux/s390x/arch_sigreturn.c   | 26 ++
 linux/s390x/errnoent1.h|  1 +
 linux/s390x/get_error.c| 23 ++-
 linux/s390x/get_scno.c | 21 -
 linux/s390x/get_syscall_args.c | 22 +-
 linux/s390x/ioctls_arch1.h |  1 +
 linux/s390x/ioctls_inc1.h  |  1 +
 linux/s390x/set_error.c| 34 +-
 linux/s390x/set_scno.c | 21 -
 linux/s390x/signalent1.h   |  1 +
 linux/s390x/syscallent1.h  |  1 +
 mem.c  |  4 ++--
 pathtrace.c|  2 +-
 supported_personalities.h  |  1 +
 tests/strace-V.test|  2 +-
 29 files changed, 248 insertions(+), 31 deletions(-)
 create mode 100644 linux/s390x/errnoent1.h
 create mode 100644 linux/s390x/ioctls_arch1.h
 create mode 100644 linux/s390x/ioctls_inc1.h
 create mode 100644 linux/s390x/signalent1.h
 create mode 100644 linux/s390x/syscallent1.h

diff --git a/NEWS b/NEWS
index 0dc23d6..550fc38 100644
--- a/NEWS
+++ b/NEWS
@@ -24,6 +24,7 @@ Noteworthy changes in release ?.?? (-??-??)
   * Updated lists of MSG_*, NT_*, and SHM_* constants.
   * Added manual page for the strace-log-merge command.
   * Updated lists of ioctl commands from Linux 4.15.
+  * Implemented biarch support for s390x.
   * Implemented an optional support for symbol demangling in strace -k output
 (activated by --with-libiberty configure option).
   * Information about availability of demangling and reliable personality
diff --git a/configure.ac b/configure.ac
index 5af..a1391c7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -145,6 +145,8 @@ s390)
;;
 s390x)
arch=s390x
+   arch_m32=s390
+   cc_flags_m32=-m31
AC_DEFINE([S390X], 1, [Define for the S390x architecture.])
;;
 hppa*|parisc*)
@@ -980,7 +982,7 @@ AC_ARG_ENABLE([mpers],
 esac],
[enable_mpers=yes])
 
-st_MPERS([m32], [aa

[strace PATCH 12/12] Update NEWS

2018-01-17 Thread Eugene Syromyatnikov
---
 NEWS | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index 550fc38..8b98a40 100644
--- a/NEWS
+++ b/NEWS
@@ -13,7 +13,9 @@ Noteworthy changes in release ?.?? (-??-??)
 BPF_MAP_GET_NEXT_ID, BPF_PROG_GET_FD_BY_ID, BPF_MAP_GET_FD_BY_ID,
 and BPF_OBJ_GET_INFO_BY_FD commands of bpf syscall.
   * Enhanced decoding of get_thread_area, memfd_create, modify_ldt,
-perf_event_open, reboot, set_thread_area, and shmget syscalls.
+perf_event_open, reboot, s390_guarded_storage, s390_pcio_mmio_read,
+s390_pci_mmio_write, s390_runtime_instr, s390_sthyi, set_thread_area,
+and shmget syscalls.
   * Implemented decoding of KVM_* ioctl commands.
   * Enhanced decoding of getsockopt and setsockopt syscalls for SOL_NETLINK
 level.
-- 
2.1.4


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


[strace PATCH 02/12] Add print_quoted_string flag to generate comment

2018-01-17 Thread Eugene Syromyatnikov
Because there are never enough print_quoted_string flags.

* defs.h (QUOTE_EMIT_COMMENT): New quoting flag macro constant.
* util.c (string_quote): Emit " /* " in the beginning and " */" in the
end if QUOTE_EMIT_COMMENT is passed.
(print_quoted_string): Increase alloc_size by 7 if QUOTE_EMIT_COMMENT is
passed.
---
 defs.h | 1 +
 util.c | 9 -
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/defs.h b/defs.h
index 2311d86..51b1355 100644
--- a/defs.h
+++ b/defs.h
@@ -530,6 +530,7 @@ str_strip_prefix_len(const char *str, const char *prefix, 
size_t prefix_len)
 #define QUOTE_OMIT_LEADING_TRAILING_QUOTES 0x02
 #define QUOTE_OMIT_TRAILING_0  0x08
 #define QUOTE_FORCE_HEX0x10
+#define QUOTE_EMIT_COMMENT 0x20
 
 extern int string_quote(const char *, char *, unsigned int, unsigned int);
 extern int print_quoted_string(const char *, unsigned int, unsigned int);
diff --git a/util.c b/util.c
index 49cb81b..9a99e1a 100644
--- a/util.c
+++ b/util.c
@@ -497,6 +497,8 @@ string_quote(const char *instr, char *outstr, const 
unsigned int size,
}
}
 
+   if (style & QUOTE_EMIT_COMMENT)
+   s = stpcpy(s, " /* ");
if (!(style & QUOTE_OMIT_LEADING_TRAILING_QUOTES))
*s++ = '\"';
 
@@ -576,6 +578,8 @@ string_quote(const char *instr, char *outstr, const 
unsigned int size,
 
if (!(style & QUOTE_OMIT_LEADING_TRAILING_QUOTES))
*s++ = '\"';
+   if (style & QUOTE_EMIT_COMMENT)
+   s = stpcpy(s, " */");
*s = '\0';
 
/* Return zero if we printed entire ASCIZ string (didn't truncate it) */
@@ -591,6 +595,8 @@ string_quote(const char *instr, char *outstr, const 
unsigned int size,
  asciz_ended:
if (!(style & QUOTE_OMIT_LEADING_TRAILING_QUOTES))
*s++ = '\"';
+   if (style & QUOTE_EMIT_COMMENT)
+   s = stpcpy(s, " */");
*s = '\0';
/* Return zero: we printed entire ASCIZ string (didn't truncate it) */
return 0;
@@ -632,7 +638,8 @@ print_quoted_string(const char *str, unsigned int size,
tprints("???");
return -1;
}
-   alloc_size += 1 + (style & QUOTE_OMIT_LEADING_TRAILING_QUOTES ? 0 : 2);
+   alloc_size += 1 + (style & QUOTE_OMIT_LEADING_TRAILING_QUOTES ? 0 : 2) +
+   (style & QUOTE_EMIT_COMMENT ? 7 : 0);
 
if (use_alloca(alloc_size)) {
outstr = alloca(alloc_size);
-- 
2.1.4


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


[strace PATCH 05/12] tests: check s390_sthyi system call decoder

2018-01-17 Thread Eugene Syromyatnikov
* configure.ac (AC_CHECK_FUNCS): Add iconv_open.
(AC_CHECK_HEADERS): Add iconv.h.
* tests/s390_sthyi-v.c: New file.
* tests/s390_sthyi.c: Likewise.
* tests/.gitignore: Add s390_sthyi, s390_sthyi-v.
* tests/pure_executables.list: Likewise.
* tests/gen_tests.in (s390_sthyi, s390_sthyi): New tests.
---
 configure.ac|   2 +
 tests/.gitignore|   2 +
 tests/gen_tests.in  |   2 +
 tests/pure_executables.list |   2 +
 tests/s390_sthyi-v.c|   2 +
 tests/s390_sthyi.c  | 786 
 6 files changed, 796 insertions(+)
 create mode 100644 tests/s390_sthyi-v.c
 create mode 100644 tests/s390_sthyi.c

diff --git a/configure.ac b/configure.ac
index a1391c7..63595ce 100644
--- a/configure.ac
+++ b/configure.ac
@@ -287,6 +287,7 @@ AC_CHECK_FUNCS(m4_normalize([
fstatat
ftruncate
futimens
+   iconv_open
if_indextoname
open64
prctl
@@ -394,6 +395,7 @@ AC_CHECK_HEADERS(m4_normalize([
asm/sysmips.h
bluetooth/bluetooth.h
elf.h
+   iconv.h
inttypes.h
linux/bsg.h
linux/cryptouser.h
diff --git a/tests/.gitignore b/tests/.gitignore
index 4c54589..19aa493 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -357,6 +357,8 @@ rt_sigsuspend
 rt_sigtimedwait
 rt_tgsigqueueinfo
 run_expect_termsig
+s390_sthyi
+s390_sthyi-v
 sched_get_priority_mxx
 sched_rr_get_interval
 sched_xetaffinity
diff --git a/tests/gen_tests.in b/tests/gen_tests.in
index 93b1687..968f6e4 100644
--- a/tests/gen_tests.in
+++ b/tests/gen_tests.in
@@ -303,6 +303,8 @@ rt_sigreturn-esignal='!USR1'
 rt_sigsuspend  -a20 -esignal=none
 rt_sigtimedwait-a38
 rt_tgsigqueueinfo  -esignal=none
+s390_sthyi -a47
+s390_sthyi-v   -e trace=s390_sthyi -a47
 sched  test_trace_expr times -e/sched
 sched_get_priority_mxx -a33 -e 
trace=sched_get_priority_min,sched_get_priority_max
 sched_rr_get_interval  -a31
diff --git a/tests/pure_executables.list b/tests/pure_executables.list
index 8f5ff31..d8b997d 100755
--- a/tests/pure_executables.list
+++ b/tests/pure_executables.list
@@ -296,6 +296,8 @@ rt_sigreturn
 rt_sigsuspend
 rt_sigtimedwait
 rt_tgsigqueueinfo
+s390_sthyi
+s390_sthyi-v
 sched_get_priority_mxx
 sched_rr_get_interval
 sched_xetaffinity
diff --git a/tests/s390_sthyi-v.c b/tests/s390_sthyi-v.c
new file mode 100644
index 000..8605520
--- /dev/null
+++ b/tests/s390_sthyi-v.c
@@ -0,0 +1,2 @@
+#define VERBOSE 1
+#include "s390_sthyi.c"
diff --git a/tests/s390_sthyi.c b/tests/s390_sthyi.c
new file mode 100644
index 000..1554daf
--- /dev/null
+++ b/tests/s390_sthyi.c
@@ -0,0 +1,786 @@
+/*
+ * Check decoding of s390_sthyi syscall.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "tests.h"
+#include 
+
+#if defined HAVE_ICONV_H && defined HAVE_ICONV_OPEN && defined __NR_s390_sthyi
+
+# include 
+# include 
+# include 
+# include 
+# include 
+# include 
+# include 
+
+# include 
+
+# define EBCDIC_MAX_LEN 16
+
+# ifndef VERBOSE
+#  define VERBOSE 0
+# endif
+
+static bool
+print_0x8(const char *prefix, unsigned char *buf, unsigned int offs, bool zero)
+{
+   if (!zero && !buf[offs])
+   return false;
+
+   printf("%s=%#02hhx", prefix, buf[offs]);
+
+   return true;
+}
+
+static bool
+print_u8(const char *prefix, unsigned char *buf, unsigned int offs, bool zero)
+{
+   if (!zero && !buf[offs])
+   return false;
+
+   printf("%s=%hhu", prefix, buf[offs]);
+
+   return true;
+}
+

[strace PATCH 06/12] Introduce s390_guarded_storage system call decoder

2018-01-17 Thread Eugene Syromyatnikov
* linux/s390/syscallent.h ([378]): Change decoder to s390_guarded_storage.
* linux/s390x/syscallent.h: Likewise.
* s390.c (struct guard_storage_control_block,
struct guard_storage_event_parameter_list): New structure type
definition.
(guard_storage_print_gsepl, guard_storage_print_gscb,
SYS_FUNC(s390_guarded_storage)): New function.
(DIV_ROUND_UP): New macro.
* xlat/s390_guarded_storage_commands.in: New file.
---
 linux/s390/syscallent.h   |   2 +-
 linux/s390x/syscallent.h  |   2 +-
 s390.c| 180 ++
 xlat/s390_guarded_storage_commands.in |   5 +
 4 files changed, 187 insertions(+), 2 deletions(-)
 create mode 100644 xlat/s390_guarded_storage_commands.in

diff --git a/linux/s390/syscallent.h b/linux/s390/syscallent.h
index dd1fbb1..522c641 100644
--- a/linux/s390/syscallent.h
+++ b/linux/s390/syscallent.h
@@ -407,7 +407,7 @@
 [375] = { 6,   TD, SEN(copy_file_range),   
"copy_file_range"   },
 [376] = { 6,   TD, SEN(preadv2),   "preadv2"   
},
 [377] = { 6,   TD, SEN(pwritev2),  "pwritev2"  
},
-[378] = { 2,   0,  SEN(printargs), 
"s390_guarded_storage"  },
+[378] = { 2,   0,  SEN(s390_guarded_storage),  
"s390_guarded_storage"  },
 [379] = { 5,   TD|TF|TSTA, SEN(statx), "statx" 
},
 [380] = { 4,   0,  SEN(s390_sthyi),"s390_sthyi"
},
 
diff --git a/linux/s390x/syscallent.h b/linux/s390x/syscallent.h
index fe5b252..8e068c9 100644
--- a/linux/s390x/syscallent.h
+++ b/linux/s390x/syscallent.h
@@ -391,7 +391,7 @@
 [375] = { 6,   TD, SEN(copy_file_range),   
"copy_file_range"   },
 [376] = { 6,   TD, SEN(preadv2),   "preadv2"   
},
 [377] = { 6,   TD, SEN(pwritev2),  "pwritev2"  
},
-[378] = { 2,   0,  SEN(printargs), 
"s390_guarded_storage"  },
+[378] = { 2,   0,  SEN(s390_guarded_storage),  
"s390_guarded_storage"  },
 [379] = { 5,   TD|TF|TSTA, SEN(statx), "statx" 
},
 [380] = { 4,   0,  SEN(s390_sthyi),"s390_sthyi"
},
 
diff --git a/s390.c b/s390.c
index daaf6a0..a7efd29 100644
--- a/s390.c
+++ b/s390.c
@@ -35,6 +35,7 @@
 
 #include "print_fields.h"
 
+#include "xlat/s390_guarded_storage_commands.h"
 #include "xlat/s390_sthyi_function_codes.h"
 
 /*
@@ -1030,4 +1031,183 @@ SYS_FUNC(s390_sthyi)
return 0;
 }
 
+
+/*
+ * Structures are written based on
+ * 
https://www-304.ibm.com/support/docview.wss?uid=isg29c69415c1e82603c852576700058075a&aid=1#page=85
+ */
+
+struct guard_storage_control_block {
+   uint64_t reserved;
+   /**
+* Guard Storage Designation
+*  - Bits 0..J, J == 64-GSC - Guard Storage Origin (GSO)
+*  - Bits 53..55 - Guard Load Shift (GLS)
+*  - Bits 58..63 - Guard Storage Characteristic (GSC), this is J from
+*  the first item, valud values are 25..56.
+*/
+   uint64_t gsd;
+   uint64_t gssm;   /**< Guard Storage Section Mask */
+   uint64_t gs_epl_a; /**< Guard Storage Event Parameter List Address */
+};
+
+struct guard_storage_event_parameter_list {
+   uint8_t  pad1;
+   /**
+* Guard Storage Event Addressing Mode
+*  - 0x40 - Extended addressing mode (E)
+*  - 0x80 - Basic addressing mode (B)
+*/
+   uint8_t  gs_eam;
+   /**
+* Guard Storage Event Cause indication
+*  - 0x01 - CPU was in transaction execution mode (TX)
+*  - 0x02 - CPU was in constrained transaction execution mode (CX)
+*  - 0x80 - Instruction causing the event: 0 - LGG, 1 - LLGFGS
+*/
+   uint8_t  gs_eci;
+   /**
+* Guard Storage Event Access Information
+*  - 0x01 - DAT mode
+*  - Bits 1..2 - Address space indication
+*  - Bits 4..7 - AR number
+*/
+   uint8_t  gs_eai;
+   uint32_t pad2;
+   uint64_t gs_eha; /**< Guard Storage Event Handler Address */
+   uint64_t gs_eia; /**< Guard Storage Event Instruction Address */
+   uint64_t gs_eoa; /**< Guard Storage Event Operation Address */
+   uint64_t gs_eir; /**< Guard Storage Event Intermediate Result */
+   uint64_t gs_era; /**< Guard Storage Event Return Address */
+};
+
+static void
+guard_storage_print_gsepl(struct tcb *tcp, uint64_t addr)
+{
+   struct guard_storage_event_parameter_list gsepl;
+
+   /* Since it is 64-bit even on 31-bit s390... */
+   if (sizeof(addr) > current_klongsize &&
+   addr >= (1ULL << (current_klongsize * 8))) {
+   tprintf("%#" PRIx64, addr);
+
+   return;
+   }
+
+   if (umove_or_printaddr(tcp, addr, &gsepl

[strace PATCH 08/12] Introduce s390_runtime_instr system call decoder

2018-01-17 Thread Eugene Syromyatnikov
* linux/s390/syscallent.h ([342]): Change decoder to s390_runtime_instr.
* linux/s390x/syscallent.h: Likewise.
* s390.c (SYS_FUNC(s390_runtime_instr)): New function.
* xlat/s390_runtime_instr_commands.in: New file.
---
 linux/s390/syscallent.h |  2 +-
 linux/s390x/syscallent.h|  2 +-
 s390.c  | 31 +++
 xlat/s390_runtime_instr_commands.in |  2 ++
 4 files changed, 35 insertions(+), 2 deletions(-)
 create mode 100644 xlat/s390_runtime_instr_commands.in

diff --git a/linux/s390/syscallent.h b/linux/s390/syscallent.h
index 522c641..a807c95 100644
--- a/linux/s390/syscallent.h
+++ b/linux/s390/syscallent.h
@@ -371,7 +371,7 @@
 [339] = { 2,   TD, SEN(setns), "setns" 
},
 [340] = { 6,   0,  SEN(process_vm_readv),  
"process_vm_readv"  },
 [341] = { 6,   0,  SEN(process_vm_writev), 
"process_vm_writev" },
-[342] = { 2,   0,  SEN(printargs), 
"s390_runtime_instr"},
+[342] = { 2,   0,  SEN(s390_runtime_instr),
"s390_runtime_instr"},
 [343] = { 5,   0,  SEN(kcmp),  "kcmp"  
},
 [344] = { 3,   TD, SEN(finit_module),  "finit_module"  
},
 [345] = { 3,   0,  SEN(sched_setattr), "sched_setattr" 
},
diff --git a/linux/s390x/syscallent.h b/linux/s390x/syscallent.h
index 8e068c9..c4a770d 100644
--- a/linux/s390x/syscallent.h
+++ b/linux/s390x/syscallent.h
@@ -355,7 +355,7 @@
 [339] = { 2,   TD, SEN(setns), "setns" 
},
 [340] = { 6,   0,  SEN(process_vm_readv),  
"process_vm_readv"  },
 [341] = { 6,   0,  SEN(process_vm_writev), 
"process_vm_writev" },
-[342] = { 2,   0,  SEN(printargs), 
"s390_runtime_instr"},
+[342] = { 2,   0,  SEN(s390_runtime_instr),
"s390_runtime_instr"},
 [343] = { 5,   0,  SEN(kcmp),  "kcmp"  
},
 [344] = { 3,   TD, SEN(finit_module),  "finit_module"  
},
 [345] = { 3,   0,  SEN(sched_setattr), "sched_setattr" 
},
diff --git a/s390.c b/s390.c
index a7efd29..dc7bf36 100644
--- a/s390.c
+++ b/s390.c
@@ -36,6 +36,7 @@
 #include "print_fields.h"
 
 #include "xlat/s390_guarded_storage_commands.h"
+#include "xlat/s390_runtime_instr_commands.h"
 #include "xlat/s390_sthyi_function_codes.h"
 
 /*
@@ -1210,4 +1211,34 @@ SYS_FUNC(s390_guarded_storage)
return RVAL_DECODED;
 }
 
+SYS_FUNC(s390_runtime_instr)
+{
+   int command = (int) tcp->u_arg[0];
+   int signum = (int) tcp->u_arg[1];
+
+   const char *command_descr =
+   xlookup(s390_runtime_instr_commands, command);
+
+   tprintf("%d", command);
+   tprints_comment(command_descr ? command_descr :
+   "S390_RUNTIME_INSTR_???");
+
+   /*
+* signum is ignored since Linux 4.4, but let's print it for start
+* command anyway.
+*/
+   switch (command) {
+   case S390_RUNTIME_INSTR_START:
+   tprints(", ");
+   tprints(signame(signum));
+   break;
+
+   case S390_RUNTIME_INSTR_STOP:
+   default:
+   break;
+   }
+
+   return RVAL_DECODED;
+}
+
 #endif /* defined S390 || defined S390X */
diff --git a/xlat/s390_runtime_instr_commands.in 
b/xlat/s390_runtime_instr_commands.in
new file mode 100644
index 000..395afc4
--- /dev/null
+++ b/xlat/s390_runtime_instr_commands.in
@@ -0,0 +1,2 @@
+S390_RUNTIME_INSTR_START   0x1
+S390_RUNTIME_INSTR_STOP0x2
-- 
2.1.4


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


[strace PATCH 03/12] print_fields.h: add macro to print hexadecimal array field

2018-01-17 Thread Eugene Syromyatnikov
* print_fields.h (PRINT_FIELD_HEX_ARRAY): New macro, prints target
array with QUOTE_FORCE_HEX.
---
 print_fields.h | 9 +
 1 file changed, 9 insertions(+)

diff --git a/print_fields.h b/print_fields.h
index 0af087a..b2c6a30 100644
--- a/print_fields.h
+++ b/print_fields.h
@@ -107,6 +107,15 @@
 sizeof((where_).field_));  \
} while (0)
 
+#define PRINT_FIELD_HEX_ARRAY(prefix_, where_, field_) \
+   do {\
+   STRACE_PRINTF("%s%s=", (prefix_), #field_); \
+   print_quoted_string((const char *)(where_).field_,  \
+sizeof((where_).field_) +  \
+   MUST_BE_ARRAY((where_).field_), \
+   QUOTE_FORCE_HEX); \
+   } while (0)
+
 #define PRINT_FIELD_INET_ADDR(prefix_, where_, field_, af_)\
do {\
STRACE_PRINTF(prefix_); \
-- 
2.1.4


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


[strace PATCH 04/12] Introduce s390_sthyi system call decoder

2018-01-17 Thread Eugene Syromyatnikov
* s390.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* linux/s390/syscallent.h ([380]): Change decoder to s390_sthyi.
* linux/s390x/syscallent.h: Likewise.
* xlat/s390_sthyi_function_codes.in: New file.
---
 Makefile.am   |1 +
 linux/s390/syscallent.h   |1 +
 linux/s390x/syscallent.h  |1 +
 s390.c| 1033 +
 xlat/s390_sthyi_function_codes.in |1 +
 5 files changed, 1037 insertions(+)
 create mode 100644 s390.c
 create mode 100644 xlat/s390_sthyi_function_codes.in

diff --git a/Makefile.am b/Makefile.am
index 2515876..02e2f3e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -267,6 +267,7 @@ strace_SOURCES =\
rtnl_rule.c \
rtnl_tc.c   \
rtnl_tc_action.c \
+   s390.c  \
sched.c \
sched_attr.h\
scsi.c  \
diff --git a/linux/s390/syscallent.h b/linux/s390/syscallent.h
index 5482c53..dd1fbb1 100644
--- a/linux/s390/syscallent.h
+++ b/linux/s390/syscallent.h
@@ -409,6 +409,7 @@
 [377] = { 6,   TD, SEN(pwritev2),  "pwritev2"  
},
 [378] = { 2,   0,  SEN(printargs), 
"s390_guarded_storage"  },
 [379] = { 5,   TD|TF|TSTA, SEN(statx), "statx" 
},
+[380] = { 4,   0,  SEN(s390_sthyi),"s390_sthyi"
},
 
 #define SYS_socket_subcall 400
 #include "subcall.h"
diff --git a/linux/s390x/syscallent.h b/linux/s390x/syscallent.h
index 36b1aef..fe5b252 100644
--- a/linux/s390x/syscallent.h
+++ b/linux/s390x/syscallent.h
@@ -393,6 +393,7 @@
 [377] = { 6,   TD, SEN(pwritev2),  "pwritev2"  
},
 [378] = { 2,   0,  SEN(printargs), 
"s390_guarded_storage"  },
 [379] = { 5,   TD|TF|TSTA, SEN(statx), "statx" 
},
+[380] = { 4,   0,  SEN(s390_sthyi),"s390_sthyi"
},
 
 #define SYS_socket_subcall 400
 #include "subcall.h"
diff --git a/s390.c b/s390.c
new file mode 100644
index 000..daaf6a0
--- /dev/null
+++ b/s390.c
@@ -0,0 +1,1033 @@
+/*
+ * s390-specific syscalls decoders.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "defs.h"
+
+#if defined S390 || defined S390X
+
+#include 
+
+#include "print_fields.h"
+
+#include "xlat/s390_sthyi_function_codes.h"
+
+/*
+ * Since, for some reason, kernel doesn't expose all these nice constants and
+ * structures in UAPI, we have to re-declare them ourselves.
+ */
+
+/**
+ * "The header section is placed at the beginning of the response buffer and
+ * identifies the location and length of all other sections. Valid sections 
have
+ * nonzero offset values in the header. Each section provides information about
+ * validity of fields within that section."
+ */
+struct sthyi_hdr {
+   /**
+* Header Flag Byte 1 - These flag settings indicate the environment
+* that the instruction was executed in and may influence the value of
+* the validity bits. The validity bits, and not these flags, should be
+* used to determine if a field is valid.
+*  - 0x80 - Global Performance Data unavailable
+*  - 0x40 - One or more hypervisor levels below this level does not
+*   support the STHYI instruction. When this flag is set the
+*   value of INFGPDU is not meaningful because the state of the
+

[strace PATCH 10/12] Introduce s390_pci_mmio_read, s390_pci_mmio_write system call decoders

2018-01-17 Thread Eugene Syromyatnikov
* linux/s390/syscallent.h ([352]): Change decoder to s390_pci_mmio_write.
([353]): Change decoder to s390_pci_mmio_read.
* linux/s390x/syscallent.h: Likewise.
* s390.c (SYS_FUNC(s390_pci_mmio_write), SYS_FUNC(s390_pci_mmio_read)):
New function.
---
 linux/s390/syscallent.h  |  4 ++--
 linux/s390x/syscallent.h |  4 ++--
 s390.c   | 33 +
 3 files changed, 37 insertions(+), 4 deletions(-)

diff --git a/linux/s390/syscallent.h b/linux/s390/syscallent.h
index a807c95..d34cd42 100644
--- a/linux/s390/syscallent.h
+++ b/linux/s390/syscallent.h
@@ -381,8 +381,8 @@
 [349] = { 3,   0,  SEN(getrandom), "getrandom" 
},
 [350] = { 2,   TD, SEN(memfd_create),  "memfd_create"  
},
 [351] = { 3,   TD, SEN(bpf),   "bpf"   
},
-[352] = { 3,   0,  SEN(printargs), 
"s390_pci_mmio_write"   },
-[353] = { 3,   0,  SEN(printargs), 
"s390_pci_mmio_read"},
+[352] = { 3,   0,  SEN(s390_pci_mmio_write),   
"s390_pci_mmio_write"   },
+[353] = { 3,   0,  SEN(s390_pci_mmio_read),
"s390_pci_mmio_read"},
 [354] = { 5,   TD|TF|TP|SE|SI, SEN(execveat),  "execveat"  
},
 [355] = { 1,   TD, SEN(userfaultfd),   "userfaultfd"   
},
 [356] = { 2,   0,  SEN(membarrier),"membarrier"
},
diff --git a/linux/s390x/syscallent.h b/linux/s390x/syscallent.h
index c4a770d..0c84274 100644
--- a/linux/s390x/syscallent.h
+++ b/linux/s390x/syscallent.h
@@ -365,8 +365,8 @@
 [349] = { 3,   0,  SEN(getrandom), "getrandom" 
},
 [350] = { 2,   TD, SEN(memfd_create),  "memfd_create"  
},
 [351] = { 3,   TD, SEN(bpf),   "bpf"   
},
-[352] = { 3,   0,  SEN(printargs), 
"s390_pci_mmio_write"   },
-[353] = { 3,   0,  SEN(printargs), 
"s390_pci_mmio_read"},
+[352] = { 3,   0,  SEN(s390_pci_mmio_write),   
"s390_pci_mmio_write"   },
+[353] = { 3,   0,  SEN(s390_pci_mmio_read),
"s390_pci_mmio_read"},
 [354] = { 5,   TD|TF|TP|SE|SI, SEN(execveat),  "execveat"  
},
 [355] = { 1,   TD, SEN(userfaultfd),   "userfaultfd"   
},
 [356] = { 2,   0,  SEN(membarrier),"membarrier"
},
diff --git a/s390.c b/s390.c
index dc7bf36..4b23e7a 100644
--- a/s390.c
+++ b/s390.c
@@ -1241,4 +1241,37 @@ SYS_FUNC(s390_runtime_instr)
return RVAL_DECODED;
 }
 
+SYS_FUNC(s390_pci_mmio_write)
+{
+   kernel_ulong_t mmio_addr = tcp->u_arg[0];
+   kernel_ulong_t user_buf  = tcp->u_arg[1];
+   kernel_ulong_t length= tcp->u_arg[2];
+
+   tprintf("%#" PRI_klx ", ", mmio_addr);
+   printstr_ex(tcp, user_buf, length, QUOTE_FORCE_HEX);
+   tprintf(", %" PRI_klu, length);
+
+   return RVAL_DECODED;
+}
+
+SYS_FUNC(s390_pci_mmio_read)
+{
+   kernel_ulong_t mmio_addr = tcp->u_arg[0];
+   kernel_ulong_t user_buf  = tcp->u_arg[1];
+   kernel_ulong_t length= tcp->u_arg[2];
+
+   if (entering(tcp)) {
+   tprintf("%#" PRI_klx ", ", mmio_addr);
+   } else {
+   if (!syserror(tcp))
+   printstr_ex(tcp, user_buf, length, QUOTE_FORCE_HEX);
+   else
+   printaddr(user_buf);
+
+   tprintf(", %" PRI_klu, length);
+   }
+
+   return 0;
+}
+
 #endif /* defined S390 || defined S390X */
-- 
2.1.4


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


[strace PATCH 09/12] tests: check s390_runtime_instr system call decoder

2018-01-17 Thread Eugene Syromyatnikov
* tests/s390_runtime_instr.c: New file.
* tests/.gitignore: Add s390_runtime_instr.
* tests/pure_executables.list: Likewise.
* tests/gen_tests.in (s390_runtime_instr): New test.
---
 tests/.gitignore|  1 +
 tests/gen_tests.in  |  1 +
 tests/pure_executables.list |  1 +
 tests/s390_runtime_instr.c  | 99 +
 4 files changed, 102 insertions(+)
 create mode 100644 tests/s390_runtime_instr.c

diff --git a/tests/.gitignore b/tests/.gitignore
index 379d8c1..eaa1141 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -359,6 +359,7 @@ rt_tgsigqueueinfo
 run_expect_termsig
 s390_guarded_storage
 s390_guarded_storage-v
+s390_runtime_instr
 s390_sthyi
 s390_sthyi-v
 sched_get_priority_mxx
diff --git a/tests/gen_tests.in b/tests/gen_tests.in
index 5a9e4ed..a6dea9f 100644
--- a/tests/gen_tests.in
+++ b/tests/gen_tests.in
@@ -305,6 +305,7 @@ rt_sigtimedwait -a38
 rt_tgsigqueueinfo  -esignal=none
 s390_guarded_storage   -a32
 s390_guarded_storage-v -e trace=s390_guarded_storage -a32 -v
+s390_runtime_instr -a50
 s390_sthyi -a47
 s390_sthyi-v   -e trace=s390_sthyi -a47 -v
 sched  test_trace_expr times -e/sched
diff --git a/tests/pure_executables.list b/tests/pure_executables.list
index dc43a93..9c61da2 100755
--- a/tests/pure_executables.list
+++ b/tests/pure_executables.list
@@ -298,6 +298,7 @@ rt_sigtimedwait
 rt_tgsigqueueinfo
 s390_guarded_storage
 s390_guarded_storage-v
+s390_runtime_instr
 s390_sthyi
 s390_sthyi-v
 sched_get_priority_mxx
diff --git a/tests/s390_runtime_instr.c b/tests/s390_runtime_instr.c
new file mode 100644
index 000..861bbd4
--- /dev/null
+++ b/tests/s390_runtime_instr.c
@@ -0,0 +1,99 @@
+/*
+ * Check decoding of s390_runtime_instr syscall.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "tests.h"
+#include 
+
+#if defined __NR_s390_runtime_instr
+
+# include 
+# include 
+# include 
+# include 
+
+int
+main(void)
+{
+   static struct {
+   kernel_ulong_t cmd;
+   const char * cmd_str;
+   } cmd_args[] = {
+   { 0, "???" },
+   { 4, "???" },
+   { (kernel_ulong_t) 0xdeafbeefdeadc0deULL, "???" },
+   { 2, "STOP",  },
+   };
+
+   static struct {
+   kernel_ulong_t sig;
+   const char * sig_str;
+   } start_sig_args[] = {
+   { 0, "SIG_0" },
+   { (kernel_ulong_t) 0xfacefeedac0ffeedULL, NULL },
+   { ARG_STR(SIGALRM) },
+   { 33, "SIGRT_1" },
+   { 63, "SIGRT_31" },
+   };
+
+   unsigned int i;
+   long rc;
+
+   for (i = 0; i < ARRAY_SIZE(cmd_args); i++) {
+   rc = syscall(__NR_s390_runtime_instr, cmd_args[i].cmd, 0xdead);
+   printf("s390_runtime_instr(%d /* S390_RUNTIME_INSTR_%s */) = "
+  "%s\n",
+  (int) cmd_args[i].cmd, cmd_args[i].cmd_str,
+  sprintrc(rc));
+   }
+
+   for (i = 0; i < ARRAY_SIZE(start_sig_args); i++) {
+   long saved_errno;
+
+   rc = syscall(__NR_s390_runtime_instr, 1, start_sig_args[i].sig);
+   saved_errno = errno;
+   printf("s390_runtime_instr(1 /* S390_RUNTIME_INSTR_START */, ");
+
+   if (start_sig_args[i].sig_str)
+   printf("%s", start_sig_args[i].sig_str);
+   else
+   printf("%d", (int) start_sig_args[i].sig);
+
+   errno = saved_errno;
+   

[strace PATCH 07/12] tests: check s390_guarded_storage system call decoder

2018-01-17 Thread Eugene Syromyatnikov
* configure.ac (AC_CHECK_HEADERS): Add asm/guarded_storage.h.
* tests/s390_guarded_storage-v.c: New file.
* tests/s390_guarded_storage.c: Likewise.
* tests/.gitignore: Add s390_guarded_storage, s390_guarded_storage-v.
* tests/pure_executables.list: Likewise.
* tests/gen_tests.in (s390_guarded_storage, s390_guarded_storage-v):
New tests.
---
 configure.ac   |   1 +
 tests/.gitignore   |   2 +
 tests/gen_tests.in |   4 +-
 tests/pure_executables.list|   2 +
 tests/s390_guarded_storage-v.c |   2 +
 tests/s390_guarded_storage.c   | 229 +
 6 files changed, 239 insertions(+), 1 deletion(-)
 create mode 100644 tests/s390_guarded_storage-v.c
 create mode 100644 tests/s390_guarded_storage.c

diff --git a/configure.ac b/configure.ac
index 63595ce..fc164c8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -392,6 +392,7 @@ AC_CHECK_MEMBERS(m4_normalize([
 
 AC_CHECK_HEADERS(m4_normalize([
asm/cachectl.h
+   asm/guarded_storage.h
asm/sysmips.h
bluetooth/bluetooth.h
elf.h
diff --git a/tests/.gitignore b/tests/.gitignore
index 19aa493..379d8c1 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -357,6 +357,8 @@ rt_sigsuspend
 rt_sigtimedwait
 rt_tgsigqueueinfo
 run_expect_termsig
+s390_guarded_storage
+s390_guarded_storage-v
 s390_sthyi
 s390_sthyi-v
 sched_get_priority_mxx
diff --git a/tests/gen_tests.in b/tests/gen_tests.in
index 968f6e4..5a9e4ed 100644
--- a/tests/gen_tests.in
+++ b/tests/gen_tests.in
@@ -303,8 +303,10 @@ rt_sigreturn   -esignal='!USR1'
 rt_sigsuspend  -a20 -esignal=none
 rt_sigtimedwait-a38
 rt_tgsigqueueinfo  -esignal=none
+s390_guarded_storage   -a32
+s390_guarded_storage-v -e trace=s390_guarded_storage -a32 -v
 s390_sthyi -a47
-s390_sthyi-v   -e trace=s390_sthyi -a47
+s390_sthyi-v   -e trace=s390_sthyi -a47 -v
 sched  test_trace_expr times -e/sched
 sched_get_priority_mxx -a33 -e 
trace=sched_get_priority_min,sched_get_priority_max
 sched_rr_get_interval  -a31
diff --git a/tests/pure_executables.list b/tests/pure_executables.list
index d8b997d..dc43a93 100755
--- a/tests/pure_executables.list
+++ b/tests/pure_executables.list
@@ -296,6 +296,8 @@ rt_sigreturn
 rt_sigsuspend
 rt_sigtimedwait
 rt_tgsigqueueinfo
+s390_guarded_storage
+s390_guarded_storage-v
 s390_sthyi
 s390_sthyi-v
 sched_get_priority_mxx
diff --git a/tests/s390_guarded_storage-v.c b/tests/s390_guarded_storage-v.c
new file mode 100644
index 000..05afd9f
--- /dev/null
+++ b/tests/s390_guarded_storage-v.c
@@ -0,0 +1,2 @@
+#define VERBOSE 1
+#include "s390_guarded_storage.c"
diff --git a/tests/s390_guarded_storage.c b/tests/s390_guarded_storage.c
new file mode 100644
index 000..ab67c15
--- /dev/null
+++ b/tests/s390_guarded_storage.c
@@ -0,0 +1,229 @@
+/*
+ * Check decoding of s390_guarded_storage syscall.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "tests.h"
+#include 
+
+#if defined __NR_s390_guarded_storage && defined HAVE_ASM_GUARDED_STORAGE_H
+
+# include 
+# include 
+# include 
+# include 
+# include 
+
+# include 
+
+# ifndef VERBOSE
+#  define VERBOSE 0
+# endif
+
+static void
+gs_no_arg(kernel_ulong_t val, const char *val_str)
+{
+   static const kernel_ulong_t bogus_addr =
+   (kernel_ulong_t) 0xcaffeedadeadbed5ULL;
+   static const kernel_ulong_t bogus_cmd_mask =
+   (kernel_ulong_t) 0xbadc0dedULL;
+   long rc;
+
+   rc = syscall(__NR_s390_guarded_storage, val | bogus_cmd_mask,
+

[strace PATCH 11/12] tests: check s390_pci_mmio_read and s390_pci_mmio_write decoders

2018-01-17 Thread Eugene Syromyatnikov
* tests/s390_pci_mmio_read_write.c: New file.
* tests/.gitignore: Add s390_pci_mmio_read_write.
* tests/pure_executables.list: Likewise.
* tests/gen_tests.in (s390_pci_mmio_read_write): New test.
---
 tests/.gitignore |   1 +
 tests/gen_tests.in   |   1 +
 tests/pure_executables.list  |   1 +
 tests/s390_pci_mmio_read_write.c | 159 +++
 4 files changed, 162 insertions(+)
 create mode 100644 tests/s390_pci_mmio_read_write.c

diff --git a/tests/.gitignore b/tests/.gitignore
index eaa1141..7dbd84d 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -359,6 +359,7 @@ rt_tgsigqueueinfo
 run_expect_termsig
 s390_guarded_storage
 s390_guarded_storage-v
+s390_pci_mmio_read_write
 s390_runtime_instr
 s390_sthyi
 s390_sthyi-v
diff --git a/tests/gen_tests.in b/tests/gen_tests.in
index a6dea9f..ae9ba63 100644
--- a/tests/gen_tests.in
+++ b/tests/gen_tests.in
@@ -305,6 +305,7 @@ rt_sigtimedwait -a38
 rt_tgsigqueueinfo  -esignal=none
 s390_guarded_storage   -a32
 s390_guarded_storage-v -e trace=s390_guarded_storage -a32 -v
+s390_pci_mmio_read_write   -e trace=s390_pci_mmio_read,s390_pci_mmio_write 
-a30
 s390_runtime_instr -a50
 s390_sthyi -a47
 s390_sthyi-v   -e trace=s390_sthyi -a47 -v
diff --git a/tests/pure_executables.list b/tests/pure_executables.list
index 9c61da2..77a29b0 100755
--- a/tests/pure_executables.list
+++ b/tests/pure_executables.list
@@ -298,6 +298,7 @@ rt_sigtimedwait
 rt_tgsigqueueinfo
 s390_guarded_storage
 s390_guarded_storage-v
+s390_pci_mmio_read_write
 s390_runtime_instr
 s390_sthyi
 s390_sthyi-v
diff --git a/tests/s390_pci_mmio_read_write.c b/tests/s390_pci_mmio_read_write.c
new file mode 100644
index 000..8968d4e
--- /dev/null
+++ b/tests/s390_pci_mmio_read_write.c
@@ -0,0 +1,159 @@
+/*
+ * Check decoding of s390_pci_mmio_read and s390_pci_mmio_write syscalls.
+ *
+ * Copyright (c) 2018 The strace developers.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "tests.h"
+#include 
+
+#if defined __NR_s390_pci_mmio_read && defined __NR_s390_pci_mmio_write
+
+# include 
+# include 
+# include 
+# include 
+# include 
+
+# ifndef MIN
+#  define MIN(a, b) ((a) < (b) ? (a) : (b))
+# endif
+
+static void
+do_call(bool wr, kernel_ulong_t mmio_addr, kernel_ulong_t buf,
+   kernel_ulong_t len, bool buf_valid, const char *buf_str)
+{
+   long saved_errno = 0;
+   long rc = 0;
+
+   printf("s390_pci_mmio_%s(%#llx, ", wr ? "write" : "read",
+  (unsigned long long) mmio_addr);
+
+   if (!wr) {
+   rc = syscall(__NR_s390_pci_mmio_read, mmio_addr, buf, len);
+   saved_errno = errno;
+   }
+
+   if (buf_valid && !rc) {
+   char *buf_ptr = (char *) (uintptr_t) buf;
+
+   print_quoted_hex(buf_ptr,
+len > DEFAULT_STRLEN ? DEFAULT_STRLEN : len);
+
+   if (len > DEFAULT_STRLEN)
+   printf("...");
+   } else {
+   if (buf_str)
+   printf("%s", buf_str);
+   else
+   printf("%#llx", (unsigned long long) buf);
+   }
+
+   printf(", %llu) = ", (unsigned long long) len);
+
+   if (wr)
+   rc = syscall(__NR_s390_pci_mmio_write, mmio_addr, buf, len);
+   else
+   errno = saved_errno;
+
+   puts(sprintrc(rc));
+}
+
+int
+main(void)
+{
+   static const size_t buf_size = DEFAULT_STRLEN + 10;
+
+   char *buf = tail_alloc(buf_size);
+
+   bool bools[] = { true, false };
+
+

Re: Introduction

2017-12-26 Thread Eugene Syromyatnikov
On Tue, Dec 26, 2017 at 1:44 PM, Kommuru jai shankar reddy
 wrote:
> Yes,  I am interested in the micro project of adding tests to the test
> suite. Could you please provide suggestions  on getting started to this  ?

Sure. I'd suggest starting with ioctl decoders that are not shown as
covered in LCOV reports, these are rather low-hanging fruits. The next
thing is rarely used features that have no tests or are poorly tested,
like path tracing or stack printing. It would be also benefitical to
add some tests that cover some not previously test-covered aspects of
strace's behaviour, like daemonized tracer, but in order to do that
properly, some understanding of the strace internal workings is
needed, and it might be difficult at first.

The tests themselves reside in tests directory. The make target of
interest is "make check", and you might be interested in
--enable-code-coverage configuration option.

Note also that code that is not covered by tests is more likely to
contain errors (especially if it is some obscure ioctl one rarely
cares about), so do not hesitate to fix it in case discrepancies
between kernel's and strace's interpretation of syscall arguments are
observed.

> On Mon, Dec 25, 2017 at 11:49 PM, Eugene Syromyatnikov 
> wrote:
>>
>> On Mon, Dec 25, 2017 at 5:06 PM, Kommuru jai shankar reddy
>>  wrote:
>> > Hello,
>> >I'm jaya shankar,. Computer science student of national institute
>> > of
>> > technology andhra pradesh, India
>> > I have used strace for my mini project for tracing system calls of
>> > malware
>> > executables and it helped me a lot.
>> > I want to contribute to the community and apply as student for GSOC
>> > 2k18.
>> > I'm having knowledge of kernel, C, git and basics of networking.
>> > So, it would be great if any one suggest me some tasks for micro
>> > projects
>> > for gsoc, some bugs to fix for a beginner like me.
>>
>> Thank you for showing interest in strace.
>>
>> Please take a look at [1], [2], and [3] as starting points. As Chen
>> JingPiao also noted recently [4], there is an ongoing effort to add
>> netlink protocol decoding support to strace, which may be of interest,
>> taking in account aforementioned background.
>>
>> If you have any specific questions, don't hesitate to ask.
>>
>> [1]
>> https://sourceforge.net/p/strace/wiki/Guide%20for%20new%20contributors/
>> [2] https://sourceforge.net/p/strace/wiki/Microprojects/
>> [3] https://sourceforge.net/p/strace/wiki/FeatureRequests/
>> [4] https://sourceforge.net/p/strace/mailman/message/36168713/
>>
>> --
>> Eugene Syromyatnikov
>> mailto:evg...@gmail.com
>> xmpp:esyr@jabber.{ru|org}
>>
>>
>> --
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> ___
>> Strace-devel mailing list
>> Strace-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/strace-devel
>
>
>
>
> --
> Thanks
>
> K.jaishankar reddy
>
>
> ------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Strace-devel mailing list
> Strace-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/strace-devel
>



-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: Introduction

2017-12-25 Thread Eugene Syromyatnikov
On Mon, Dec 25, 2017 at 5:06 PM, Kommuru jai shankar reddy
 wrote:
> Hello,
>I'm jaya shankar,. Computer science student of national institute of
> technology andhra pradesh, India
> I have used strace for my mini project for tracing system calls of malware
> executables and it helped me a lot.
> I want to contribute to the community and apply as student for GSOC 2k18.
> I'm having knowledge of kernel, C, git and basics of networking.
> So, it would be great if any one suggest me some tasks for micro projects
> for gsoc, some bugs to fix for a beginner like me.

Thank you for showing interest in strace.

Please take a look at [1], [2], and [3] as starting points. As Chen
JingPiao also noted recently [4], there is an ongoing effort to add
netlink protocol decoding support to strace, which may be of interest,
taking in account aforementioned background.

If you have any specific questions, don't hesitate to ask.

[1] https://sourceforge.net/p/strace/wiki/Guide%20for%20new%20contributors/
[2] https://sourceforge.net/p/strace/wiki/Microprojects/
[3] https://sourceforge.net/p/strace/wiki/FeatureRequests/
[4] https://sourceforge.net/p/strace/mailman/message/36168713/

-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: Introduction

2017-11-19 Thread Eugene Syromyatnikov
On Sun, Nov 19, 2017 at 4:32 PM, gou4shi1  wrote:
> Thanks for you response.
>
> However, there are so many files, how can I get the overall structure of the
> project?

Most of the files contain decoders for specific syscalls (like mount.c, statx.c,
getcpu.c, and so on) or groups of syscalls (like mem.c, signal.c,
fanotify.c, ...).
There are several files that contain generic strace code (strace.c,
util.c, defs.h,
syscall.c) and some auxiliary files with helper functions (like
ucopy.c or xmalloc.c).
The pretty common autotools-related stuff is here as well (like configure.ac,
m4 directory, and so on). The xlat directory contains files with related named
constants decriptions; they are processed to headers with gen.sh
script. The tests
directory contains tests. The maint directory is a palce for
maintenance scripts used
for the distribution preparation process. The linux directory contains
various headers
with definitions specific to architectures (like arch_get_scno for
obtaining syscall
number, or syscallent with table of syscall descriptions). If you have
any further specific questions,
don't hesitatte to ask.

> or another simpler question, which file is the entry of strace?(because
> maybe I can start from this file)

The strace.c file contains main routine.

-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: Introduction

2017-11-19 Thread Eugene Syromyatnikov
On Sun, Nov 19, 2017 at 1:49 PM, gou4shi1  wrote:
> Hello everyone
Hello.

> I'm Guangqing Chen, an undergraduate from South China Normal University,
> China.
>
> I have some knowledge about C and Unix programming.
>
> I want to know how to get started to read the source code of strace.

Thank you for showing interest in strace.

strace project uses git for source control. strace git repositories
are available
at [1] and [2], and at [3] and [4] the respective web interfaces are present.

[1] git://git.code.sf.net/p/strace/code
[2] https://github.com/strace/strace.git
[3] https://sourceforge.net/p/strace/code/ci/master/tree/
[4] https://github.com/strace/strace

-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: Introduction

2017-11-18 Thread Eugene Syromyatnikov
On Sat, Nov 18, 2017 at 8:38 PM, Manvendra Singh
 wrote:
> Hi everyone
Hello.

> I'm Manvendra Singh and doing under-graduation in Computer Science &
> Engineering from ITM University, Gwalior, India.
>
> I have knowledge of C, git and shell programming(basic). I wanted to
> contribute to the community.
> Can anybody please help me get started.

Thank you for showing interest in strace.

Please take a look at [1], [2], and [3] as starting points. If you have
any specific questions, don't hesitate to ask.

[1] https://sourceforge.net/p/strace/wiki/Guide%20for%20new%20contributors/
[2] https://sourceforge.net/p/strace/wiki/Microprojects/
[3] https://sourceforge.net/p/strace/wiki/FeatureRequests/

-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: regarding help for starting new contribution

2017-10-04 Thread Eugene Syromyatnikov
On Wed, Oct 4, 2017 at 2:45 PM, Surabhi gupta
 wrote:
> Hello,
>
> I am new to open source and wish to start contributing to strace, but am
> confused as to how and where I should begin.
>
> could you please help me figure out/point out some starting point for
> reading and understanding the source code.

Thank you for showing interest in strace. What specific task you're
trying to accomplish?

Please take a look at [1] and [2] as a starting points. If you have
any specific questions, don't hesitate to ask.

[1] https://sourceforge.net/p/strace/wiki/Guide%20for%20new%20contributors/
[2] https://sourceforge.net/p/strace/wiki/Microprojects/


-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


[PATCH 2/3] use print_quoted_string in decode_termio

2017-09-13 Thread Eugene Syromyatnikov
---
 term.c | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/term.c b/term.c
index 9368e5f..28f562f 100644
--- a/term.c
+++ b/term.c
@@ -73,7 +73,6 @@ static void
 decode_termio(struct tcb *const tcp, const kernel_ulong_t addr)
 {
struct termio tio;
-   int i;
 
tprints(", ");
if (umove_or_printaddr(tcp, addr, &tio))
@@ -102,10 +101,9 @@ decode_termio(struct tcb *const tcp, const kernel_ulong_t 
addr)
tprintf("c_cc[VMIN]=%d, c_cc[VTIME]=%d, ",
tio.c_cc[VMIN], tio.c_cc[VTIME]);
 #endif /* !_VMIN */
-   tprints("c_cc=\"");
-   for (i = 0; i < NCC; i++)
-   tprintf("\\x%02x", tio.c_cc[i]);
-   tprints("\"}");
+   tprints("c_cc=");
+   print_quoted_string((char *) tio.c_cc, NCC, QUOTE_FORCE_HEX);
+   tprints("}");
 }
 
 static void
-- 
2.1.4


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


[PATCH 1/3] xlat/gen.sh: add some rudimentary support for comments

2017-09-13 Thread Eugene Syromyatnikov
---
 xlat/gen.sh | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/xlat/gen.sh b/xlat/gen.sh
index 06c1b17..9efa0ab 100755
--- a/xlat/gen.sh
+++ b/xlat/gen.sh
@@ -135,6 +135,9 @@ gen_header()
# 1st pass: output directives.
while read line; do
LC_COLLATE=C
+   line=$(printf "%s" "$line" | \
+   sed "s|[[:space:]]*/\*.*\*/[[:space:]]*||")
+
case $line in
'#stop')
exit 0
@@ -196,6 +199,9 @@ gen_header()
# 2nd pass: output everything.
while read line; do
LC_COLLATE=C
+   line=$(printf "%s" "$line" | \
+   sed "s|[[:space:]]*/\*.*\*/[[:space:]]*||")
+
case ${line} in
'#conditional')
unconditional=
-- 
2.1.4


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: Show full named struct values?

2017-09-13 Thread Eugene Syromyatnikov
Hello.

Current support of term ioctls is in pretty abandoned state.

However, does this patch set work for you?

Eugene Syromyatnikov (3):
  xlat/gen.sh: add some rudimentary support for comments
  use print_quoted_string in decode_termio
  term: improve decoding of termios and termio structures

 term.c | 151 +
 xlat/gen.sh|   6 ++
 xlat/term_cflags.in|   9 +++
 xlat/term_cflags_csize.in  |   4 ++
 xlat/term_iflags.in|  15 +
 xlat/term_lflags.in|  17 +
 xlat/term_oflags.in|  15 +
 xlat/term_oflags_bsdly.in  |   2 +
 xlat/term_oflags_crdly.in  |   4 ++
 xlat/term_oflags_ffdly.in  |   2 +
 xlat/term_oflags_nldly.in  |   4 ++
 xlat/term_oflags_tabdly.in |   8 +++
 xlat/term_oflags_vtdly.in  |   2 +
 xlat/termio_cc.in  |  10 +++
 xlat/termios_cc.in |  18 ++
 15 files changed, 242 insertions(+), 25 deletions(-)
 create mode 100644 xlat/term_cflags.in
 create mode 100644 xlat/term_cflags_csize.in
 create mode 100644 xlat/term_iflags.in
 create mode 100644 xlat/term_lflags.in
 create mode 100644 xlat/term_oflags.in
 create mode 100644 xlat/term_oflags_bsdly.in
 create mode 100644 xlat/term_oflags_crdly.in
 create mode 100644 xlat/term_oflags_ffdly.in
 create mode 100644 xlat/term_oflags_nldly.in
 create mode 100644 xlat/term_oflags_tabdly.in
 create mode 100644 xlat/term_oflags_vtdly.in
 create mode 100644 xlat/termio_cc.in
 create mode 100644 xlat/termios_cc.in

-- 
2.1.4


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


[PATCH 3/3] term: improve decoding of termios and termio structures

2017-09-13 Thread Eugene Syromyatnikov
---
 term.c | 145 ++---
 xlat/term_cflags.in|   9 +++
 xlat/term_cflags_csize.in  |   4 ++
 xlat/term_iflags.in|  15 +
 xlat/term_lflags.in|  17 ++
 xlat/term_oflags.in|  15 +
 xlat/term_oflags_bsdly.in  |   2 +
 xlat/term_oflags_crdly.in  |   4 ++
 xlat/term_oflags_ffdly.in  |   2 +
 xlat/term_oflags_nldly.in  |   4 ++
 xlat/term_oflags_tabdly.in |   8 +++
 xlat/term_oflags_vtdly.in  |   2 +
 xlat/termio_cc.in  |  10 
 xlat/termios_cc.in |  18 ++
 14 files changed, 234 insertions(+), 21 deletions(-)
 create mode 100644 xlat/term_cflags.in
 create mode 100644 xlat/term_cflags_csize.in
 create mode 100644 xlat/term_iflags.in
 create mode 100644 xlat/term_lflags.in
 create mode 100644 xlat/term_oflags.in
 create mode 100644 xlat/term_oflags_bsdly.in
 create mode 100644 xlat/term_oflags_crdly.in
 create mode 100644 xlat/term_oflags_ffdly.in
 create mode 100644 xlat/term_oflags_nldly.in
 create mode 100644 xlat/term_oflags_tabdly.in
 create mode 100644 xlat/term_oflags_vtdly.in
 create mode 100644 xlat/termio_cc.in
 create mode 100644 xlat/termios_cc.in

diff --git a/term.c b/term.c
index 28f562f..25497b9 100644
--- a/term.c
+++ b/term.c
@@ -38,6 +38,121 @@
 #include "xlat/baud_options.h"
 #include "xlat/modem_flags.h"
 
+#include "xlat/term_cflags.h"
+#include "xlat/term_cflags_csize.h"
+#include "xlat/term_iflags.h"
+#include "xlat/term_lflags.h"
+#include "xlat/term_oflags.h"
+#include "xlat/term_oflags_bsdly.h"
+#include "xlat/term_oflags_crdly.h"
+#include "xlat/term_oflags_ffdly.h"
+#include "xlat/term_oflags_nldly.h"
+#include "xlat/term_oflags_tabdly.h"
+#include "xlat/term_oflags_vtdly.h"
+
+#include "xlat/termio_cc.h"
+#include "xlat/termios_cc.h"
+
+static void
+decode_oflag(uint64_t val)
+{
+   static const struct {
+   const struct xlat *xl;
+   uint64_t mask;
+   const char *dfl;
+   } xlats[] = {
+   { term_oflags_bsdly,  BSDLY,  "BS?"  },
+   { term_oflags_crdly,  CRDLY,  "CR?"  },
+   { term_oflags_ffdly,  FFDLY,  "FF?"  },
+   { term_oflags_nldly,  NLDLY,  "NL?"  },
+   { term_oflags_tabdly, TABDLY, "TAB?" },
+   { term_oflags_vtdly,  VTDLY,  "VT?"  },
+   };
+
+   unsigned i;
+
+   for (i = 0; i < ARRAY_SIZE(xlats); i++) {
+   printxval64(xlats[i].xl, val & xlats[i].mask, xlats[i].dfl);
+   tprints("|");
+
+   val &= ~xlats[i].mask;
+   }
+
+   printflags64(term_oflags, val, NULL);
+}
+
+static void
+decode_cflag(uint64_t val)
+{
+   printxval64(baud_options, val & CBAUD, "B???");
+   tprints("|");
+   printxval64(baud_options, (val & CIBAUD) >> IBSHIFT, "B???");
+   tprintf("val >= size)
+   continue;
+
+   print_cc_char(&first, data, xl->str, xl->val);
+   not_printed &= ~(1 << xl->val);
+   }
+
+   while (not_printed) {
+   if (not_printed & 1)
+   print_cc_char(&first, data, NULL, i);
+
+   not_printed >>= 1;
+   i++;
+   }
+
+   tprints("}");
+}
+
 static void
 decode_termios(struct tcb *const tcp, const kernel_ulong_t addr)
 {
@@ -56,16 +171,14 @@ decode_termios(struct tcb *const tcp, const kernel_ulong_t 
addr)
(tios.c_lflag & ECHO) ? "" : "-");
return;
}
-   tprintf("{c_iflags=%#lx, c_oflags=%#lx, ",
-   (long) tios.c_iflag, (long) tios.c_oflag);
-   tprintf("c_cflags=%#lx, c_lflags=%#lx, ",
-   (long) tios.c_cflag, (long) tios.c_lflag);
-   tprintf("c_line=%u, ", tios.c_line);
+   tprints("{");
+   decode_flags(tios.c_iflag, tios.c_oflag, tios.c_cflag, tios.c_lflag);
+   tprintf(", c_line=%u, ", tios.c_line);
if (!(tios.c_lflag & ICANON))
tprintf("c_cc[VMIN]=%d, c_cc[VTIME]=%d, ",
tios.c_cc[VMIN], tios.c_cc[VTIME]);
tprints("c_cc=");
-   print_quoted_string((char *) tios.c_cc, NCCS, QUOTE_FORCE_HEX);
+   decode_term_cc(termios_cc, tios.c_cc, NCCS);
tprints("}");
 }
 
@@ -87,22 +200,12 @@ decode_termio(struct tcb *const tcp, const kernel_ulong_t 
addr)
(tio.c_lflag & ECHO) ? "" : "-");
return;
}
-   tprintf("{c_iflags=%#lx, c_oflags=%#lx, ",
-   (long) tio.c_iflag, (long) tio.c_oflag);
-   tprintf("c_cflags=%#lx, c_lflags=%#lx, ",
-   (long) tio.c_cflag, (long) tio.c_lflag);
-   tprintf("c_line=%u, ", tio.c_line);
-#ifdef _VMIN
-   if (!(tio.c_lflag & ICANON))
-   tprintf("c_cc[_VMIN]=%d, c_cc[_VTIME]=%d, ",
-   tio.c_cc[_VMIN], tio.c_cc[_VTIME]);
-#else /* !_VMIN */
-   if (!(tio.c_lflag & ICANON))
-   tprintf("c_cc[VMIN]=%

Re: Feature Request: Process Lineage in Filenames.

2017-09-01 Thread Eugene Syromyatnikov
On Sat, Mar 4, 2017 at 12:08 AM, Eugene Syromyatnikov  wrote:
> On Fri, Mar 3, 2017 at 11:54 PM, Ralph Corderoy  wrote:
>> Hi,
>>
>> Second request.  I had a bunch of filename.pid outputs from -ff the
>> other day and to better understand what occurred, I examined and renamed
>> them to show their ancestry.
>>
>> 1000.man
>> 1008.man-preconv
>> 1009.man-tbl
>> 1010.man-nroff
>> 1011.man-col
>> 1013.man-nroff-locale
>> 1016.man-nroff-groff
>> 1018.man-nroff-groff-troff
>> 1019.man-nroff-groff-grotty
>>
>> I was thinking something similar could happen automatically.  Not using
>> the name of the program execve()'d, because that comes later, but a list
>> of PIDs starting with the ancestor.  So
>>
>> strace -o foo -fff /usr/bin/foo
>>
>> might produce
>>
>> foo.100
>>
>> and as that forks
>>
>> foo.100-102
>>
>> and forks again
>>
>> foo.100-102-103
>>
>> foo.100-109 would be 102's sibling.
>>
>> It would make it that bit easier when grep-ing through them all, etc.,
>> to interpret the results.
> Well, something like { echo 'digraph {'; for i in *; do sed -n
> "/clone/s/.* \([0-9]*\)\$/${i#*.} -> \1;/p" $i; done; echo '}'; } |
> dot -Tpng  > pid_graph.png can ease the task, but it is not always
> that easy [1]. Thanks for the sugestion, since strace indeed can track
> this sort of process relations.

As it turns out, PTRACE_EVENT_(CLONE|FORK|VFORK) is delivered only
after new task is run, which results in a race between attach-stop
from the new task (which triggers allocation of the new tcb and
creation of the new file) and this aforementioned ptrace event from
the old one, and using child's proc for deriving parent PID looks even
more racy (imagine parent has been killed while we trying to open
/proc/pid/stat and try to go through it). So, this one is not as easy
as it seemed on the first look.

-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: strace-k.test

2017-08-31 Thread Eugene Syromyatnikov
On Wed, Aug 30, 2017 at 12:42 PM, Andreas Schwab  wrote:
> The strace-k test always fails if getpid is implemented as a vsyscall:

Can you please provide some information about the environment in order
to reproduce it? It's quite unusual to me that vsyscall is used
somewhere.

-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: Unable to use strace in embedded mips system

2017-08-16 Thread Eugene Syromyatnikov
On Wed, Aug 16, 2017 at 1:37 PM, Davide Palma  wrote:
> What do you suggest me to do?
What is the kernel version?

-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: Edgar Kaziakhmedov's GSoC status report - #8 of 13

2017-07-27 Thread Eugene Syromyatnikov
On Thu, Jul 27, 2017 at 9:39 PM, Edgar Kaziakhmedov
 wrote:
>
> Accomplishment:
> asinfo for now completely is able to print out all info about all
> supported architectures with get-arch option(taking into account
> all personalities)
>
> Thus, arch_dispatcher is completed fully.
>
> Also, I have made syscall_dispatcher, but it has some cases when it
> doesn't work, literally in 1 day it's going to be debugged.

Would you mind to consider sending WIP patches or providing a link to
a repository so we can look at the current state of the project?

-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: [PATCH v9 0/3] Add LuaJIT scripting support

2017-07-26 Thread Eugene Syromyatnikov
On Wed, Jul 26, 2017 at 2:56 PM, Victor Krapivensky
 wrote:
> * All the Lua functions that previously took an optional "pers" argument
> now take a mandatory "pers_spec" argument, which can be either an
> integer personality number, or a cdata struct tcb *, from which a
> personality number if copied.
> * For all the Lua functions that take a "when" argument, it can now be a
> two-element array (that is, a table with keys 1 and 2) of booleans;
> first of them controls if hooking should done on syscall entry, and the
> second one if on syscall exit;
> * strace.monitor_all now takes a "when" argument;
> * New Lua function strace.monitor_name.
> * Certain Lua functions that are described in the man page section as
> taking a *string* argument (where a *string* is defined as either a Lua
> string or a cdata C string) now actually support cdata C strings.
> * Fixed upoken's behaviour when process_vm_writev is not available
> and modifying the middle of a word is requested.
> * Some other minor fixes.

Thanks!

-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: [PATCH v9 0/3] Add LuaJIT scripting support

2017-07-26 Thread Eugene Syromyatnikov
On Tue, Jul 25, 2017 at 12:59 PM, Victor Krapivensky
 wrote:
> Victor Krapivensky (3):
>   Initial support for LuaJIT scripting
>   Introduce upoken function and expose it to LuaJIT scripts
>   tests: check LuaJIT scripting support

It's quite handy to have patch changelog here, especially if you claim
that the issues pointed out during the previous review are partially
touched.

-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: [PATCH v4 2/6] Introduce new filtering architecture

2017-07-25 Thread Eugene Syromyatnikov
On Tue, Jul 25, 2017 at 5:19 AM, Nikolay Marchuk
 wrote:
> What indentation should I use? I used DECL_* macros from defs.h as a
> reference.
After discussion with Dmitry it has been decided that comments after such macro
definitions should be put in order to signify their termination, please refer
to commit 861e50b6 [1].

[1] 
https://github.com/strace/strace/commit/861e50b6df434ac690613c54ad75aaefc9743e74

-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: Edgar Kaziakhmedov's GSoC status report - #6 of 13

2017-07-11 Thread Eugene Syromyatnikov
On Tue, Jul 11, 2017 at 7:29 AM, Edgar Kaziahmedov  wrote:
> I accidentally lost mail with faster ways of communication with
> mentors. Could you resend it, please?
Do you mean [1] or something else?

[1] https://sourceforge.net/p/strace/mailman/message/35839556/

-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: [PATCH v3 2/6] Introduce new filtering architecture

2017-07-05 Thread Eugene Syromyatnikov
On Wed, Jul 5, 2017 at 9:47 AM, Nikolay Marchuk
 wrote:
>>> +void
>>> +set_filters_qualify_mode(struct filter **filters, unsigned int *nfilters)
>>> +{
>>> +unsigned int i;
>>> +for (i = 0; i < *nfilters - 1; ++i) {
>>> +free_filter(*filters + i);
>>> +}
>>> +**filters = (*filters)[*nfilters - 1];
>>> +*filters = xreallocarray(*filters, 1, sizeof(struct filter));
>> I'm pretty sure realloc() can't be expected to be able to handle 
>> re-allocating
>> memory hunk which is provided by pointer not pointing at the beginning
>> of the hunk. IOW, allocators are not expected to work with arbitrary 
>> pointers,
>> only with ones that are returned by those allocators.
> But pointer isn't changed between allocations.
>>> +
>>> +DECL_FILTER_ACTION_PARSER(null);
>>> +DECL_FILTER_ACTION_PARSER(inject);
>>> +
>>> +#undef DECL_FILTER_ACTION_PARSER
>>> +
>>> +#define FILTER_ACTION_TYPE(NAME, PRIORITY, PARSER, PREFILTER)  
>>>  \
>>> +{#NAME, sizeof(#NAME) - 1,PRIORITY, parse_ ## PARSER, free_ ## PARSER, 
>>>  \
>>> + PREFILTER, apply_ ## NAME}
>> Missing indentation of the macro definition. Incorrect indentation of
>> the structure definition continuation.
> I can't find any references for multi-line structure definitions.
> What indentation should I use?
The default is single tab character, and I see no reason for using
something else in case of structure definition.


-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: [PATCH v3 5/6] Optimize default filtering

2017-07-03 Thread Eugene Syromyatnikov
On Mon, Jul 3, 2017 at 6:43 PM, Victor Krapivensky
 wrote:
> Actually, passing a non-dereferencable pointer as a first argument to
> qsort is UB, even if the second argument is 0:
My bad, didn't notice that filter_actions is invalid in that case, thanks!


-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: [PATCH RFC v1 1/1] Initial support for Lua scripting

2017-06-16 Thread Eugene Syromyatnikov
On Fri, Jun 16, 2017 at 2:39 PM, Victor Krapivensky
 wrote:
> On Thu, Jun 15, 2017 at 05:39:25PM +0000, Eugene Syromyatnikov wrote:
>> On Thu, Jun 15, 2017 at 3:28 PM, Eugene Syromiatnikov  
>> wrote:
>> > Overall looks good.
>>
>> Well, except that mpers_defs.h also has STRINGIFY() macro and
>> undef'ing it in defs_reuse.h leads to breaking of mpers header
>> generation and breaking of the (clean) build, as a result. I'd suggest
>> renaming STRINGIFY() macro in defs_reuse.h.
>
> I think it would be better to rename STRINGIFY() macro in mpers_defs.h,
> so that it does not pollute the global namespace.
Well, I don't consider having a commonly used stringification macro a
namespace pollution. It also makes sense to move it to defs.h before
the mpers_type.h inclusion, for yet another option.

Also, sorry for misleading, the filename is actually mpers_type.h and
not mpers_defs.h.

> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Strace-devel mailing list
> Strace-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/strace-devel



-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: [PATCH RFC v1 1/1] Initial support for Lua scripting

2017-06-15 Thread Eugene Syromyatnikov
On Thu, Jun 15, 2017 at 3:28 PM, Eugene Syromiatnikov  wrote:
> Overall looks good.

Well, except that mpers_defs.h also has STRINGIFY() macro and
undef'ing it in defs_reuse.h leads to breaking of mpers header
generation and breaking of the (clean) build, as a result. I'd suggest
renaming STRINGIFY() macro in defs_reuse.h.

-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: [PATCH 1/8] netlink: add a basic socket diag parser of AF_NETLINK messages

2017-06-13 Thread Eugene Syromyatnikov
On Tue, Jun 13, 2017 at 8:13 PM, Dmitry V. Levin  wrote:
> On Tue, Jun 13, 2017 at 10:13:18PM +0800, JingPiao Chen wrote:
>> +/* deprecated since 4.6 */
>
> Do we really need this comment?
Yes, we do, as otherwise it's quite difficult to figure out where is
the constant from when it is not defined in actual version of the
kernel headers and these headers have suffered several iterations of
refectoring.

-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


IRC channel

2017-05-14 Thread Eugene Syromyatnikov
Hello.

As some already know, strace project has an IRC channel (#strace) on
the FreeNode network [1]. I, for my part, suggest GSoC students
consider joining it, as it might be more familiar way of communication
for some.

Note, however, that it in no way replaces communication via the
mailing list, as the latter definitely has far broader reach and is
much more "archive-able" way of communication, so it is more suitable
for open discussions.

[1] https://sourceforge.net/p/strace/mailman/message/35631132/

-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: Testcase failed

2017-05-09 Thread Eugene Syromyatnikov
On Sun, May 7, 2017 at 3:36 PM, Sumit Sardana  wrote:
> Hi
Hello.

> What is attach-p-cmd.test ?
It is test for simultaneous attaching and running a tracee provided in
command line arguments, as test description states.

> After ```make check``` I got this test-case failed
It has some race which has yet to be addressed. It might be some
kernel bug, judging by unexpected ENOSYS.

> FAIL: attach-p-cmd
> ==
>
> 4c4,5
> < 30903 chdir("attach-p-cmd.test -p") = -1 ENOENT (No such file or
> directory)
> ---
>> 30903 syscall_18446744073709551615(0x1, 0x1c0, 0, 0x8, 0, 0) = -1 (errno
>> 38)
>> 30903 chdir("attach-p-cmd.test -p") = -1 ENOSYS (Function not implemented)
> attach-p-cmd.test: failed test: ../../strace -a30 -echdir -p 30903
> ../attach-p-cmd-cmd output mismatch
> FAIL attach-p-cmd.test (exit status: 1)
>
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Strace-devel mailing list
> Strace-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/strace-devel
>



-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: [PATCH 1/2] v4l2: Add decoding for VIDIOC_G/S_TUNER's arg

2017-05-01 Thread Eugene Syromyatnikov
uot;}");
>> > +   return 1;
>> > +   }
>> > +   tprints(is_get ? ", " : " => ");
>> > +   }
>> > +
>> > +   tprints("name=");
>> > +   print_quoted_string((const char *) c.name, sizeof(c.name),
>> > +   QUOTE_0_TERMINATED);
>> > +   tprints(", type=");
>> > +   printxval(v4l2_tuner_types, c.type, "V4L2_TUNER_TYPE_???");
>> > +   tprints(", capability=");
>> > +   printxval(v4l2_tuner_capabilities, c.capability,
>> > + "V4L2_TUNER_CAP_???");
>> > +   tprintf(", rangelow=%u, rangehigh=%u, rxsubchans=",
>> > +   c.rangelow, c.rangehigh);
>> > +   printxval(v4l2_tuner_rxsubchanses, c.rxsubchans,
>> > + "V4L2_TUNER_SUB_???");
>> > +   tprints(", audmode=");
>> > +   printxval(v4l2_tuner_audmodes, c.audmode,
>> > + "V4L2_TUNER_MODE_???");
>> > +   tprintf(", signal=%d, afc=%d", c.signal, c.afc);
>> > +
>> > +   if (exiting(tcp))
>> > +   tprints("}");
>> > +   return 1;
>> > +}
>> > +
>> >  #include "xlat/v4l2_control_types.h"
>> >  #include "xlat/v4l2_control_flags.h"
>> >
>> > @@ -971,6 +1020,10 @@ MPERS_PRINTER_DECL(int, v4l2_ioctl, struct tcb
>> > *const tcp, case VIDIOC_S_CTRL: /* RW */
>> > return print_v4l2_control(tcp, arg, code ==
>> > VIDIOC_G_CTRL);
>> > +   case VIDIOC_G_TUNER: /* RW */
>> > +   case VIDIOC_S_TUNER: /* RW */
>> > +   return print_v4l2_tuner(tcp, arg, code ==
>> > VIDIOC_G_TUNER); +
>> > case VIDIOC_QUERYCTRL: /* RW */
>> > return print_v4l2_queryctrl(tcp, arg);
>> >
>> > diff --git a/xlat/v4l2_tuner_audmodes.in
>> > b/xlat/v4l2_tuner_audmodes.in new file mode 100644
>> > index ..82decabf
>> > --- /dev/null
>> > +++ b/xlat/v4l2_tuner_audmodes.in
>> > @@ -0,0 +1,6 @@
>> > +V4L2_TUNER_MODE_MONO
>> > +V4L2_TUNER_MODE_STEREO
>> > +V4L2_TUNER_MODE_LANG2
>> > +V4L2_TUNER_MODE_SAP
>> > +V4L2_TUNER_MODE_LANG1
>> > +V4L2_TUNER_MODE_LANG1_LANG2
>> > diff --git a/xlat/v4l2_tuner_capabilities.in
>> > b/xlat/v4l2_tuner_capabilities.in new file mode 100644
>> > index ..4aec41eb
>> > --- /dev/null
>> > +++ b/xlat/v4l2_tuner_capabilities.in
>> > @@ -0,0 +1,14 @@
>> > +V4L2_TUNER_CAP_LOW
>> > +V4L2_TUNER_CAP_NORM
>> > +V4L2_TUNER_CAP_HWSEEK_BOUNDED
>> > +V4L2_TUNER_CAP_HWSEEK_WRAP
>> > +V4L2_TUNER_CAP_STEREO
>> > +V4L2_TUNER_CAP_LANG2
>> > +V4L2_TUNER_CAP_SAP
>> > +V4L2_TUNER_CAP_LANG1
>> > +V4L2_TUNER_CAP_RDS
>> > +V4L2_TUNER_CAP_RDS_BLOCK_IO
>> > +V4L2_TUNER_CAP_RDS_CONTROLS
>> > +V4L2_TUNER_CAP_FREQ_BANDS
>> > +V4L2_TUNER_CAP_HWSEEK_PROG_LIM
>> > +V4L2_TUNER_CAP_1HZ
>> > diff --git a/xlat/v4l2_tuner_rxsubchanses.in
>> > b/xlat/v4l2_tuner_rxsubchanses.in new file mode 100644
>> > index ..c6d59e95
>> > --- /dev/null
>> > +++ b/xlat/v4l2_tuner_rxsubchanses.in
>> > @@ -0,0 +1,6 @@
>> > +V4L2_TUNER_SUB_MONO
>> > +V4L2_TUNER_SUB_STEREO
>> > +V4L2_TUNER_SUB_LANG2
>> > +V4L2_TUNER_SUB_SAP
>> > +V4L2_TUNER_SUB_LANG1
>> > +V4L2_TUNER_SUB_RDS
>> > diff --git a/xlat/v4l2_tuner_types.in b/xlat/v4l2_tuner_types.in
>> > new file mode 100644
>> > index ..59a9f3a3
>> > --- /dev/null
>> > +++ b/xlat/v4l2_tuner_types.in
>> > @@ -0,0 +1,6 @@
>> > +V4L2_TUNER_RADIO
>> > +V4L2_TUNER_ANALOG_TV
>> > +V4L2_TUNER_DIGITAL_TV
>> > +V4L2_TUNER_ADC
>> > +V4L2_TUNER_SDR
>> > +V4L2_TUNER_RF
>>
>> I'm sorry for disturbing, but are you going to look the last one
>> patch?
>
> I'm sorry for disturbing, but are you going to look the last one patch?
Are you referring to commit 99bade991795dea26a0234ddd9b2c54aa2f2b737,
which was applied 9 days ago?

> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Strace-devel mailing list
> Strace-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/strace-devel
>



-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: strace-V test fails next year

2017-04-21 Thread Eugene Syromyatnikov
On Tue, Apr 4, 2017 at 9:05 AM, Andreas Schwab  wrote:
> FAIL: strace-V
> ==
>
> 2c2
> < Copyright (C) 1991-2017 The strace developers <https://strace.io>.
> ---
>> Copyright (C) 1991-2018 The strace developers <https://strace.io>.
> strace-V.test: failed test: ../strace -V output mismatch

The issue is fixed in v4.16-150-gcd838da.

> Andreas.
>
> --
> Andreas Schwab, SUSE Labs, sch...@suse.de
> GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
> "And now for something completely different."
>
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Strace-devel mailing list
> Strace-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/strace-devel



-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: [RFC] GSoC 2017 proposal draft: advanced syscall tampering and filtering with Lua

2017-04-03 Thread Eugene Syromyatnikov
On Thu, Mar 30, 2017 at 5:56 PM, Victor Krapivensky
 wrote:
> On Thu, Mar 30, 2017 at 05:28:55AM +0200, Eugene Syromyatnikov wrote:
>> The one quite interesting aspect, from my point of view, is the way you
>> expect to access (and modify) argument data. For example, some syscalls
>> (like sendmsg or evdev/dm ioctls or siginfo-related ones) have quite
>> non-trivial argument semantics — pointers upon pointers upon pointers;
>> related decoders have quite significant amount of code in order to
>> retrieve them. Note also, that argument decoding also depends on
>> tracee's ABI and the values of other arguments (various "dispatcher"
>> calls like ioctl or prctl are good example).  Do you have any ideas
>> regarding the subject?
>
> But it is still possible to access such arguments by means of FFI
> library -- one just needs ptr_to_kulong() and information on current
> architecture/personality. And what's the problem with the "dispatcher"
> calls?
>
> A Lua library that provides definitions of various structures and
> decodes syscalls can later be implemented on top of that, but this is
> not a part of my proposal.
The problem with accessing data is that you should replicate all the
decoder's knowledge regarding argument semantics in Lua in order to
access them properly. But looks like indeed this is outside of the
scope of your proposal, so let's keep it this way.

> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______
> Strace-devel mailing list
> Strace-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/strace-devel



-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: GSOC: 2017 : I want to contribute

2017-04-02 Thread Eugene Syromyatnikov
On Sun, Apr 2, 2017 at 2:41 PM, sandhya bankar
 wrote:
> Hello,
Hello.

>   I am Sandhya, an opensource enthusiast and a  contributor to the
> linux-kernel project. I'm currently an Kernel Intern at The Linux Foundation
> through Outreachy Dec-2016. I started contributing to open source almost 1
> year before.
> I would like to join strace project and work on the same. I have used strace
> so many times in academics and in my project. I would like to contribute to
> this magical utility.
>
> I have one doubt, Can anybody quickly guide me ?
Please take a look at the following:
* https://sourceforge.net/p/strace/mailman/strace-devel/ is an archive
of this mailing list, it contains lots of information and worth
searching
* https://sourceforge.net/p/strace/wiki/Guide%20for%20new%20contributors/
is a short guide for new contributors
* https://github.com/strace/strace/blob/master/README-hacking contains
some information regarding contribution requirements. Other README*
files are also worth a look.

> I have added couple of testcases but not able to build and test it. How we
> should build and execute the test available in tests folder ?
Test suite can be run with "make check". Specific test can be run with
make check TESTS="test_name".

> Thanks,
> Sandhya Bankar

-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: [RFC] GSoC 2017 proposal draft: advanced syscall tampering and filtering with Lua

2017-03-29 Thread Eugene Syromyatnikov
Hello.

On Sat, Mar 25, 2017 at 10:58:16PM +0300, Victor Krapivensky wrote:
> The first draft of my proposal can be found here:
> 
> https://gist.github.com/shdown/a1f3f2bce1210f55389bacf406030b25
> 
> As for now, it is incomplete (does not even contain schedule) and will
> surely be updated and enhanced later.
> 
> Please provide some feedback.

The one quite interesting aspect, from my point of view, is the way you
expect to access (and modify) argument data. For example, some syscalls
(like sendmsg or evdev/dm ioctls or siginfo-related ones) have quite
non-trivial argument semantics — pointers upon pointers upon pointers;
related decoders have quite significant amount of code in order to
retrieve them. Note also, that argument decoding also depends on
tracee's ABI and the values of other arguments (various "dispatcher"
calls like ioctl or prctl are good example).  Do you have any ideas
regarding the subject?

There was some project last year [1], which constructed some internal
representation of retrieved syscall arguments as a byproduct of its
implementation, but it is strictly tailored for usage by the output
formatting backend.

[1] https://github.com/lineprinter/strace/wiki/GSoC-related-information

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: [PATCH] powerpc, x86_64: drop support of old kernels

2017-03-29 Thread Eugene Syromyatnikov
On Tue, Mar 28, 2017 at 09:18:29PM +0300, Gleb Fotengauer-Malinovskiy wrote:
> Drop support of x86_64 kernels < 2.6.34
> without PTRACE_GETREGSET support.
I think dropping support for kernels like 2.6.32 this early is not a very
good idea. At least, it's quite dramatic change from "Linux kernel >= 2.6.18
is recommended <...> Linux kernel >= 2.5.46 is required".

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: Introduction and [PATCH V1]

2017-03-24 Thread Eugene Syromyatnikov
On Fri, Mar 24, 2017 at 8:12 AM, Rohan Rajak  wrote:
> Hi Sir,
>
> I am not really understanding whether we are covering majority of strace
> code and kernel as well.
Well, covering the kernel code is not a target of the test suite. Test
suite is aimed to check that strace's behaviour is correct (in many
senses). Significant part of it checks decoders, and in terms of
decoder tests there are the following criterias:
 * All code paths should be covered. Unfortunately, current system
counts coverage independent of callee, thus if some utility function
is called at least once, it deemed covered. What is more important,
however, is that all relevant code (including common utility) has been
covered for each decoder, as it allows for checking all thecorner
cases specific to each decoder (for example, printstr_ex has a lot of
options and we should make sure that right options are called in right
cases and we are getting output we expected in regards to trimming,
ellipsis, quotes, escaping, etc).
 * As it is intended to make strace the debugging tool, it is aimed
that strace's output mimics the way kernel interprets incoming
arguments. It's quite difficult to formalise this properly, as it
boils down to the syscall code and its callees (for example, how uid
65535/4294967295 should be printed, if some syscalls interpret it as a
special value and others just as an invalid one; or how to interpret
ignored arguments). However, in term of testcase we at least
definitely know that we should at least cover this case and check that
it prints what we decide it should print.
 * As strace's output is for people, not machines, it can be shortened
and abbreviated in various ways. As it creates some variation and some
peculiarity to strace's output, all these cases should be covered too
(whether all hese shorthands are used only in case we expect it and
nowhere else).

> Also there is a difference of coverage on codecov
> site and on other systems I have tested, how would you suggest to solve that
> .

As noted in [1], some tests (and, to some extent, strace's behaviour)
are dependent on the version of kernel headers, libc, and kernel ABI
used for building strace or tests, respectively. thus the discrepancy.

[1] https://sourceforge.net/p/strace/mailman/message/35732562/

-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: Introduction and [PATCH V1]

2017-03-21 Thread Eugene Syromyatnikov
On Sun, Mar 19, 2017 at 03:27:18PM +0530, Rohan Rajak wrote:
> Hi,
> I am Rohan Rajak a 3rd year computer science student at IIT Kharagpur,
> (India).
> My interest lies in System Programming. I have taken courses like operating
> system, computer networks etc. And I am familiar with multithreaded and
> shell programming.
> 
> I am looking forward to work in comprehensive test suite project of strace
> in GSOC 2017. I have gone through most of the conversation in the mailing
> list (recent and archive), I know I took time to get started as I was
> trying hard to understand it.
> 
> 
> I have implemented an exit and an error message in the file test/skodic.c
> to demonstrate races.
> I have exited with -1 when the file descriptor haven't found any file.
> 
> please review my patch

Thanks for your contribution. Unfortunately, this demo program (as well as other
ones in the test directory) is long abandoned. However, your e-mail has
motivated to update both this demo (see commit ec548045) and description
for the whole directory (see commit f9390b96). It may worth noting that
currently strace employs test suite located in tests directory. It can
be run with `make check' command, "check" being a standard target in
accordance with GNU coding guidelines.

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: Q: statfs related syscalls (was: Re: GSOC: Introduction)

2017-03-21 Thread Eugene Syromyatnikov
On Sat, Mar 18, 2017 at 08:29:46PM +0530, Abhishek Tiwari wrote:
> fixed. Patch attached.
Please look at the rest of the e-mail you have replied to.

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: Understanding a parser.

2017-03-21 Thread Eugene Syromyatnikov
On Sun, Mar 19, 2017 at 01:47:22AM +0530, Rishi Bhatt wrote:
> Hi,
> Well i am currently understanding how to implement a parser,so i am
> starting with the simple ones first i.e umask.c,readahead.c,mount.c.
> 
> What i know about the implementation of parser:
> What we do in these are use the tcb struct(u_arg[]) to get the values that
> are passed in as arguments,i am not going into that detail for now (or
> should i go?),i guess for now i should just accept it.
You can check trace_syscall_entering() and specifically get_syscall_args()
linux/*/get_syscall_args.c for the code which retrieves data from the tracee in
case you are wondering how it is implemented. Basically, it retrieves
data from registers used for passing function call arguments. For the most
part, they trivially map on function arguments, except some peculiarities like
passing 64-bit argument on 32-bit architectures.

> Now taking an example of a parser lets say mount.c:
> arguments of mount:source,target,filesystem,mountflags and data.
> 
> So if i am implementing a mount parser i have to get the values that is
> being passed in this syscall that i can get from registers(somehow), also
> the return value and error values.
This is done already in the beginning of trace_syscall_{entering,exiting}().

> Also we have to consider printing the
> appropriate things with appropriate wrappers like if we are printing source
> and target in mount.c we are using printpath and if address ,it is prinnted
> by printaddr and etc.
Well, this is the current state of things. Printing is handled by
decoders, there are some helpers defined in defs.h/util.c for printing
specific formats, but in most cases it boils down to set of tprintf/tprints with
appropriately casted/processed arguments.

> And we have to first know what can be value of a specific parameter in
> different condition,like in mount.c we are printing "mount_filesystem" as a
> address or as string.(ignore_type)
Yes, this is a part of mount syscall semantics.

> So this should be the info to start implementing a parser?
> 
> So please fill me up with more detail if i am missing something or i am
> interpreting something in a wrong way,and if possible can you give me some
> small parser related thing to implement so i can understand it better.So i
> can try to start implementing a parser.

First, which parser you want to implement? Usually it starts with
figuring out the syscall argument semantics and the way arguments are
handled by the kernel—strace tries to show the way kernel sees
arguments, so one (while it uses strace) could try to extrapolate what kernel
would do with them. Once this understanding is obtained, decoder implementation
itself is relatively easy. Other tricky part is figuring out proper test cases
which check whether decoder prints what it is intended to be printed as much as
possible.

Please, do not hesitate to ask specific questions.

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: [PATCH v6] Implement -e trace=%statfs option for tracing statfs like syscalls

2017-03-21 Thread Eugene Syromyatnikov
> None of stat related syscalls have their corresponding flag set.
> $  grep -nr '_\(\|f\|l\)stat' linux/*/syscallent*
> 
> Should these be updated with their corresponding tags ?
> fstatfs*-> TD
> lstat*-> TD
> {,old_}stat*-> TF
> or are they intensional?
Most probably these compatibility calls has been overlooked. As they are
has the same semantics, they indeed should be a part of appropriate
syscall groups.

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: [PATCH v6] Implement -e trace=%statfs option for tracing statfs like syscalls

2017-03-21 Thread Eugene Syromyatnikov
On Sun, Mar 19, 2017 at 11:30:01AM +0530, Abhishek Tiwari wrote:
> Please review patch for bug in previous reply.
> 
> On Sun, Mar 19, 2017 at 6:11 AM, Dmitry V. Levin  wrote:
> > On Sat, Mar 18, 2017 at 08:29:46PM +0530, Abhishek Tiwari wrote:
> > [...]
> >> +done << EOF
> >> +17 statfs
> >
> > Please add a test for statfs64 here as well.
> 
> 
> Sir,
> the statfs64.test file calls the statfs.test itself.
> On adding 17 statfs64 to my test file gives error
> 
> undefined: __NR_statfs64
This is quite possible on 64-bit architectures, as they have no need in
a separate syscall for retrieving some 64-bit values (like st_size and
st_blocks).

> Is adding following entries correct ?
Not really.

> In file tests/scno.h:
> 
> #ifndef __NR_statfs
> # define __NR_statfs64 (SYSCALL_BIT | 332 )
Note that this file is generated (as it is stated in its header), as it
is ABI-dependent.

> Is adding it to last entry fine ?
> 
> In file tests/ksysent.h:
> 
> #ifdef __NR_statfs
> [__NR_statfs64 & 0x] = "statfs64",
> 

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: [PATCH v4] Implemented -e trace=%clock option

2017-03-21 Thread Eugene Syromyatnikov
On Sun, Mar 19, 2017 at 07:37:22AM +0530, Rishi Bhatt wrote:
> On Sun, Mar 19, 2017 at 6:34 AM, Dmitry V. Levin  wrote:
> > > From: Rishi Bhatt 
> > > Subject: [PATCH v4] Implemented -e trace=%clock option
> >
> > v4? Again?
> >
> 
> So which one is it?
Judging by the amount of patches sent, it's more like v8. But I think
Dmitry refers to the fact that you had already sent e-mail which had subject
"[PATCH v4] Implemented..."

Also, regarding the subject, in strace project traditionally commit message
should be phrased as a sentence in active voice, present simple tense.

> > > +#define TRACE_CLOCK  02  /*Trace clock-related syscalls. */
> >
> > Unfortunately, I have to repeat myself:
> >
> > "Please follow the style used in the file you are patching,
> > in particular, the style of comments."
> >
> 
> In clock.test,and any other file?
In clock.test and any other file. I assume Dmitry refers to absence of
space character before the start of comment body.

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: [PATCH 1/2] Add ioctl namespace entries from Linux 4.11

2017-03-18 Thread Eugene Syromyatnikov
On Sat, Mar 18, 2017 at 07:47:46PM +0700, Nikolay Marchuk wrote:

git am applies this mail as a single commit, it this behaviour intended?

It also (still) does not contain a summary of changes, as I noted
yesterday.

The compilation warnings and dubious rc check noted in the previous e-mail are
still present.

> ---
>  linux/32/ioctls_inc_align16.h | 2 ++
>  linux/32/ioctls_inc_align32.h | 2 ++
>  linux/32/ioctls_inc_align64.h | 2 ++
>  linux/64/ioctls_inc.h | 2 ++
>  linux/x32/ioctls_inc0.h   | 2 ++
>  5 files changed, 10 insertions(+)
> 
> diff --git a/linux/32/ioctls_inc_align16.h b/linux/32/ioctls_inc_align16.h
> index 71c9d18..4e90801 100644
> --- a/linux/32/ioctls_inc_align16.h
> +++ b/linux/32/ioctls_inc_align16.h
> @@ -1455,6 +1455,8 @@
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c, 
> 0x10 },
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18 },
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 0x08 },
> +{ "linux/nsfs.h", "NS_GET_NSTYPE", _IOC_NONE, 0xb703, 0x00 },
> +{ "linux/nsfs.h", "NS_GET_OWNER_UID", _IOC_NONE, 0xb704, 0x00 },
>  { "linux/nsfs.h", "NS_GET_PARENT", _IOC_NONE, 0xb702, 0x00 },
>  { "linux/nsfs.h", "NS_GET_USERNS", _IOC_NONE, 0xb701, 0x00 },
>  { "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN_CMD", _IOC_READ|_IOC_WRITE, 
> 0x4e41, 0x48 },
> diff --git a/linux/32/ioctls_inc_align32.h b/linux/32/ioctls_inc_align32.h
> index 699eb90..4fcada1 100644
> --- a/linux/32/ioctls_inc_align32.h
> +++ b/linux/32/ioctls_inc_align32.h
> @@ -1455,6 +1455,8 @@
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c, 
> 0x10 },
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18 },
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 0x08 },
> +{ "linux/nsfs.h", "NS_GET_NSTYPE", _IOC_NONE, 0xb703, 0x00 },
> +{ "linux/nsfs.h", "NS_GET_OWNER_UID", _IOC_NONE, 0xb704, 0x00 },
>  { "linux/nsfs.h", "NS_GET_PARENT", _IOC_NONE, 0xb702, 0x00 },
>  { "linux/nsfs.h", "NS_GET_USERNS", _IOC_NONE, 0xb701, 0x00 },
>  { "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN_CMD", _IOC_READ|_IOC_WRITE, 
> 0x4e41, 0x48 },
> diff --git a/linux/32/ioctls_inc_align64.h b/linux/32/ioctls_inc_align64.h
> index fcd9d8c..3734082 100644
> --- a/linux/32/ioctls_inc_align64.h
> +++ b/linux/32/ioctls_inc_align64.h
> @@ -1455,6 +1455,8 @@
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c, 
> 0x10 },
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18 },
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 0x08 },
> +{ "linux/nsfs.h", "NS_GET_NSTYPE", _IOC_NONE, 0xb703, 0x00 },
> +{ "linux/nsfs.h", "NS_GET_OWNER_UID", _IOC_NONE, 0xb704, 0x00 },
>  { "linux/nsfs.h", "NS_GET_PARENT", _IOC_NONE, 0xb702, 0x00 },
>  { "linux/nsfs.h", "NS_GET_USERNS", _IOC_NONE, 0xb701, 0x00 },
>  { "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN_CMD", _IOC_READ|_IOC_WRITE, 
> 0x4e41, 0x48 },
> diff --git a/linux/64/ioctls_inc.h b/linux/64/ioctls_inc.h
> index f59fe11..b75abec 100644
> --- a/linux/64/ioctls_inc.h
> +++ b/linux/64/ioctls_inc.h
> @@ -1455,6 +1455,8 @@
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c, 
> 0x10 },
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18 },
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 0x08 },
> +{ "linux/nsfs.h", "NS_GET_NSTYPE", _IOC_NONE, 0xb703, 0x00 },
> +{ "linux/nsfs.h", "NS_GET_OWNER_UID", _IOC_NONE, 0xb704, 0x00 },
>  { "linux/nsfs.h", "NS_GET_PARENT", _IOC_NONE, 0xb702, 0x00 },
>  { "linux/nsfs.h", "NS_GET_USERNS", _IOC_NONE, 0xb701, 0x00 },
>  { "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN_CMD", _IOC_READ|_IOC_WRITE, 
> 0x4e41, 0x48 },
> diff --git a/linux/x32/ioctls_inc0.h b/linux/x32/ioctls_inc0.h
> index 46303d1..81dd21c 100644
> --- a/linux/x32/ioctls_inc0.h
> +++ b/linux/x32/ioctls_inc0.h
> @@ -1455,6 +1455,8 @@
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c, 
> 0x10 },
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18 },
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 0x08 },
> +{ "linux/nsfs.h", "NS_GET_NSTYPE", _IOC_NONE, 0xb703, 0x00 },
> +{ "linux/nsfs.h", "NS_GET_OWNER_UID", _IOC_NONE, 0xb704, 0x00 },
>  { "linux/nsfs.h", "NS_GET_PARENT", _IOC_NONE, 0xb702, 0x00 },
>  { "linux/nsfs.h", "NS_GET_USERNS", _IOC_NONE, 0xb701, 0x00 },
>  { "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN_CMD", _IOC_READ|_IOC_WRITE, 
> 0x4e41, 0x48 },
> -- 
> 2.1.4
> 
> 
> >From c9d54f099021f69ead791da8c5a533f14bb40a8a Mon Sep 17 00:00:00 2001
> From: Nikolay Marchuk 
> Date: Sat, 18 Mar 2017 19:23:06 +0700
> Subject: [PATCH 2/2] Implemented parser for NS_* ioctl commands.
> 
> ---
>  Makefile.am   |   1 +
>  configure.ac  |   1 +
>  defs.h|   1 +
>  ioctl.c   |   2 +
>  nsfs.c|  94 
>  tests/.gitignore  

Re: Q: statfs related syscalls (was: Re: GSOC: Introduction)

2017-03-18 Thread Eugene Syromyatnikov
On Sat, Mar 18, 2017 at 05:57:39PM +0530, Abhishek Tiwari wrote:
> On Sat, Mar 18, 2017 at 3:53 PM, Eugene Syromyatnikov  
> wrote:
> 
> > So, after some thinking, I have the following scheme in mind:
> >
> > {old,}stat{,64} TRACE_STAT  TST
> %stat
> 
> > {old,}lstat{,64}TRACE_LSTAT TLST
> %lstat
> > {old,new,}fstat{,at}64  TRACE_FSTAT TFST
> %fstat
> 
> > {old,new,}{,l,f}stat{,x,at}{,64}
> > TRACE_STAT_LIKE TSTA ("stat alike")
> %%stat
> 
> > statfs{,64} TRACE_STATFSTSF
> %statfs
> 
> > fstatfs{,64}TRACE_FSTATFS   TFSF
> 
> %fstatfs
> > {,f}statfs{,64}, ustat  TRACE_STATFS_LIKE   TSFA ("statfs alike")
> >
> %%statfs
> 
> > Calls with bsd43_/osf_/posix_/svr4_/sysv_ prefixes go to the
> > corresponding calls without them.
> >
> > I'm not really sure about {svr4,sysv}_{,f}statvfs, but they are decoded as
> > printargs and looks like they should be related to {,f}statfs calls.
> >
> > Does it make any sense?
> 
> Yes, it looks good...:)
> Please review that for the corresponding option in -e trace=option is
> marked correct described after each of your naming scheme.
Looks good to me.

>  Thank you.
> 
> Below is attached a patch corresonding to -e trace=%statfs option.
> Please review.

git am patch fails to apply this patch with the following diagnostics:

.git/rebase-apply/patch:778: trailing whitespace.
17 statfs 
fatal: 1 line adds whitespace errors.

> From 6d7a5793808fd78db028985e8de68168ef4870c3 Mon Sep 17 00:00:00 2001
> From: Abhishek Tiwari 
> Date: Sat, 18 Mar 2017 17:29:34 +0530
> Subject: [PATCH v5] Implement -e trace=%statfs option for tracing statfs like
>  syscalls
> 
> This commit adds %statsfs option to trace statfs, statfs64, statvfs, 
> statvfs64 syscalls. The following commands update linux/*/syscallent* files:
> 
>   git grep -Fl 'statfs' linux/*/syscallent* | xargs sed -i 
> 's/TD\(,[[:space:]]*SEN(statfs\)/TD|TSF\1/'
>   git grep -Fl 'statfs' linux/*/syscallent* | xargs sed -i 
> 's/TF\(,[[:space:]]*SEN(statfs\)/TF|TSF\1/'
>   git grep -Fl 'statfs' linux/*/syscallent* | xargs sed -i 
> 's/0\(,[[:space:]]*SEN(osf_statfs\)/TSF\1/'
>   git grep -Fl 'statfs' linux/*/syscallent* | xargs sed -i 
> 's/0\(,[[:space:]]*SEN(.*_statfs\)/TSF\1/'
>   git grep -Fl 'statvfs' linux/*/syscallent* | xargs sed -i 
> 's/0\(,[[:space:]]*SEN(.*_statvfs\)/TSF\1/'
> 
> * sysent.h (TRACE_STATFS): New definition.
> * syscall.c: Alias TSF to TRACE_STATFS around syscallent.h inclusion.
> * linux/32/syscallent.h: Add TSF flag for statfs-like sycalls.
> * linux/64/syscallent.h: Likewise.
> * linux/aarch64/syscallent.h: Likewise.
> * linux/alpha/syscallent.h: Likewise.
> * linux/arm/syscallent.h: Likewise.
> * linux/avr32/syscallent.h: Likewise.
> * linux/bfin/syscallent.h: Likewise.
> * linux/crisv10/syscallent.h: Likewise.
> * linux/hppa/syscallent.h: Likewise.
> * linux/i386/syscallent.h: Likewise.
> * linux/ia64/syscallent.h: Likewise.
> * linux/m68k/syscallent.h: Likewise.
> * linux/microblaze/syscallent.h: Likewise.
> * linux/mips/syscallent-compat.h: Likewise.
> * linux/mips/syscallent-n32.h: Likewise.
> * linux/mips/syscallent-n64.h: Likewise.
> * linux/mips/syscallent-o32.h: Likewise.
> * linux/powerpc/syscallent.h: Likewise.
> * linux/powerpc64/syscallent.h: Likewise.
> * linux/s390/syscallent.h: Likewise.
> * linux/s390x/syscallent.h: Likewise.
> * linux/sh/syscallent.h: Likewise.
> * linux/sh64/syscallent.h: Likewise.
> * linux/sparc/syscallent.h: Likewise.
> * linux/sparc64/syscallent.h: Likewise.
> * linux/x32/syscallent.h: Likewise.
> * linux/x86_64/syscallent.h: Likewise.
> * linux/xtensa/syscallent.h: Likewise.
> * qualify.c (lookup_class): Add SCHED_STATFS for "%statfs"
> * strace.1 (.SS Filtering): Add information about %statfs syscall class.
> * tests/Makefile.am: (DECODER_TESTS): Add trace_statfs.test.
> * tests/ksysent.c: Define TST to 0.
> * tests/nsyscalls.c: Likewise.
> * tests/trace_statfs.test: New test.
> ---
>  linux/32/syscallent.h  |  2 +-
>  linux/64/syscallent.h  |  2 +-
>  linux/aarch64/syscallent.h |  2 +-
>  linux/alpha/syscallent.h   |  6 ++---
>  linux/arm/syscallent.h |  4 ++--
>  linux/avr32/syscallent.h   |  4 ++--
>  linux/bfin/syscallent.h|  4 ++--
>  linux/crisv10/syscallent.h |  4 ++--
>  linux/hppa/syscallent.h|  4 ++--
>  linux/i386/syscallent.h 

Re: [PATCH] Implemented parser for NS_* ioctl commands.

2017-03-18 Thread Eugene Syromyatnikov
Please avoid using mail clients which break formatting. This patch does
not apply.

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: [PATCH] Implemented parser for NS_* ioctl commands.

2017-03-18 Thread Eugene Syromyatnikov
This patch does not apply with the following diagnostics:

fatal: corrupt patch at line 15
error: could not build fake ancestor
Patch failed at 0001 Add ioctl namespace entries from Linux 4.11

then,

error: patch failed: Makefile.am:172
error: Makefile.am: patch does not apply
error: patch failed: configure.ac:366
error: configure.ac: patch does not apply
error: patch failed: ioctl.c:280
error: ioctl.c: patch does not apply
error: patch failed: tests/Makefile.am:184
error: tests/Makefile.am: patch does not apply


On Sat, Mar 18, 2017 at 03:55:46PM +0700, Nikolay Marchuk wrote:
> >From 33d0341f2705e067b7617a6ec30e442d707714d0 Mon Sep 17 00:00:00 2001
> From: Nikolay Marchuk 
> Date: Thu, 16 Mar 2017 17:49:25 +0700
> Subject: [PATCH 1/2] Add ioctl namespace entries from Linux 4.11
> 
> ---
>  linux/32/ioctls_inc_align16.h | 2 ++
>  linux/32/ioctls_inc_align32.h | 2 ++
>  linux/32/ioctls_inc_align64.h | 2 ++
>  linux/64/ioctls_inc.h | 2 ++
>  linux/x32/ioctls_inc0.h   | 2 ++
>  5 files changed, 10 insertions(+)
> 
> diff --git a/linux/32/ioctls_inc_align16.h b/linux/32/ioctls_inc_align16.h
> index 71c9d18..4e90801 100644
> --- a/linux/32/ioctls_inc_align16.h
> +++ b/linux/32/ioctls_inc_align16.h
> @@ -1455,6 +1455,8 @@
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c,
> 0x10 },
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18
> },
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 0x08 },
> +{ "linux/nsfs.h", "NS_GET_NSTYPE", _IOC_NONE, 0xb703, 0x00 },
> +{ "linux/nsfs.h", "NS_GET_OWNER_UID", _IOC_NONE, 0xb704, 0x00 },
>  { "linux/nsfs.h", "NS_GET_PARENT", _IOC_NONE, 0xb702, 0x00 },
>  { "linux/nsfs.h", "NS_GET_USERNS", _IOC_NONE, 0xb701, 0x00 },
>  { "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN_CMD", _IOC_READ|_IOC_WRITE,
> 0x4e41, 0x48 },
> diff --git a/linux/32/ioctls_inc_align32.h b/linux/32/ioctls_inc_align32.h
> index 699eb90..4fcada1 100644
> --- a/linux/32/ioctls_inc_align32.h
> +++ b/linux/32/ioctls_inc_align32.h
> @@ -1455,6 +1455,8 @@
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c,
> 0x10 },
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18
> },
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 0x08 },
> +{ "linux/nsfs.h", "NS_GET_NSTYPE", _IOC_NONE, 0xb703, 0x00 },
> +{ "linux/nsfs.h", "NS_GET_OWNER_UID", _IOC_NONE, 0xb704, 0x00 },
>  { "linux/nsfs.h", "NS_GET_PARENT", _IOC_NONE, 0xb702, 0x00 },
>  { "linux/nsfs.h", "NS_GET_USERNS", _IOC_NONE, 0xb701, 0x00 },
>  { "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN_CMD", _IOC_READ|_IOC_WRITE,
> 0x4e41, 0x48 },
> diff --git a/linux/32/ioctls_inc_align64.h b/linux/32/ioctls_inc_align64.h
> index fcd9d8c..3734082 100644
> --- a/linux/32/ioctls_inc_align64.h
> +++ b/linux/32/ioctls_inc_align64.h
> @@ -1455,6 +1455,8 @@
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c,
> 0x10 },
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18
> },
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 0x08 },
> +{ "linux/nsfs.h", "NS_GET_NSTYPE", _IOC_NONE, 0xb703, 0x00 },
> +{ "linux/nsfs.h", "NS_GET_OWNER_UID", _IOC_NONE, 0xb704, 0x00 },
>  { "linux/nsfs.h", "NS_GET_PARENT", _IOC_NONE, 0xb702, 0x00 },
>  { "linux/nsfs.h", "NS_GET_USERNS", _IOC_NONE, 0xb701, 0x00 },
>  { "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN_CMD", _IOC_READ|_IOC_WRITE,
> 0x4e41, 0x48 },
> diff --git a/linux/64/ioctls_inc.h b/linux/64/ioctls_inc.h
> index f59fe11..b75abec 100644
> --- a/linux/64/ioctls_inc.h
> +++ b/linux/64/ioctls_inc.h
> @@ -1455,6 +1455,8 @@
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c,
> 0x10 },
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18
> },
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 0x08 },
> +{ "linux/nsfs.h", "NS_GET_NSTYPE", _IOC_NONE, 0xb703, 0x00 },
> +{ "linux/nsfs.h", "NS_GET_OWNER_UID", _IOC_NONE, 0xb704, 0x00 },
>  { "linux/nsfs.h", "NS_GET_PARENT", _IOC_NONE, 0xb702, 0x00 },
>  { "linux/nsfs.h", "NS_GET_USERNS", _IOC_NONE, 0xb701, 0x00 },
>  { "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN_CMD", _IOC_READ|_IOC_WRITE,
> 0x4e41, 0x48 },
> diff --git a/linux/x32/ioctls_inc0.h b/linux/x32/ioctls_inc0.h
> index 46303d1..81dd21c 100644
> --- a/linux/x32/ioctls_inc0.h
> +++ b/linux/x32/ioctls_inc0.h
> @@ -1455,6 +1455,8 @@
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c,
> 0x10 },
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18
> },
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 0x08 },
> +{ "linux/nsfs.h", "NS_GET_NSTYPE", _IOC_NONE, 0xb703, 0x00 },
> +{ "linux/nsfs.h", "NS_GET_OWNER_UID", _IOC_NONE, 0xb704, 0x00 },
>  { "linux/nsfs.h", "NS_GET_PARENT", _IOC_NONE, 0xb702, 0x00 },
>  { "linux/nsfs.h", "NS_GET_USERNS", _IOC_NONE, 0xb701, 0x00 },
>  { "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN_CMD", _IOC_READ|_IOC

Re: Q: statfs related syscalls (was: Re: GSOC: Introduction)

2017-03-18 Thread Eugene Syromyatnikov
On Sat, Mar 18, 2017 at 02:49:48PM +0530, Abhishek Tiwari wrote:
> Going with the above description for narrow statfs->
> 
> Is naming %statfs = statfs+statfs64 as TRACE_NSTATFS and shorthand as TNS 
> fine ?

So, after some thinking, I have the following scheme in mind:

{old,}stat{,64} TRACE_STAT  TST
{old,}lstat{,64}TRACE_LSTAT TLST
{old,new,}fstat{,at}64  TRACE_FSTAT TFST
{old,new,}{,l,f}stat{,x,at}{,64}
TRACE_STAT_LIKE TSTA ("stat alike")
statfs{,64} TRACE_STATFSTSF
fstatfs{,64}TRACE_FSTATFS   TFSF
{,f}statfs{,64}, ustat  TRACE_STATFS_LIKE   TSFA ("statfs alike")

Calls with bsd43_/osf_/posix_/svr4_/sysv_ prefixes go to the
corresponding calls without them.

I'm not really sure about {svr4,sysv}_{,f}statvfs, but they are decoded as
printargs and looks like they should be related to {,f}statfs calls.

Does it make any sense?

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: [PATCH v6] Implement decoding of statx syscall

2017-03-18 Thread Eugene Syromyatnikov
On Fri, Mar 17, 2017 at 08:08:29PM +0300, Victor Krapivensky wrote:
<...>
> --- /dev/null
> +++ b/statx.c
> @@ -0,0 +1,111 @@
> +/*
> + * Copyright (c) 2017 The strace developers.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + * 1. Redistributions of source code must retain the above copyright
> + *notice, this list of conditions and the following disclaimer.
> + * 2. Redistributions in binary form must reproduce the above copyright
> + *notice, this list of conditions and the following disclaimer in the
> + *documentation and/or other materials provided with the distribution.
> + * 3. The name of the author may not be used to endorse or promote products
> + *derived from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
> + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
> + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
> + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
> + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
> + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> + */
> +
> +#include "defs.h"
> +#include "statx.h"
> +
> +#include 
> +
> +#include "xlat/statx_masks.h"
> +#include "xlat/statx_attrs.h"
> +#include "xlat/at_statx_sync_types.h"
> +
> +SYS_FUNC(statx)
> +{
> + if (entering(tcp)) {
> + print_dirfd(tcp, tcp->u_arg[0]);
> + printpath(tcp, tcp->u_arg[1]);
> + tprints(", ");
> + if (printflags(at_flags, tcp->u_arg[2] & ~AT_STATX_SYNC_TYPE,
> +NULL))
> + {
> + tprints("|");
I haven't look at v7 of the patch yet, but coverage [1] shows that at least
this line is not covered by the test.

> + }
> + printxval(at_statx_sync_types,
> +   tcp->u_arg[2] & AT_STATX_SYNC_TYPE, "AT_STATX_???");
> + tprints(", ");
> + printflags(statx_masks, tcp->u_arg[3], "STATX_???");
> + tprints(", ");
> + } else {
> +#define PRINT_FIELD_U(field) \
> + tprintf(", %s=%llu", #field, (unsigned long long) stx.field)
> +
> +#define PRINT_FIELD_TIME(field)  
> \
> + do {\
> + tprints(", " #field "=");   \
> + tprints(sprinttime(stx.field.sec)); \
> + if (stx.field.nsec) \
Only one branch in regards of of stx.field.nsec value is covered in all
instances of this macro.

> + tprintf(".%09" PRId32, stx.field.nsec); \
> + } while (0)
> +
> + struct_statx stx;
> + if (umove_or_printaddr(tcp, tcp->u_arg[4], &stx)) {
> + return 0;
> + }
> +
> + tprints("{stx_mask=");
> + printflags(statx_masks, stx.stx_mask, "STATX_???");
> +
> + if (!abbrev(tcp)) {
Only branch with abbrev(tcp) == 0 is covered.

> + PRINT_FIELD_U(stx_blksize);
> + }
> +
> + tprints(", stx_attributes=");
> + printflags(statx_attrs, stx.stx_attributes, "STATX_ATTR_???");
> +
> + if (!abbrev(tcp)) {
> + PRINT_FIELD_U(stx_nlink);
> + printuid(", stx_uid=", stx.stx_uid);
> + printuid(", stx_gid=", stx.stx_gid);
> + }
> +
> + tprints(", stx_mode=");
> + print_symbolic_mode_t(stx.stx_mode);
> +
> + if (!abbrev(tcp)) {
> + PRINT_FIELD_U(stx_ino);
> + }
> +
> + PRINT_FIELD_U(stx_size);
> +
> + if (!abbrev(tcp)) {
> + PRINT_FIELD_U(stx_blocks);
> + PRINT_FIELD_TIME(stx_atime);
> + PRINT_FIELD_TIME(stx_btime);
> + PRINT_FIELD_TIME(stx_ctime);
> + PRINT_FIELD_TIME(stx_mtime);
> + PRINT_FIELD_U(stx_rdev_major);
> + PRINT_FIELD_U(stx_rdev_minor);
> + PRINT_FIELD_U(stx_dev_major);
> + PRINT_FIELD_U(stx_dev_minor);
> + } else {
> + tprints(", ...");
... and this one, but this is a common problem of all current *stat*
checks.


Re: Q: statfs related syscalls (was: Re: GSOC: Introduction)

2017-03-18 Thread Eugene Syromyatnikov
On Thu, Mar 16, 2017 at 12:24 AM, Dmitry V. Levin  wrote:
> On Wed, Mar 15, 2017 at 11:14:29PM +0530, Abhishek Tiwari wrote:
> [...]
>> Is it fine to group statfs+ statfs64+ fstatfs + fstatfs64 + ustat  as
>> %statfs or it should be (statfs+statfs64 + ustat) and
>> (fstatfs+ftsatfs64) i.e. two different classes ?
>
> Well, I don't have a ready answer to this question.
>
> From one side, three narrow classes (%statfs == statfs+statfs64,
> %fstatfs == fstatfs+fstatfs64, and ustat itself) would be a finer
> instrument than a single wide class.  I'm not sure whether narrow statfs
> classes will be of any practical use, though.  If we've choosen this
> approach, we could use, say, %allstatfs as a name for the wide class.
>
> From another side, a single wide class is simpler to use.
> However, once %statfs is taken for the wide class, it wouldn't be easy to
> find a good alternative name if someday we decide to create narrow
> classes.
>
> Does anybody else have an opinion on this?

Since both wide and narrow syscall classes have they own use cases, it
makes sense to support both. Dmitry has suggested %%statfs designation
for a wide syscall class, and to me it looks like not a bad idea.

>
> --
> ldv
>
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Strace-devel mailing list
> Strace-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/strace-devel
>



-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: GSOC: Introduction

2017-03-17 Thread Eugene Syromyatnikov
On Thu, Mar 16, 2017 at 10:07:27PM +0530, Abhishek Tiwari wrote:
> From 38ea98c7ba87bc485d8af34fc401f46b05b2c035 Mon Sep 17 00:00:00 2001
> From: Abhishek Tiwari 
> Date: Thu, 16 Mar 2017 16:55:44 +0530
> Subject: [PATCH v4] Implement -e trace=%statfs option for tracing statfs like 
> syscalls.
> 
>   linux/*/syscallent.h part is modified automatically by:
> 
>   git grep -Fl 'statfs' linux/*/syscallent* | xargs sed -i 
> 's/TD\(,[[:space:]]*SEN(statfs\)/TD|SFS\1/'
>   git grep -Fl 'statfs' linux/*/syscallent* | xargs sed -i 
> 's/TF\(,[[:space:]]*SEN(statfs\)/TF|SFS\1/'
>   git grep -Fl 'statfs' linux/*/syscallent* | xargs sed -i 
> 's/0\(,[[:space:]]*SEN(osf_statfs\)/SFS\1/'
>   git grep -Fl 'statfs' linux/*/syscallent* | xargs sed -i 
> 's/0\(,[[:space:]]*SEN(.*_statfs\)/SFS\1/'
>   git grep -Fl 'ustat' linux/*/syscallent* | xargs sed -i 
> 's/0\(,[[:space:]]*SEN(.*_ustat\)/SFS\1/'
> 
> * linux/32/syscallent.h: Add SFS flag for stat-like sycalls.
"T" in these shorthand flags is for "trace", maybe it is a good idea to
follow this convention. On the other side, if blindly follow this rule, size of
shorthand would be gargantuan 4 chars.

Also, from my point of view, it's quite strange to include ustat and do
not include fstatfs, since, well, they are equivalently similar to statfs.

> * linux/64/syscallent.h: Likewise.
> * linux/aarch64/syscallent.h: Likewise.
> * linux/alpha/syscallent.h: Likewise.
> * linux/arm/syscallent.h: Likewise.
> * linux/avr32/syscallent.h: Likewise.
> * linux/bfin/syscallent.h: Likewise.
> * linux/crisv10/syscallent.h: Likewise.
> * linux/hppa/syscallent.h: Likewise.
> * linux/i386/syscallent.h: Likewise.
> * linux/ia64/syscallent.h: Likewise.
> * linux/m68k/syscallent.h: Likewise.
> * linux/microblaze/syscallent.h: Likewise.
> * linux/mips/syscallent-compat.h: Likewise.
> * linux/mips/syscallent-n32.h: Likewise.
> * linux/mips/syscallent-n64.h: Likewise.
> * linux/mips/syscallent-o32.h: Likewise.
> * linux/powerpc/syscallent.h: Likewise.
> * linux/powerpc64/syscallent.h: Likewise.
> * linux/s390/syscallent.h: Likewise.
> * linux/s390x/syscallent.h: Likewise.
> * linux/sh/syscallent.h: Likewise.
> * linux/sh64/syscallent.h: Likewise.
> * linux/sparc/syscallent.h: Likewise.
> * linux/sparc64/syscallent.h: Likewise.
> * linux/x32/syscallent.h: Likewise.
> * linux/x86_64/syscallent.h: Likewise.
> * linux/xtensa/syscallent.h: Likewise.
> * qualify.c (lookup_class): Add SCHED_STAT for "%statfs".
> * strace.1 (.SS Filtering): Add information about %statfs syscall class.
> * syscall.c: Alias SFS to TRACE_STATFS around syscallent.h inclusion.
> * sysent.h (TRACE_STATFS): New definition.
> * tests/Makefile.am (DECODER_TESTS): Add trace_statfs.test.
> * tests/ksysent.c: Define SFS to 0.
> * tests/nsyscalls.c: Likewise.
> * tests/trace_statfs.test: New test.
> ---
>  linux/32/syscallent.h  |  2 +-
>  linux/64/syscallent.h  |  2 +-
>  linux/aarch64/syscallent.h |  4 +--
>  linux/alpha/syscallent.h   |  8 +++---
>  linux/arm/syscallent.h |  6 ++---
>  linux/avr32/syscallent.h   |  6 ++---
>  linux/bfin/syscallent.h|  6 ++---
>  linux/crisv10/syscallent.h |  6 ++---
>  linux/hppa/syscallent.h|  6 ++---
>  linux/i386/syscallent.h|  6 ++---
>  linux/ia64/syscallent.h|  6 ++---
>  linux/m68k/syscallent.h|  6 ++---
>  linux/microblaze/syscallent.h  |  6 ++---
>  linux/mips/syscallent-compat.h |  8 +++---
>  linux/mips/syscallent-n32.h|  6 ++---
>  linux/mips/syscallent-n64.h|  4 +--
>  linux/mips/syscallent-o32.h|  6 ++---
>  linux/powerpc/syscallent.h |  6 ++---
>  linux/powerpc64/syscallent.h   |  6 ++---
>  linux/s390/syscallent.h|  6 ++---
>  linux/s390x/syscallent.h   |  6 ++---
>  linux/sh/syscallent.h  |  6 ++---
>  linux/sh64/syscallent.h|  6 ++---
>  linux/sparc/syscallent.h   |  6 ++---
>  linux/sparc64/syscallent.h |  6 ++---
>  linux/x32/syscallent.h |  4 +--
>  linux/x86_64/syscallent.h  |  4 +--
>  linux/xtensa/syscallent.h  |  6 ++---
>  qualify.c  |  1 +
>  strace.1   |  3 +++
>  syscall.c  |  2 ++
>  sysent.h   |  1 +
>  tests/Makefile.am  |  1 +
>  tests/ksysent.c|  1 +
>  tests/nsyscalls.c  |  1 +
>  tests/trace_statfs.test| 55 
> ++
>  36 files changed, 143 insertions(+), 78 deletions(-)
>  create mode 100755 tests/trace_statfs.test
> 
> diff --git a/linux/32/syscallent.h b/linux/32/syscallent.h
> index a8f9510..72a3ebe 100644
> --- a/linux/32/syscallent.h
> +++ b/linux/32/syscallent.h
> @@ -44,7 +44,7 @@
>  [ 40] = { 5, TF, SEN(mount), "mount" 
> },
>  [ 41] = { 2, TF, SEN(pivotroot), "pivot_root"
> },
>  [ 42] = { 3, 0,  SEN(nfsservctl),   

Re: [PATCH v6] Implement decoding of statx syscall

2017-03-17 Thread Eugene Syromyatnikov
On Fri, Mar 17, 2017 at 08:08:29PM +0300, Victor Krapivensky wrote:
> * linux/i386/syscallent.h [383]: Add statx entry.
> * linux/x32/syscallent.h [332]: Likewise.
> * linux/x86_64/syscallent.h [332]: Likewise.
> * pathtrace.c (pathtrace_match): Handle SEN_statx.
> * statx.c: New file.
> * statx.h: Likewise.
> * Makefile.am (strace_SOURCES): Add them.
> * tests/.gitignore: Add statx.
> * tests/Makefile.am (check_PROGRAMS): Likewise.
> (DECODER_TESTS): Add statx.test.
> * tests/statx.c: New file.
> * tests/statx.test: Likewise.
> * tests/xstatx.c: Modify to support statx.
> * xlat/at_statx_sync_types.in: New file.
> * xlat/statx_attrs.in: Likewise.
> * xlat/statx_masks.in: Likewise.
> * NEWS: Mention this change.
> ---
>  Makefile.am |   2 +
>  NEWS|   1 +
>  linux/i386/syscallent.h |   1 +
>  linux/x32/syscallent.h  |   3 +-
>  linux/x86_64/syscallent.h   |   1 +
>  pathtrace.c |   1 +
>  statx.c | 111 ++
>  statx.h |  69 
>  tests/.gitignore|   1 +
>  tests/Makefile.am   |   2 +
>  tests/statx.c   |  70 +
>  tests/statx.test|   5 ++
>  tests/xstatx.c  | 188 
> 
>  xlat/at_statx_sync_types.in |   5 ++
>  xlat/statx_attrs.in |   6 ++
>  xlat/statx_masks.in |  15 
>  16 files changed, 465 insertions(+), 16 deletions(-)
>  create mode 100644 statx.c
>  create mode 100644 statx.h
>  create mode 100644 tests/statx.c
>  create mode 100755 tests/statx.test
>  create mode 100644 xlat/at_statx_sync_types.in
>  create mode 100644 xlat/statx_attrs.in
>  create mode 100644 xlat/statx_masks.in
> 
> diff --git a/Makefile.am b/Makefile.am
> index 7e837b3..65177a6 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -232,6 +232,8 @@ strace_SOURCES =  \
>   stat64.c\
>   statfs.c\
>   statfs.h\
> + statx.c \
> + statx.h \
>   strace.c\
>   swapon.c\
>   syscall.c   \
> diff --git a/NEWS b/NEWS
> index 77b6678..b2bb644 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -9,6 +9,7 @@ Noteworthy changes in release ?.?? (-??-??)
>  * Improvements
>* Enhanced decoding of sched_setattr syscall.
>* Added -e trace=%sched option for tracing sched_* syscalls.
> +  * Implemented decoding of statx syscall.
This hunk does not apply, please rebase to the latest version.

error: patch failed: NEWS:9
error: NEWS: patch does not apply

>  
>  * Bug fixes
>* Fixed decoding of flags argument of preadv2 and pwritev2 syscalls on x32.
> diff --git a/linux/i386/syscallent.h b/linux/i386/syscallent.h
> index 8ef1b1c..84c5bde 100644
> --- a/linux/i386/syscallent.h
> +++ b/linux/i386/syscallent.h
> @@ -408,6 +408,7 @@
>  [380] = { 4, TM|SI,  SEN(pkey_mprotect), "pkey_mprotect" 
> },
>  [381] = { 2, 0,  SEN(pkey_alloc),"pkey_alloc"
> },
>  [382] = { 1, 0,  SEN(pkey_free), "pkey_free" 
> },
> +[383] = { 5, TD|TF,  SEN(statx), "statx" 
> },
>  
>  #define SYS_socket_subcall   400
>  #include "subcall.h"
> diff --git a/linux/x32/syscallent.h b/linux/x32/syscallent.h
> index 2699bc0..7f4e45b 100644
> --- a/linux/x32/syscallent.h
> +++ b/linux/x32/syscallent.h
> @@ -330,7 +330,8 @@
>  [329] = { 4, TM|SI,  SEN(pkey_mprotect), "pkey_mprotect" 
> },
>  [330] = { 2, 0,  SEN(pkey_alloc),"pkey_alloc"
> },
>  [331] = { 1, 0,  SEN(pkey_free), "pkey_free" 
> },
> -[332 ... 511] = { },
> +[332] = { 5, TD|TF,  SEN(statx), "statx" 
> },
> +[333 ... 511] = { },
>  /*
>   * x32-specific system call numbers start at 512 to avoid cache impact
>   * for native 64-bit operation.
> diff --git a/linux/x86_64/syscallent.h b/linux/x86_64/syscallent.h
> index a1a268e..2624947 100644
> --- a/linux/x86_64/syscallent.h
> +++ b/linux/x86_64/syscallent.h
> @@ -330,3 +330,4 @@
>  [329] = { 4, TM|SI,  SEN(pkey_mprotect), "pkey_mprotect" 
> },
>  [330] = { 2, 0,  SEN(pkey_alloc),"pkey_alloc"
> },
>  [331] = { 1, 0,  SEN(pkey_free), "pkey_free" 
> },
> +[332] = { 5, TD|TF,  SEN(statx), "statx" 
> },
> diff --git a/pathtrace.c b/pathtrace.c
> index d991aed..90974f4 100644
> --- a/pathtrace.c
> +++ b/pathtrace.c
> @@ -183,6 +183,7 @@ pathtrace_match(struct tcb *tcp)
>   case SEN_newfstatat:
>   case SEN_openat:
>   case SEN_readlinkat:
> + case SEN_statx:
>   case SEN_unlinkat:
>   case SEN_utimensat:
>   /* fd, path */
> diff --git a/stat

Re: Gsoc Introduction.

2017-03-17 Thread Eugene Syromyatnikov
On Fri, Mar 17, 2017 at 06:35:09PM +0100, Eugene Syromyatnikov wrote:
> Please format function declaration as following:
> 
> int
> nsfs_ioctl(struct tcb *tcp, unsigned int code, kernel_ulong_t arg) {
Oops. Opening curly brace should be on the next line, like this:

int
nsfs_ioctl(struct tcb *tcp, unsigned int code, kernel_ulong_t arg)
{

>   if (!umove_or_printaddr(tcp, arg, &uid)) {
>   printuid(", [", uid);
>   tprints("]");
>   }
Ahem. I forgot that the comma should be also printed in case of address
printing too, so it should be written like this:

tprints(", ")
if (!umove_or_printaddr(tcp, arg, &uid)) {
printuid("[", uid);
tprints("]");
}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: Gsoc Introduction.

2017-03-17 Thread Eugene Syromyatnikov
On Fri, Mar 17, 2017 at 08:12:02AM +0700, Nikolay Marchuk wrote:
> Thank you for review. I have rewritten my code, but I still have some
> problems with NS_GET_NSTYPE parsing without additional argument. And new
> tests are not fully tested, because I haven't build kernel yet.

Please send patches inline if possible, it makes easier to review and discuss
them.

git am fails with the following diagnostics:

.git/rebase-apply/patch:268: trailing whitespace.

fatal: 1 line adds whitespace errors.


> From 8789c3c73f1ad0b260195a1a3214ff965d6f42d5 Mon Sep 17 00:00:00 2001
> From: Marchuk Nikolay 
> Date: Thu, 16 Mar 2017 17:49:25 +0700
> Subject: [PATCH 1/2] Add ioctl namespace entries from Linux 4.11
> 

Please provide a change summary in the GNU change log format. Please refer to
README-hacking and
https://www.gnu.org/prep/standards/html_node/Style-of-Change-Logs.html
for details.

> Signed-off-by: Marchuk Nikolay 

"Signed-off-by" is not used in strace project usually.

> ---
>  linux/32/ioctls_inc_align16.h | 2 ++
>  linux/32/ioctls_inc_align32.h | 2 ++
>  linux/32/ioctls_inc_align64.h | 2 ++
>  linux/64/ioctls_inc.h | 2 ++
>  linux/x32/ioctls_inc0.h   | 2 ++
>  5 files changed, 10 insertions(+)
> 
> diff --git a/linux/32/ioctls_inc_align16.h b/linux/32/ioctls_inc_align16.h
> index 71c9d18..4e90801 100644
> --- a/linux/32/ioctls_inc_align16.h
> +++ b/linux/32/ioctls_inc_align16.h
> @@ -1455,6 +1455,8 @@
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c, 
> 0x10 },
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18 },
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 0x08 },
> +{ "linux/nsfs.h", "NS_GET_NSTYPE", _IOC_NONE, 0xb703, 0x00 },
> +{ "linux/nsfs.h", "NS_GET_OWNER_UID", _IOC_NONE, 0xb704, 0x00 },
>  { "linux/nsfs.h", "NS_GET_PARENT", _IOC_NONE, 0xb702, 0x00 },
>  { "linux/nsfs.h", "NS_GET_USERNS", _IOC_NONE, 0xb701, 0x00 },
>  { "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN_CMD", _IOC_READ|_IOC_WRITE, 
> 0x4e41, 0x48 },
> diff --git a/linux/32/ioctls_inc_align32.h b/linux/32/ioctls_inc_align32.h
> index 699eb90..4fcada1 100644
> --- a/linux/32/ioctls_inc_align32.h
> +++ b/linux/32/ioctls_inc_align32.h
> @@ -1455,6 +1455,8 @@
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c, 
> 0x10 },
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18 },
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 0x08 },
> +{ "linux/nsfs.h", "NS_GET_NSTYPE", _IOC_NONE, 0xb703, 0x00 },
> +{ "linux/nsfs.h", "NS_GET_OWNER_UID", _IOC_NONE, 0xb704, 0x00 },
>  { "linux/nsfs.h", "NS_GET_PARENT", _IOC_NONE, 0xb702, 0x00 },
>  { "linux/nsfs.h", "NS_GET_USERNS", _IOC_NONE, 0xb701, 0x00 },
>  { "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN_CMD", _IOC_READ|_IOC_WRITE, 
> 0x4e41, 0x48 },
> diff --git a/linux/32/ioctls_inc_align64.h b/linux/32/ioctls_inc_align64.h
> index fcd9d8c..3734082 100644
> --- a/linux/32/ioctls_inc_align64.h
> +++ b/linux/32/ioctls_inc_align64.h
> @@ -1455,6 +1455,8 @@
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c, 
> 0x10 },
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18 },
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 0x08 },
> +{ "linux/nsfs.h", "NS_GET_NSTYPE", _IOC_NONE, 0xb703, 0x00 },
> +{ "linux/nsfs.h", "NS_GET_OWNER_UID", _IOC_NONE, 0xb704, 0x00 },
>  { "linux/nsfs.h", "NS_GET_PARENT", _IOC_NONE, 0xb702, 0x00 },
>  { "linux/nsfs.h", "NS_GET_USERNS", _IOC_NONE, 0xb701, 0x00 },
>  { "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN_CMD", _IOC_READ|_IOC_WRITE, 
> 0x4e41, 0x48 },
> diff --git a/linux/64/ioctls_inc.h b/linux/64/ioctls_inc.h
> index f59fe11..b75abec 100644
> --- a/linux/64/ioctls_inc.h
> +++ b/linux/64/ioctls_inc.h
> @@ -1455,6 +1455,8 @@
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c, 
> 0x10 },
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18 },
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 0x08 },
> +{ "linux/nsfs.h", "NS_GET_NSTYPE", _IOC_NONE, 0xb703, 0x00 },
> +{ "linux/nsfs.h", "NS_GET_OWNER_UID", _IOC_NONE, 0xb704, 0x00 },
>  { "linux/nsfs.h", "NS_GET_PARENT", _IOC_NONE, 0xb702, 0x00 },
>  { "linux/nsfs.h", "NS_GET_USERNS", _IOC_NONE, 0xb701, 0x00 },
>  { "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN_CMD", _IOC_READ|_IOC_WRITE, 
> 0x4e41, 0x48 },
> diff --git a/linux/x32/ioctls_inc0.h b/linux/x32/ioctls_inc0.h
> index 46303d1..81dd21c 100644
> --- a/linux/x32/ioctls_inc0.h
> +++ b/linux/x32/ioctls_inc0.h
> @@ -1455,6 +1455,8 @@
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c, 
> 0x10 },
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18 },
>  { "linux/nilfs2_api.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 0x08 },
> +{ "linux/nsfs.h", "NS_GET_NSTYPE", _IOC_NONE, 0xb703, 0x00 },
> +{ "linux/nsfs.h", "NS_GET_OWNER_UID", _IOC_NONE, 0xb704, 0x00 },

Re: [PATCH] Decode RUSAGE_THREAD

2017-03-15 Thread Eugene Syromyatnikov
Please do not answer in an existing thread and start a new thread for
a new separate patch.

On Wed, Mar 15, 2017 at 3:25 PM, Victor Krapivensky
 wrote:
> * xlat/usagewho.in: Add RUSAGE_THREAD.
> * tests/getrusage.c: Test decoding of RUSAGE_THREAD.
> ---
>  tests/getrusage.c | 21 +++--
>  xlat/usagewho.in  |  1 +
>  2 files changed, 16 insertions(+), 6 deletions(-)
>
> diff --git a/tests/getrusage.c b/tests/getrusage.c
> index 8b76eff..ba1a7ef 100644
> --- a/tests/getrusage.c
> +++ b/tests/getrusage.c
> @@ -25,7 +25,6 @@
>   * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
>   * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
>   */
> -
Is this intentional?

>  #include "tests.h"
>  #include 
>
> @@ -36,17 +35,16 @@
>  # include 
>  # include 
>
> -int
> -main(void)
> +int invoke_print(int who, const char *who_str, struct rusage *usage)
Please follow the same coding style (function return type on the separate line).

>  {
> -   struct rusage *const usage = tail_alloc(sizeof(struct rusage));
> -   int rc = syscall(__NR_getrusage, RUSAGE_SELF, usage);
> -   printf("getrusage(RUSAGE_SELF, {ru_utime={tv_sec=%jd, tv_usec=%jd}"
> +   int rc = syscall(__NR_getrusage, who, usage);
> +   printf("getrusage(%s, {ru_utime={tv_sec=%jd, tv_usec=%jd}"
>", ru_stime={tv_sec=%jd, tv_usec=%jd}, ru_maxrss=%lu"
>", ru_ixrss=%lu, ru_idrss=%lu, ru_isrss=%lu, ru_minflt=%lu"
>", ru_majflt=%lu, ru_nswap=%lu, ru_inblock=%lu"
>", ru_oublock=%lu, ru_msgsnd=%lu, ru_msgrcv=%lu"
>", ru_nsignals=%lu, ru_nvcsw=%lu, ru_nivcsw=%lu}) = %d\n",
> +  who_str,
>(intmax_t) usage->ru_utime.tv_sec,
>(intmax_t) usage->ru_utime.tv_usec,
>(intmax_t) usage->ru_stime.tv_sec,
> @@ -56,6 +54,17 @@ main(void)
>usage->ru_nswap, usage->ru_inblock, usage->ru_oublock,
>usage->ru_msgsnd, usage->ru_msgrcv, usage->ru_nsignals,
>usage->ru_nvcsw, usage->ru_nivcsw, rc);
> +   return rc;
> +}
> +
> +int
> +main(void)
> +{
> +   struct rusage *const usage = tail_alloc(sizeof(struct rusage));
> +   (void) invoke_print(RUSAGE_SELF, "RUSAGE_SELF", usage);
> +# ifdef RUSAGE_THREAD
> +   (void) invoke_print(RUSAGE_THREAD, "RUSAGE_THREAD", usage);
You can try to use ARG_STR() macro here in order to avoid duplication
of the symbolic name, but it's a bit obscure.

> +# endif
>
> puts("+++ exited with 0 +++");
> return 0;
> diff --git a/xlat/usagewho.in b/xlat/usagewho.in
> index e2153b3..62e7352 100644
> --- a/xlat/usagewho.in
> +++ b/xlat/usagewho.in
> @@ -1,3 +1,4 @@
>  RUSAGE_SELF
>  RUSAGE_CHILDREN
>  RUSAGE_BOTH
> +RUSAGE_THREAD
It may be a good idea to add values for these xlat values (as long as
they are arch-independent) in order to depend less on kernel headers
(there is some effort to do so, but it's inconsistent and is enforced
case-by-case basis). In this case RUSAGE_THREAD can also be tested
regardless of kernel version, but it should be considered then that
kernel could return -EINVAL in case it doesn't support it.

Otherwise, patch looks good overall.

> --
> 2.10.2
>
>
> ------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Strace-devel mailing list
> Strace-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/strace-devel



-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: Does strace support capturing session ID and process group ID?

2017-03-14 Thread Eugene Syromyatnikov
On Tue, Mar 14, 2017 at 4:42 PM, Leixiang Wu  wrote:
> Hi,
>
> I am using strace to capture system call traces of a program. I would like
> to capture session ID and process group ID. Is this possible in strace? I
> looked the man page. It doens't say anything about those two process state
> information.
As strace is a system call tracer, this functionality is quite out of
its scope[1]. One can get this information from /proc/${pid}/stat, as
proc(5) suggests:

   /proc/[pid]/stat
  Status  information  about  the  process.  This is used
by ps(1).  It is defined in the kernel
  source file fs/proc/array.c.

  The fields, in order, with their proper scanf(3) format
specifiers, are listed below.  Whether
  or  not  certain of these fields display valid
information is governed by a ptrace access mode
  PTRACE_MODE_READ_FSCREDS | PTRACE_MODE_NOAUDIT check
(refer  to  ptrace(2)).   If  the  check
  denies access, then the field value is displayed as 0.
The affected fields are indicated with
  the marking [PT].

<...>

  (5) pgrp  %d
The process group ID of the process.

  (6) session  %d
The session ID of the process.

[1] You can, however, try to capture setpgid/getpgid and setsid/getsid
syscalls, in case you are sure tracee calls these.

> Best,
> Leixiang Wu
>
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> Strace-devel mailing list
> Strace-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/strace-devel
>



-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: GSOC: Introduction

2017-03-12 Thread Eugene Syromyatnikov
> Thank you for the patch acceptance.
> Is the following list of open system calls complete ? It is based on
> reply that function calls that returns new file descriptor
>
> 1) mq_open
> 2) openat
> 3) perf_event_open
> 4) open_by_handle_at
> 5) memfd_create
> 6) epoll_create1
> 7) dup
> 8) dup3
> 9) fcntl64
> 10) timerfd_create
> 11) socket
> 12) accept
> 13) pipe2
As Dmitry reminded me, there are two interpretations; the one is quite
narrow — different architectures have both open/openat syscalls or
only one of them; %open may be used in order to track both (as old
code tends to use old one, moder uses openat and you ca never be
sure). The other one is quite wide — all syscalls that return new fd
(as I previously suggested), and in my mind the idea was to track all
new descriptors. But in this latter case, the question arises, whether
some unortodox (but quite utilised) ways of obtaining new fds, like
recvfrom or ioctl(NS_GET_PARENT, ...) or bpf(BPF_MAP_CREATE, ...)
should be covered. In my opinion, it makes the filter too complicated,
but event not considering them, there are also at least
timerfd_create, eventfd/eventfd2, inotify_init, signalfd,
fanotify_init.


-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: Implemented -e trace=%clock option

2017-03-12 Thread Eugene Syromyatnikov
> diff --git a/strace.1 b/strace.1
> index 9b69ec22..c46ca3ba 100644
> --- a/strace.1
> +++ b/strace.1
> @@ -429,6 +429,9 @@ Trace all memory mapping related system calls.
>  .BR "\-e\ trace" = %sched
>  Trace all scheduler-related (sched_*) system calls.
>  .TP
> +.BR "\-e\ trace" = %clock
> ++Trace all clock-related (clock_*) system calls.
Not sure that this plus sign in the beginning of the line is intended.

--
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: GSOC: Introduction

2017-03-12 Thread Eugene Syromyatnikov
On Sat, Mar 11, 2017 at 02:26:42PM +0530, Abhishek Tiwari wrote:
> On Sat, Mar 11, 2017 at 1:46 PM, Abhishek Tiwari
>  wrote:
> > Sir, I figured out that open system call is implemented corresponding
> > to kernel version it supports, so open syscall is inside
> > linux/x32/syscallent.h while openat is used in later versions.
> > Please verify that the open-like system call list is complete.
> >
> > Implemented -e trace=%stat class and submitting patch for the same.
> > Please review.
> > traces calls that matches following->
> > fstat*
> > stat*
> > lstat
> > ustat
> > newstat*
> 
> 
> Sorry, please ignore the previous patch. There is stat_like.test file
> left unstaged.
> Please consider following patch->
Per-file summary is not in GNU change log format, please refer to
https://www.gnu.org/prep/standards/html_node/Style-of-Change-Logs.html .
Specifically, it lacks asterisks at the beginning of each new file
description and has excess spaces between file part and description,
otherwise looks fine.

The patch wires up {,l}stat{,64}, fstatat/fstatat64 syscalls (used for obtaining
file status), ustat syscall (which is a deprecated way to get some FS
statistics) and some statfs syscalls (which are more contemporary way
obtaining FS statistics information). On the other side, at least
fstat/fstat64, fstatfs/fstatfs64, old{,f,l}stat, osf_{,f}statfs, and various
(mostly unsupported) syscalls with osf_, svr4_, sysv_, bsd43_, and posix_
prefixes, present on alpha and mips, are omitted. I'm not sure whether
it was intended.

There are minor tabulation irregularities introduced (at least) for
newfstatat and fstatat64 syscall entries, it is better to avoid this.

> From 522cf7c76cb48fad099da086148dc0b5a41d4808 Mon Sep 17 00:00:00 2001
> From: Abhishek Tiwari 
> Date: Sat, 11 Mar 2017 14:07:46 +0530
> Subject: [PATCH v2] Implement -e trace=%stat option for tracing stat like
>  syscalls.
> 
> linux/*/syscallent.h part is modified automatically by:
> 
> git grep -Fl 'SEN(stat' linux/ | xargs sed -i 
> 's/TF\(,[[:space:]]*SEN(stat\)/TF|TST\1/'
> git grep -Fl 'SEN(fstat' linux/ | xargs sed -i 
> 's/TF\(,[[:space:]]*SEN(fstat\)/TF|TST\1/'
> git grep -Fl 'SEN(lstat' linux/ | xargs sed -i 
> 's/TF\(,[[:space:]]*SEN(lstat\)/TF|TST\1/'
> git grep -Fl 'SEN(ustat' linux/ | xargs sed -i 
> 's/0\(,[[:space:]]*SEN(ustat\)/TST\1/'
> git grep -Fl 'SEN(newfstat' linux/ | xargs sed -i 
> 's/TF\(,[[:space:]]*SEN(newfstat\)/TF|TST\1/'
> 
> sysent.h (TRACE_STAT): New definition.
> syscall.c: Alias TST to TRACE_STAT around syscallent.h inclusion.
> linux/32/syscallent.h:  Add TST flag for stat-like sycalls.
> linux/64/syscallent.h:  Likewise.
> linux/aarch64/syscallent.h: Likewise.
> linux/alpha/syscallent.h:   Likewise.
> linux/arm/syscallent.h: Likewise.
> linux/avr32/syscallent.h:   Likewise.
> linux/bfin/syscallent.h:Likewise.
> linux/crisv10/syscallent.h: Likewise.
> linux/hppa/syscallent.h:Likewise.
> linux/i386/syscallent.h:Likewise.
> linux/ia64/syscallent.h:Likewise.
> linux/m68k/syscallent.h:Likewise.
> linux/microblaze/syscallent.h:  Likewise.
> linux/mips/syscallent-n32.h:Likewise.
> linux/mips/syscallent-n64.h:Likewise.
> linux/mips/syscallent-o32.h:Likewise.
> linux/powerpc/syscallent.h: Likewise.
> linux/powerpc64/syscallent.h:   Likewise.
> linux/s390/syscallent.h:Likewise.
> linux/s390x/syscallent.h:   Likewise.
> linux/sh/syscallent.h:  Likewise.
> linux/sh64/syscallent.h:Likewise.
> linux/sparc/syscallent.h:   Likewise.
> linux/sparc64/syscallent.h: Likewise.
> linux/x32/syscallent.h: Likewise.
> linux/x86_64/syscallent.h:  Likewise.
> linux/xtensa/syscallent.h:  Likewise.
> qualify.c (lookup_class):   Add SCHED_STAT for "%stat"
> strace.1 (.SS Filtering):   Add information about %sched syscall class.
> tests/Makefile.am (DECODER_TESTS): Add stat_like.test.
> tests/ksysent.c:Define TST to 0.
> tests/nsyscalls.c:  Likewise.
> tests/stat_like.test:   New test.
> ---
>  linux/32/syscallent.h |  4 +--
>  linux/64/syscallent.h |  4 +--
>  linux/aarch64/syscallent.h| 14 +--
>  linux/alpha/syscallent.h  | 14 +--
>  linux/arm/syscallent.h| 16 ++--
>  linux/avr32/syscallent.h  | 16 ++--
>  linux/bfin/syscallent.h   | 16 ++--
>  linux/crisv10/syscallent.h| 16 ++--
>  linux/hppa/syscallent.h   | 16 ++--
>  linux/i386/syscallent.h   | 16 ++--
>  linux/ia64/syscallent.h   | 16 ++--
>  linux/m68k/syscallent.h   | 16 ++--
>  linux/microblaze/syscallent.h | 16 ++--
>  linux/mips/syscallent-n32.h   | 12 -
>  linux/mips/syscallent-n64.h   | 10 
>  linux/mips/syscallent-o32.h   | 16 ++--
>  linux/powerpc/syscallent.h| 16 ++--
>  linux/powerpc64/syscallent.h  | 12 -
>  linux/s390/syscallent.h   | 16 ++--
>  lin

Re: GSoC 2017 introduction

2017-03-12 Thread Eugene Syromyatnikov
On Sat, Mar 11, 2017 at 02:51:35PM +0300, Victor Krapivensky wrote:
> Removed a trailing semicolon in a macro definition in tests/xstatx.c
> and changed copyright holders of new files to "The strace developers".
> 
> Please review this one.
> 
> I've also found a possile buffer overflow bug in unwind.c. Attaching a
> separate patch.
> 
> 
> On 03/10/2017 09:59 PM, Victor Krapivensky wrote:
> >I've also added a test, so please review.

> >From 39a1edf60cefa42d9b6e8c72ba95f684ab652c53 Mon Sep 17 00:00:00 2001
> From: Victor Krapivensky 
> Date: Thu, 9 Mar 2017 20:26:14 +0300
> Subject: [PATCH v4] Add support for statx syscall
> 

Please add change log. Please refer to README-hacking and
https://www.gnu.org/prep/standards/html_node/Style-of-Change-Logs.html
for reference.

> ---
>  Makefile.am |   1 +
>  linux/i386/syscallent.h |   1 +
>  linux/x32/syscallent.h  |   3 +-
>  linux/x86_64/syscallent.h   |   1 +
>  pathtrace.c |   1 +
>  statx.c | 147 
> 
>  tests/.gitignore|   1 +
>  tests/Makefile.am   |   2 +
>  tests/statx.c   |  63 +++
>  tests/statx.test|   5 ++
>  tests/xstatx.c  |  88 +-
>  xlat/at_statx_sync_types.in |   3 +
>  xlat/statx_attrs.in |   6 ++
>  xlat/statx_masks.in |  12 
>  14 files changed, 319 insertions(+), 15 deletions(-)
>  create mode 100644 statx.c
>  create mode 100644 tests/statx.c
>  create mode 100755 tests/statx.test
>  create mode 100644 xlat/at_statx_sync_types.in
>  create mode 100644 xlat/statx_attrs.in
>  create mode 100644 xlat/statx_masks.in
> 
> diff --git a/Makefile.am b/Makefile.am
> index 7e837b3..e350fd2 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -232,6 +232,7 @@ strace_SOURCES =  \
>   stat64.c\
>   statfs.c\
>   statfs.h\
> + statx.c \
>   strace.c\
>   swapon.c\
>   syscall.c   \
> diff --git a/linux/i386/syscallent.h b/linux/i386/syscallent.h
> index 8ef1b1c..84c5bde 100644
> --- a/linux/i386/syscallent.h
> +++ b/linux/i386/syscallent.h
> @@ -408,6 +408,7 @@
>  [380] = { 4, TM|SI,  SEN(pkey_mprotect), "pkey_mprotect" 
> },
>  [381] = { 2, 0,  SEN(pkey_alloc),"pkey_alloc"
> },
>  [382] = { 1, 0,  SEN(pkey_free), "pkey_free" 
> },
> +[383] = { 5, TD|TF,  SEN(statx), "statx" 
> },
>  
>  #define SYS_socket_subcall   400
>  #include "subcall.h"
> diff --git a/linux/x32/syscallent.h b/linux/x32/syscallent.h
> index 2699bc0..7f4e45b 100644
> --- a/linux/x32/syscallent.h
> +++ b/linux/x32/syscallent.h
> @@ -330,7 +330,8 @@
>  [329] = { 4, TM|SI,  SEN(pkey_mprotect), "pkey_mprotect" 
> },
>  [330] = { 2, 0,  SEN(pkey_alloc),"pkey_alloc"
> },
>  [331] = { 1, 0,  SEN(pkey_free), "pkey_free" 
> },
> -[332 ... 511] = { },
> +[332] = { 5, TD|TF,  SEN(statx), "statx" 
> },
> +[333 ... 511] = { },
>  /*
>   * x32-specific system call numbers start at 512 to avoid cache impact
>   * for native 64-bit operation.
> diff --git a/linux/x86_64/syscallent.h b/linux/x86_64/syscallent.h
> index a1a268e..2624947 100644
> --- a/linux/x86_64/syscallent.h
> +++ b/linux/x86_64/syscallent.h
> @@ -330,3 +330,4 @@
>  [329] = { 4, TM|SI,  SEN(pkey_mprotect), "pkey_mprotect" 
> },
>  [330] = { 2, 0,  SEN(pkey_alloc),"pkey_alloc"
> },
>  [331] = { 1, 0,  SEN(pkey_free), "pkey_free" 
> },
> +[332] = { 5, TD|TF,  SEN(statx), "statx" 
> },
> diff --git a/pathtrace.c b/pathtrace.c
> index d991aed..90974f4 100644
> --- a/pathtrace.c
> +++ b/pathtrace.c
> @@ -183,6 +183,7 @@ pathtrace_match(struct tcb *tcp)
>   case SEN_newfstatat:
>   case SEN_openat:
>   case SEN_readlinkat:
> + case SEN_statx:
>   case SEN_unlinkat:
>   case SEN_utimensat:
>   /* fd, path */
> diff --git a/statx.c b/statx.c
> new file mode 100644
> index 000..f1e8549
> --- /dev/null
> +++ b/statx.c
> @@ -0,0 +1,147 @@
> +/*
> + * Copyright (c) 2017 The strace developers.
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + * 1. Redistributions of source code must retain the above copyright
> + *notice, this list of conditions and the following disclaimer.
> + * 2. Redistributions in binary form must reproduce the above copyright
> + *notice, this list of conditions and the following disclaime

Re: Implemented -e trace=%clock option

2017-03-12 Thread Eugene Syromyatnikov
On Sat, Mar 11, 2017 at 10:16:42PM +0530, Rishi Bhatt wrote:
> Sorry, Ignore previous attachment.
> 
> The following  patch is the implementation.
> 

I've tried to apply this, but git-am(1) failed with the following
diagnostics:

.git/rebase-apply/patch:801: trailing whitespace.
#define TC TRACE_CLOCK 
.git/rebase-apply/patch:870: trailing whitespace.
#define TC 0 
fatal: 2 lines add whitespace errors.


> On Sat, Mar 11, 2017 at 9:48 PM, Rishi Bhatt 
> wrote:
> 
> > Hi,ldv
> > i have  implemented a test for the -e trace=%clock option.
> > (tests/Makefile.am: clock.test \ )
> >
> > On Fri, Mar 10, 2017 at 10:37 PM, Dmitry V. Levin 
> > wrote:
> >
> >> On Fri, Mar 10, 2017 at 08:30:55PM +0530, Rishi Bhatt wrote:
> >> > Hey,
> >> > So for extending a trace class option syntax,i have implemented clock_*
> >> > related syscall.
> >> >
> >> > The idea came in my mind after the scheduler option was committed
> >> recently.
> >> > I thought clock related syscalls would be good.
> >>
> >> Yes, why not.
> >>
> >> > So i have attached the patch,please review it and give me the feedback.
> >>
> >> Thanks.  Any change that adds new functionality needs an appropriate test,
> >> so please resubmit the patch with a test.
> >>
> >>
> >> --
> >> ldv
> >>
> >> 
> >> --
> >> Announcing the Oxford Dictionaries API! The API offers world-renowned
> >> dictionary content that is easy and intuitive to access. Sign up for an
> >> account today to start using our lexical data to power your apps and
> >> projects. Get started today and enter our developer competition.
> >> http://sdm.link/oxford
> >> ___
> >> Strace-devel mailing list
> >> Strace-devel@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/strace-devel
> >>
> >>
> >

It is preferred that patches are sent inline.

> From afe2b0ecb21cf24daf65a6e11d8694638db52fed Mon Sep 17 00:00:00 2001
> From: Rishi Bhatt 
> Date: Sat, 11 Mar 2017 22:14:03 +0530
> Subject: [PATCH] Implemented -e trace=%clock option for clock_*
>  related-syscalls
> 

The change log is missing. Please refer to README-hacking and
https://www.gnu.org/prep/standards/html_node/Style-of-Change-Logs.html .

> ---
>  linux/32/syscallent.h | 10 +-
>  linux/64/syscallent.h | 10 +-
>  linux/alpha/syscallent.h  | 10 +-
>  linux/arm/syscallent.h| 10 +-
>  linux/avr32/syscallent.h  | 10 +-
>  linux/bfin/syscallent.h   | 10 +-
>  linux/crisv10/syscallent.h| 10 +-
>  linux/hppa/syscallent.h   | 10 +-
>  linux/i386/syscallent.h   | 10 +-
>  linux/ia64/syscallent.h   | 10 +-
>  linux/m68k/syscallent.h   | 10 +-
>  linux/microblaze/syscallent.h | 10 +-
>  linux/mips/syscallent-n32.h   | 10 +-
>  linux/mips/syscallent-n64.h   | 10 +-
>  linux/mips/syscallent-o32.h   | 10 +-
>  linux/powerpc/syscallent.h| 10 +-
>  linux/powerpc64/syscallent.h  | 10 +-
>  linux/s390/syscallent.h   | 10 +-
>  linux/s390x/syscallent.h  | 10 +-
>  linux/sh/syscallent.h | 10 +-
>  linux/sh64/syscallent.h   | 10 +-
>  linux/sparc/syscallent.h  | 10 +-
>  linux/sparc64/syscallent.h| 10 +-
>  linux/x32/syscallent.h| 10 +-
>  linux/x86_64/syscallent.h | 10 +-
>  linux/xtensa/syscallent.h | 10 +-
>  qualify.c |  1 +
>  strace.1  |  3 +++
>  syscall.c |  2 ++
>  sysent.h  |  1 +
>  tests/Makefile.am |  1 +
>  tests/clock.test  | 20 
>  tests/ksysent.c   |  1 +
>  tests/nsyscalls.c |  1 +
>  34 files changed, 160 insertions(+), 130 deletions(-)
>  create mode 100644 tests/clock.test
These permissions are incorrect, they lead to the following error when
this test is actually tried to be executed: "timeout: failed to run command
`./clock.test': Permission denied ". The correct permissions should be
100755.

When file access rights are corrected, test fails with the following 
diagnostics:

5d4
< setitimer(ITIMER_REAL, {it_interval={tv_sec=0, tv_usec=22}, 
it_value={tv_sec=0, tv_usec=11}}, NULL) = 0
clock.test: failed test: ../strace -a40 -e trace=%clock ./clock_nanosleep 
output mismatch


> diff --git a/linux/32/syscallent.h b/linux/32/syscallent.h
> index a8f95107..2e6fabbd 100644
> --- a/linux/32/syscallent.h
> +++ b/linux/32/syscallent.h
> @@ -117,10 +117,10 @@
>  [109] = { 1, 0,  SEN(timer_getoverrun),  
> "timer_getoverrun"  },
>  [110] = { 4, 0,  SEN(timer_settime), "timer_settime" 
> },
>  [111] = { 1, 0,  SEN(timer_delete),  "timer_delete"  
> },
> -[112] = { 2,

Re: GSoC 2017 introduction

2017-03-09 Thread Eugene Syromyatnikov
On Thu, Mar 9, 2017 at 5:44 PM, Victor Krapivensky
 wrote:
> I would like to implement the parser for statx. Here is my current
> attempt (no tests yet).
> I've spotted the tests/statx.sh script. Unfortunately, due to that
> tests/init.sh expects the caller name to end with ".test", it just
> endlessly runs itself. What is it supposed to do?
This is a support script for various stat test flavors:
$ git grep statx.sh
<...>
tests/fstatat64.test:. "${srcdir=.}/statx.sh"
tests/lstat.test:. "${srcdir=.}/statx.sh"
tests/lstat64.test:. "${srcdir=.}/statx.sh"
tests/newfstatat.test:. "${srcdir=.}/statx.sh"
tests/oldlstat.test:. "${srcdir=.}/statx.sh"
tests/oldstat.test:. "${srcdir=.}/statx.sh"
tests/stat.test:. "${srcdir=.}/statx.sh"
tests/stat64.test:. "${srcdir=.}/statx.sh"

> Also, how do I get syscall numbers for all the platforms?
For not so new arches, syscalls are wired on case-by-case basis, so
there is no simple way. There is some attempt to automate it [1], but
it relies on architecture headers, and for these proper wiring is
needed in place.

PS. Btw, by a quick look at the patch (haven't reviewed it yet), I can
say that you at least forgot to wire up i386 arch [2], improperly
indented SEN(statx) and most probably would have problems with struct
statx name clash once glibc decided to support it.

[1] https://strace.io/logs/strace/2017-02-08#1066;
[2] 
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/x86/entry/syscalls/syscall_32.tbl#n392

-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: GSOC: Introduction

2017-03-07 Thread Eugene Syromyatnikov
> What unix system calls are to be grouped as open-like system calls?
I'd assume that open-like system call is a system call which returns
new fd, but others' interpretations may vary.

> and I can't find open system call inside linux/32/syscallent.h ?
open(path, flags, mode) can be implemented as openat(AT_FDCWD, path,
flags, mode).

-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: [PATCH v2] Implement output staging for failed/successful syscalls

2017-03-07 Thread Eugene Syromyatnikov
> I had submitted below patch back 18th of  January 
> (https://sourceforge.net/p/strace/mailman/message/35611809/). Don't see that 
> it was merged nor did I receive any feedback so far.
> Was my submission just missed - or is the implemented feature (-z/-Z: filter 
> for successful/failed syscalls) considered not useful for the project?
Please look at https://sourceforge.net/p/strace/mailman/message/35647844/

I personally consider for putting this patch into a mergeable state,
one way or another, for the 4.17 release (among other things like
gdbserver backend), which is expected to be right after linux 4.11
release in about 7—8 weeks.


-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: Introduction

2017-03-04 Thread Eugene Syromyatnikov
On Sat, Mar 4, 2017 at 5:15 PM, Rishi Bhatt  wrote:
> Thanks ldv,
> I have read the man pages and got basic idea about strace.Now where should i
> start understanding the code?The codebase is so big i dont know where to
> start.
The core is strace.c and syscall.c (mostly). Take a look at some
simple (umask.c, readahead.c, mount.c) and not so simple (time.c,
ioctl.c, net.c, signal.c, ipc.c) decoders. You can look at some tests
then, like umask, or aio, or sendmmsg, or btrfs. util.c contains
various utility functions, defs.h contains various utility macros and
inlines. linux directory contains various (mostly
architecture-specific) system definitions which are preferred to be
part of strace codebase. linux/*/syscallent.h contains wirings for
syscalls. xlat directory contains sources for generation of symbolic
constant headers.

> On Sat, Mar 4, 2017 at 4:25 AM, Dmitry V. Levin  wrote:
>>
>> Hi,
>>
>> On Fri, Mar 03, 2017 at 11:55:33PM +0530, Rishi Bhatt wrote:
>> > Hi ldv,
>> > thanks for the reply i have build the strace  source-code and when i
>> > was building it it skipped 50 test cases. So do you know why that
>> > happened? or is it the  matter that i should look into?
>>
>> Why skipped or why 50?
>>
>> A test can be skipped if
>> - it is not applicable for the architecture being tested, for example,
>>   the test is for a syscall that is not inplemented for this architecture;
>> - the test framework doesn't support the test, for example, a kernel
>>   module is not loaded, or the filesystem is not capable, etc.
>>
>> Currently there are two architectures where exactly 50 tests are skipped:
>> - native x86_64;
>> - native sparc64.
>>
>> I bet sparc64 is not your case, so you must be running the test suite
>> natively on x86_64.
>>
>> > And can you guide me where should i start to know about -e trace=class?
>>
>> I think the best is to start with reading the manual page, then look
>> at the code to understand how it's implemented.  As soon as you've
>> understood the implementation, it's easy to extend.
>>
>
>>
>> --
>> ldv
>>
>>
>> --
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> ___
>> Strace-devel mailing list
>> Strace-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/strace-devel
>>
>
>
> ------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> Strace-devel mailing list
> Strace-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/strace-devel
>



-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: fsetxattr strings are not truncated

2017-03-03 Thread Eugene Syromyatnikov
On Thu, Dec 22, 2016 at 3:50 AM, Марк Коренберг  wrote:
> Dear developers,
>
> Here is `strace -s 2` output:
>
> [pid  5236] fgetxattr(52, "us"..., "0", 2) = 2
> [pid  5236] flistxattr(52, NULL, 0) = 66
> [pid  5236] flistxattr(52, "us"..., 132) = 66
> [pid  5236] fgetxattr(52, "us"..., "\x10\x08
> \x01\x00\x00\x04\x03H\x00\x00\x00\x00\x00\x00\x00'\x00\x00\x00rbd_data.26dae2ae8944a.00a3\xfe\xff\xff\xff\xff\xff\xff\xff\xe7Q\xa6\x8c\x00\x00\x00\x00\x00\x13\x00\x00\x00\x00\x00\x00\x00\x06\x03\x1c\x00\x00\x00\x13\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\xf3\x02\x00\x00\x00\x00\x00\x00\xc2\x04\x00\x00\xf1\x02\x00\x00\x00\x00\x00\x00\xc2\x04\x00\x00\x02\x02\x15\x00\x00\x00\x08\xd6t\x02\x00\x00\x00\x00\x00\xbf\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00@\x00\x00\x00\x00\x00qH[X\x89\xd1\xc7-\x02\x02\x15\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf3\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
> 2048) = 250
> [pid  5236] fgetxattr(52, "us"...,
> "\x00\x00\x00\x004\x00\x00\x00qH[X@\xccK4pJ6|\xff\xff\xff\xff\x00\x00@\x00\x00\x00\x00\x00\x00\x00@\x00\x00\x00\x00\x00\x00\x00\x00",
> 1798) = 44
> [pid  5236] fgetxattr(52, "us"...,
> "\x02\x02\x19\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
> 2048) = 31
> [pid  5236] fgetxattr(52, "us"..., 0x0, 0) = -1 ENODATA (No data available)
> [pid  5236] fsetxattr(52, "us"..., "\x10\x08
> \x01\x00\x00\x04\x03H\x00\x00\x00\x00\x00\x00\x00'\x00\x00\x00rbd_data.26dae2ae8944a.00a3\xfe\xff\xff\xff\xff\xff\xff\xff\xe7Q\xa6\x8c\x00\x00\x00\x00\x00\x13\x00\x00\x00\x00\x00\x00\x00\x06\x03\x1c\x00\x00\x00\x13\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\xf6\x02\x00\x00\x00\x00\x00\x00\xc2\x04\x00\x00\xf3\x02\x00\x00\x00\x00\x00\x00\xc2\x04\x00\x00\x02\x02\x15\x00\x00\x00\x08\xbax\x02\x00\x00\x00\x00\x00\xbd\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00@\x00\x00\x00\x00\x00\x8bL[X\x7f#8/\x02\x02\x15\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf6\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
> 250, 0) = 0
> [pid  5236] fsetxattr(52, "us"...,
> "\x00\x00\x00\x004\x00\x00\x00\x8bL[Xy2\xb76\x89\x19\x16\x1c\xff\xff\xff\xff\x00\x00@\x00\x00\x00\x00\x00\x00\x00@\x00\x00\x00\x00\x00\x00\x00\x00",
> 44, 0) = 0
> [pid  5236] fremovexattr(52, "us"...)   = -1 ENODATA (No data available)
> [pid  5236] fsetxattr(52, "us"...,
> "\x02\x02\x19\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00",
> 31, 0) = 0
>
>
> I expect that all strings should be truncated to 2 bytes. This does not
> happen for *xattr syscalls. So I consider this is a bug.
Thanks for the bug report. The issue has been fixed in
v4.15-62-gdd3548a (included in 4.16 release).

> Cheers,
> Mark
>
> --
> Developer Access Program for Intel Xeon Phi Processors
> Access to Intel Xeon Phi processor-based developer platforms.
> With one year of Intel Parallel Studio XE.
> Training and support from Colfax.
> Order your platform today.http://sdm.link/intel
> ___
> Strace-devel mailing list
> Strace-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/strace-devel
>



-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: Feature Request: Process Lineage in Filenames.

2017-03-03 Thread Eugene Syromyatnikov
On Fri, Mar 3, 2017 at 11:54 PM, Ralph Corderoy  wrote:
> Hi,
>
> Second request.  I had a bunch of filename.pid outputs from -ff the
> other day and to better understand what occurred, I examined and renamed
> them to show their ancestry.
>
> 1000.man
> 1008.man-preconv
> 1009.man-tbl
> 1010.man-nroff
> 1011.man-col
> 1013.man-nroff-locale
> 1016.man-nroff-groff
> 1018.man-nroff-groff-troff
> 1019.man-nroff-groff-grotty
>
> I was thinking something similar could happen automatically.  Not using
> the name of the program execve()'d, because that comes later, but a list
> of PIDs starting with the ancestor.  So
>
> strace -o foo -fff /usr/bin/foo
>
> might produce
>
> foo.100
>
> and as that forks
>
> foo.100-102
>
> and forks again
>
> foo.100-102-103
>
> foo.100-109 would be 102's sibling.
>
> It would make it that bit easier when grep-ing through them all, etc.,
> to interpret the results.
Well, something like { echo 'digraph {'; for i in *; do sed -n
"/clone/s/.* \([0-9]*\)\$/${i#*.} -> \1;/p" $i; done; echo '}'; } |
dot -Tpng  > pid_graph.png can ease the task, but it is not always
that easy [1]. Thanks for the sugestion, since strace indeed can track
this sort of process relations.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1035433

> --
> Cheers, Ralph.
> https://plus.google.com/+RalphCorderoy
>
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> Strace-devel mailing list
> Strace-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/strace-devel



-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


[Announce] strace has been accepted as a mentor organisation in GSoC 2017

2017-02-27 Thread Eugene Syromyatnikov
Hello.

strace has been accepted as a Google Summer of Code 2017 mentor
organisation. As a result, we are now happy to accept students'
applications for GSoC their projects.

You can check out organisation page on GSoC site [1] or look at the
ideas list [2].

[1] https://summerofcode.withgoogle.com/organizations/4865634958573568/
[2] https://sourceforge.net/p/strace/wiki/GoogleSummerOfCode2017/

-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: GSOC : Introducing myself

2017-02-21 Thread Eugene Syromyatnikov
On Tue, Feb 21, 2017 at 11:24 AM, Animesh Kashyap
 wrote:
> On Sun, Feb 19, 2017 at 12:20 AM, Eugene Syromyatnikov  
> wrote:
>> Well, strace itself does not utilise bug tracker of any sort; bugs and
>> suggestions usually reported via this mailing list (like suggestion
>> [1], reported recently). You can try to have a look at lists of bugs
>> related to strace packages in various distributions (like [2] or [3]),
>> but these are mostly loosely related since they are reported against
>> old versions and most of them are ususally reported upstream and fixed
>> or get stale.
>
> Hello,
>
> I read the resources provided and am reading the mailing list. I have
> successfully cloned and built strace. There are two projects specified
> on the wiki page :
> "https://sourceforge.net/p/strace/wiki/GoogleSummerOfCode2017/"; :
Well, it's not projects in term "GSoC project ideas" (which are
provided under "List of project ideas for students"), it's more like
some potential areas which still need improvement and do not require
much involment in order to tackle them, so they are deemed as a good
place to start.

> 1) Adding tests for better coverage
> 2) Adding new classes for -e trace=class.
Yes, that's correct.

> Should I start working on one of these or is there some other small
> feature that does not require much knowledge of internals of strace
> that I should work on?
I think I already mentioned [1], it requires some other knowledge
(regarding ANSI terminals and terminfo/termcap, mostly), however.
Overall, there is also vast field of work regarding support of various
ioctl() calls, but it is difficult to recommend since it already
requires some understanding of strace and kernel inner workings in
order to be done right (from my point of view).

[1] https://sourceforge.net/p/strace/mailman/message/35650550/


-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: GSOC : Introducing myself

2017-02-18 Thread Eugene Syromyatnikov
On Sat, Feb 18, 2017 at 6:24 PM, Animesh Kashyap  wrote:
>
> Are there any flags indicating "easy-to-fix" bugs or "minor" bugs that
> I can get started with. That would be really helpful.
Well, strace itself does not utilise bug tracker of any sort; bugs and
suggestions usually reported via this mailing list (like suggestion
[1], reported recently). You can try to have a look at lists of bugs
related to strace packages in various distributions (like [2] or [3]),
but these are mostly loosely related since they are reported against
old versions and most of them are ususally reported upstream and fixed
or get stale.

[1] https://sourceforge.net/p/strace/mailman/message/35650550/
[2] https://bugs.debian.org/cgi-bin/pkgreport.cgi?dist=unstable;package=strace
[3] 
https://bugzilla.redhat.com/buglist.cgi?component=strace&list_id=7101439&order=bug_status%2Cpriority%2Cbug_severity&product=Fedora&query_based_on=&query_format=advanced

-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: GSOC : Introducing myself

2017-02-18 Thread Eugene Syromyatnikov
Hello.

Please take a look at the following:
* https://sourceforge.net/p/strace/wiki/GoogleSummerOfCode2017/
contains information regarding strace in regards to GSoC 2017
* https://sourceforge.net/p/strace/mailman/strace-devel/ is an archive
of this mailing list, it contains lots of information and worth
searching
* https://sourceforge.net/p/strace/wiki/Guide%20for%20new%20contributors/
is a short guide for new contributors
* https://github.com/strace/strace/blob/master/README-hacking contains
some information regarding contribution requirements. Other README*
files are also worth a look.

On Sat, Feb 18, 2017 at 3:53 PM, Animesh Kashyap  wrote:
> Hello everyone,
>
> I am Animesh Kashyap and I am a 2nd year undergraduate student taking
> Computer Science and Engineering course at my university. I want to
> participate in Google Summer of Code this year and I like programming
> very much but do not have much experience with system programing as
> such. I looked into the organizations that participated last year and
> "strace" caught my attention. I found out that strace is participating
> this year too and so I really want to be a part of the development
> process. I am comfortable with C, git and bash. Can someone please
> guide me about the resources required and how can I begin
> contributing.
>
> Thank you,
> Animesh
>
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> Strace-devel mailing list
> Strace-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/strace-devel



-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: [PATCH 1/3] Add gdb remote protocol handling to strace

2017-02-17 Thread Eugene Syromyatnikov
On Fri, Feb 17, 2017 at 4:26 PM, Stan Cox  wrote:
> On 02/10/2017 03:21 PM, Stan Cox wrote:
>> Requesting comments on this patch, which adds support for the gdb
>> remote serial protocol
> Ping on the patch.  Also, fixed a register pool issue, which was not allowing 
> for varying x8664 register pool sizes.

Hello.

I'm is in the process of reviewing/rewriting your patch. The main
issue here is that it is a bit intrusive and does so in a
backend-specific way. I already had an idea of introduction of
backend-neutral layer, in order to support uprobes. for example, and
your submission poked me again in this direction. I'll try to provide
a feedback with updated set of patches in a coming weeks, so it can
become a part of 4.17 release. Is it ok for you?

>
>
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> Strace-devel mailing list
> Strace-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/strace-devel



-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: strace cant parse struct msghdr RHEL

2017-02-10 Thread Eugene Syromyatnikov
CONFIRM|0xbe00010},
>> MSG_WAITALL) = 4188
>> sendmsg(8, {msg_name=NULL, msg_namelen=-7623584, msg_iov=NULL,
>> msg_iovlen=33655230453052149, msg_control=./strace: umoven: short read
>> (13250 < 20480) @0xff8bac3e: Input/output error
>> 0x2ff8bac3e, msg_controllen=38647082208,
>> msg_flags=MSG_DONTROUTE|MSG_CTRUNC|MSG_TRUNC|MSG_SYN|MSG_CONFIRM|MSG_ERRQUEUE|MSG_MORE|0xff8b0010},
>> 0) = 12
>> ./strace: Out of memory
>> recvmsg(8, {msg_name=NULL, msg_namelen=-7623488, msg_iov=NULL,
>> msg_iovlen=0, msg_control=NULL, msg_controllen=17869443930177667072,
>> msg_flags=MSG_CTRUNC|MSG_TRUNC|MSG_WAITALL|MSG_CONFIRM|0xbe00010},
>> MSG_WAITALL) = 12
>> recvmsg(8, {msg_name=NULL, msg_namelen=-7623488, msg_iov=NULL,
>> msg_iovlen=0, msg_control=NULL, msg_controllen=17869443930177667072,
>> msg_flags=MSG_CTRUNC|MSG_TRUNC|MSG_WAITALL|MSG_CONFIRM|0xbe00010},
>> MSG_WAITALL) = 4188
>> sendmsg(8, {msg_name=NULL, msg_namelen=-7623584, msg_iov=NULL,
>> msg_iovlen=33655230453052149, msg_control=./strace: umoven: short read
>> (13250 < 20480) @0xff8bac3e: Input/output error
>> 0x2ff8bac3e, msg_controllen=38647082208,
>> msg_flags=MSG_DONTROUTE|MSG_CTRUNC|MSG_TRUNC|MSG_SYN|MSG_CONFIRM|MSG_ERRQUEUE|MSG_MORE|0xff8b0010},
>> 0) = 12
>> ./strace: Out of memory
>> recvmsg(8, {msg_name=NULL, msg_namelen=-7623488, msg_iov=NULL,
>> msg_iovlen=0, msg_control=NULL, msg_controllen=17869443930177667072,
>> msg_flags=MSG_CTRUNC|MSG_TRUNC|MSG_WAITALL|MSG_CONFIRM|0xbe00010},
>> MSG_WAITALL) = 4188
>> sendmsg(8, {msg_name=NULL, msg_namelen=-7631616, msg_iov=NULL,
>> msg_iovlen=10, msg_control=[{cmsg_len=17920, cmsg_level=SOL_IP,
>> cmsg_type=0x8d00 /* IP_??? */}, {cmsg_len=3158845,
>> cmsg_level=0x5f534d4e /* SOL_??? */, cmsg_type=0x4e5f534f}, ...],
>> msg_controllen=300847264664,
>> msg_flags=MSG_DONTROUTE|MSG_CTRUNC|MSG_DONTWAIT|MSG_EOR|MSG_SYN|MSG_CONFIRM|MSG_MORE|0xff8b0010},
>> 0) = 74
>> sendmsg(8, {msg_name=NULL, msg_namelen=-7631504, msg_iov=NULL,
>> msg_iovlen=29510720283184520, msg_control=[{cmsg_len=2048,
>> cmsg_level=SOL_IP, cmsg_type=0x8d70 /* IP_??? */},
>> {cmsg_len=3971745833, cmsg_level=0x7ff00bc7 /* SOL_??? */,
>> cmsg_type=0xbda}, ...], msg_controllen=38647074288,
>> msg_flags=MSG_DONTROUTE|MSG_CTRUNC|MSG_DONTWAIT|MSG_WAITALL|MSG_SYN|MSG_CONFIRM|MSG_MORE|0xff8b},
>> 0) = 12
>> ./strace: Out of memory
>> sendmsg(8, {msg_name=NULL, msg_namelen=-7623584, msg_iov=NULL,
>> msg_iovlen=33655230453052149, msg_control=./strace: umoven: short read
>> (13250 < 20480) @0xff8bac3e: Input/output error
>> 0x2ff8bac3e, msg_controllen=38647082208,
>> msg_flags=MSG_DONTROUTE|MSG_CTRUNC|MSG_TRUNC|MSG_SYN|MSG_CONFIRM|MSG_ERRQUEUE|MSG_MORE|0xff8b0010},
>> 0) = 12
>> ./strace: Out of memory
>
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> Strace-devel mailing list
> Strace-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/strace-devel



-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: Feature request: coloured output

2017-02-07 Thread Eugene Syromyatnikov
On Mon, Feb 6, 2017 at 3:41 PM, Philip Withnall  wrote:
> Hi,
>
> I’ve got a feature request for strace: optional coloured output, which
> would use ANSI escape sequences (on supported terminals) to embolden
> and colourise various bits of the strace output to make it easier to
> read. Some suggestions for the highlighting:
>  • De-emphasise PIDs at the start of a line by putting them in grey
>  • Emphasise syscall names by emboldening them
>  • Emphasise error return values by colouring them red
>
> If piping through to another program, or running on a terminal which
> doesn’t support them, the escape sequences should not be used.

As it stands, implementation of this feature whould tackle quite an
amount of code, since printing routines are spread accross decoders.
It could be implemented partially for preamles, return codes and some
types (like UIDs), but not for the structure field names and inline
comments, for example.

Personally, I would hope that the structured output conversion would
be finalized and merged before the thermal death of the Universe, and
see this feature being implemented there, since in this case code
changes would be localised in the legacy formatter.

Otherwise, it could be implemented partially (for some preamble bits
and return values) now and decoder-related part later.

> Thanks,
> Philip
>
> (Please include me in CC in any replies, as I’m not subscribed to the
> list.)
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> Strace-devel mailing list
> Strace-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/strace-devel
>



-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: How to build strace

2017-01-31 Thread Eugene Syromyatnikov
On Tue, Jan 31, 2017 at 6:53 AM, Saba Arshad  wrote:
> Hello Sir / Ma'am,
>
> My name is Saba Arshad. I am MS student at COMSATS Institute of Information
> Technology Islamabad. I am developing an Android Security System. For my
> research, i need to get the system calls of the Android applications that
> are installed on the device. I have downloaded the strace tool and working
> with ubuntu. I have problems while strace build operation. when i apply
> "make" operation is shows the error in the pathtrace.c file (first use in
> this function)
>  Can anyone please help me to remove this error??

I am not sure what exactly you are doing, but i think the build
process for (recent version of) strace for Android has been pretty
much covered recently in Eliott Hughes' e-mail [1], may be it contains
answer to your question. If it does not, please do not hesitate to ask
more specific questions, thanks.

> I really need help for this research. Thanks in advance.
> Regards,
> Saba Arshad
> MS staudent
> Computer Science Department
> COMSATS Institute of Information Technology
>  Islamabad, Pakistan
> Email: sabarsahd1...@gmail.com
>
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> ___
> Strace-devel mailing list
> Strace-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/strace-devel
>

[1] https://sourceforge.net/p/strace/mailman/message/35631329/

-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: [PATCH 3/4] getrandom: print getrandom buffer as hex array

2017-01-06 Thread Eugene Syromyatnikov
On Fri, Jan 06, 2017 at 03:16:29PM +0800, JingPiao Chen wrote:
> In general, the random bytes is not number or letter, print
> as hex array is clear, use 0x%02x format print it, easy to
> konw each element is one byte, so 0 will print 0x00.

I think it is better (in terms of performance and readability) to print it as
hex-escaped string, something like this:

--
diff --git i/defs.h w/defs.h
index eeabfcf..1630385 100644
--- i/defs.h
+++ w/defs.h
@@ -505,6 +505,7 @@ extern int next_set_bit(const void *bit_array, unsigned 
cur_bit, unsigned size_b
 #define QUOTE_0_TERMINATED  0x01
 #define QUOTE_OMIT_LEADING_TRAILING_QUOTES  0x02
 #define QUOTE_OMIT_TRAILING_0   0x08
+#define QUOTE_FORCE_HEX 0x10
 
 extern int string_quote(const char *, char *, unsigned long, unsigned int);
 extern int print_quoted_string(const char *, unsigned long, unsigned int);
diff --git i/getrandom.c w/getrandom.c
index 0a353ad..ea9ad57 100644
--- i/getrandom.c
+++ w/getrandom.c
@@ -7,7 +7,8 @@ SYS_FUNC(getrandom)
if (syserror(tcp))
printaddr(tcp->u_arg[0]);
else
-   printstrn(tcp, tcp->u_arg[0], tcp->u_rval);
+   printstr_ex(tcp, tcp->u_arg[0], tcp->u_rval,
+   QUOTE_FORCE_HEX);
tprintf(", %" PRI_klu ", ", tcp->u_arg[1]);
printflags(getrandom_flags, tcp->u_arg[2], "GRND_???");
}
diff --git i/tests/getrandom.test w/tests/getrandom.test
index e06367c..ad34048 100755
--- i/tests/getrandom.test
+++ w/tests/getrandom.test
@@ -3,4 +3,4 @@
 # Check getrandom syscall decoding.
 
 . "${srcdir=.}/init.sh"
-run_strace_match_diff -a32 -xx -s3
+run_strace_match_diff -a32 -s3
diff --git i/util.c w/util.c
index a27c4e1..484f84e 100644
--- i/util.c
+++ w/util.c
@@ -660,9 +660,9 @@ string_quote(const char *instr, char *outstr, const 
unsigned long size,
eol = 0x100; /* this can never match a char */
 
usehex = 0;
-   if (xflag > 1)
+   if ((xflag > 1) || (style & QUOTE_FORCE_HEX)) {
usehex = 1;
-   else if (xflag) {
+   } else if (xflag) {
/* Check for presence of symbol which require
   to hex-quote the whole string. */
for (i = 0; i < size; ++i) {


--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: [PATCH 3/4] tests: check decoding of LOOP_* ioctls

2017-01-05 Thread Eugene Syromyatnikov
On Tue, Dec 27, 2016 at 3:43 AM, JingPiao Chen  wrote:
> * tests/ioctl_loop.c: New file.
> * tests/ioctl_loop-v.c: Likewise.
> * tests/ioctl_loop.test: New test.
> * tests/ioctl_loop-v.test: Likewise.
> * tests/.gitignore: Add ioctl_loop and ioctl_loop-v.
> * tests/Makefile.am (check_PROGRAMS): Likewise.
> (DECODER_TESTS): Add ioctl_loop.test and ioctl_loop-v.test.
Hello.

Thank you for your contribution, the patch has been applied to the
master branch, 
https://github.com/strace/strace/commit/3127a6a2754ee3c5cef94c91b9583a39cb3fe7b7

-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: [PATCH 1/4] tests/.gitignore: add missing files that should be ignored

2017-01-05 Thread Eugene Syromyatnikov
On Tue, Dec 27, 2016 at 3:43 AM, JingPiao Chen  wrote:
> * tests/.gitignore: Add add_key, attach-f-p-cmd and scno.h.
> ---
Hello.

Thank you for your contribution, the patch has been merged to master,
https://github.com/strace/strace/commit/f2d80518f7249e30b4850fa4d8266a5ee485e04e

-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: Sending signals on syscalls

2016-12-24 Thread Eugene Syromyatnikov
Hello.

If you can run the executable under gdb, you can try to use "catch
syscall write".

On Sat, Dec 24, 2016 at 12:29 PM, Seraphime Kirkovski
 wrote:
> Hello straces devs !
>
> Recently, I had to do some reverse engineering on a malware for
> a somewhat exotic platform. As the malware had its .text encrypted my
> only possibility was strace. As always, it helped me to
> understand the binary, but after I knew what it did, I couldn't do much
> more because I couldn't see the decrypted code section. What I would
> have liked to do is send a coredump-ing signal when I think the code is
> completely decrypted, i.e. before a call to munmap, after an open call
> or something like this, or simply stop the process in order to attach
> gdb. (This isn't always possible: often, malware writers fork() before
> the main routine, which makes it more difficult to attach a debugger, as
> the pid changes, furthermore, if the text section is not decrypted the
> debugger would mess up checksums/keys/whatever.)
>
> So I thought of extending strace like this:
>
> strace -e sigonsys=:: ./a.out
>
> sigonsys: specifies the signal SIG to be sent before or after a syscall
> SYSCALL is done.
>
> Example:
>
> strace -f -e sigonsys=after:open:SIGSEGV ./a.out
>
> This sends a SIGSEGV after a call to open(2).
>
> I've already taken a shot at it. And I've identified some limitations
> that
> 1) probably cannot be overcome from userpace
> 2) are due to the racy nature of what I'm trying to do
> 3) show some flaws in the kernel
>
> First, the before parameter doesn't change anything in practice. In most
> cases the offending syscall will be executed, checking at the very end
> of the kernel procedure whether there are any pending signals. This
> yields some strange results. For instance,
>
> int main(void)
> {
> puts("hello");
> }
>
> run with strace -e sigonsys=before:write:SIGSEGV, gives the following
> result:
>
> ...
> write(1, "hello\n", 6) hello
>
> = -ERESTARTSYS
>
> That it is, the syscall succeeds, it writes "hello" to stdout and before
> returning to userspace it checks for pending signals, there is one, so
> it returns ERESTARTSYS, which is apparently stupid.
>
> Another problem I found is related to the fact that signals are not
> delivered immediately. Consider the following program
>
> int main(void)
> {
> puts("");
> puts("");
> }
>
> Strace outputs:
>
> ..
> write(1, "\n", 5)  = -ERESTARTSYS
> 
> --- SIGNAL SIGSEGV ---
>
> Or even worse,
>
> int main(void)
> {
> puts("");
> _exit(0);
> puts("");
> }
>
> when run with
>
> strace -e sigonsys=before:write:SIGSEGV ./a.out
>
> yields as expected:
>
> write(1, "\n", 5)  = -RESTARTSYS
> --- SIGNAL SIGSEGV ---
>
> But when piped like so
>
> strace -e sigonsys=before:write:SIGSEGV ./a.out | less
>
> gives:
> group_exit(0)  = ??? (no write at all)
>
>
> ( I ran those examples on x86_64 and 4.7.0-1 kernel )
>
> That being said, I think this option may help kernel developers as well.
>
> What are your thoughts on extending strace like this ? Is it worth it ?
> Do you have any ideas how I may overcome some of these difficulties ?
> Currently, I modified the sources so the signal is send through
> ptrace(SIGINFO... and ptrace_restart afterwards. I tried adding
> an additional kill(2), but that didn't change anything.
>
> Have a good Christams Eve,
> Seraphime Kirkovski
>
> ------
> Developer Access Program for Intel Xeon Phi Processors
> Access to Intel Xeon Phi processor-based developer platforms.
> With one year of Intel Parallel Studio XE.
> Training and support from Colfax.
> Order your platform today.http://sdm.link/intel
> ___
> Strace-devel mailing list
> Strace-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/strace-devel



-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/intel
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: tests: add prctl-name.test, prctl-pdeathsig.test and prctl-tsc.test

2016-12-07 Thread Eugene Syromyatnikov
On Wed, Dec 7, 2016 at 3:29 PM, JingPiao Chen  wrote:
>>Your patch has been applied in master,
>>https://github.com/strace/strace/commit/d945e74377fe069de0fe1aa2823442cf8dbdbb52
>>. Thank you for your contribution.
>
> What can I contribute more? This is my first times contribute open source
> software,
> lack of experience, I cann't find the way deep learning strace. Can you give
> me some
> advice? Thanks.
Well, there are two main fields which are easy to start from:
 * Better decoding of syscalls. From my point of view, the one thing
which significantly lacks support is various ioctl calls; Linux has a
tremendous amount of various ioctl calls supported by various drivers
and subsystems; the most likely candidates for adding are the most
useful, usually, some generic subsystems or commonly used device
drivers. One such example is a support for bluetooth ioctls: [1]
 * Test coverage. Since the structured output project is expected to
be merged in the one of the future releases, it is importnat to be
sure that nothing broken accidentally during the transition. Good set
of decoder tests is one (rather significant) part of making sure that
strace output would not changed unexpectedly. As Dmitry previously
pointed out, you can check out which parts of strace's code are not
covered with tests with LCOV (./configure CFLAGS='-O0'
--enable-code-coverage && make && make check && make
code-coverage-capture) or codecov page [3]. Note, hovewer, that not
all tests are the same and not simply coverage itself is important,
but actual testing of all the corner cases which checks whether
specific decoder works as intended (in accordance with documentation
and/or actual kernel implementation, from the original implementation
to the current one). As you may note, ioctl decoders (among other
things), again, lack proper test coverage.

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=358248
[2] https://github.com/lineprinter/strace/blob/structured/README-structured.md
[3] https://codecov.io/gh/strace/strace

> --
> JingPiao Chen

-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: tests: add prctl-name.test, prctl-pdeathsig.test and prctl-tsc.test

2016-12-07 Thread Eugene Syromyatnikov
On Thu, Nov 17, 2016 at 1:17 PM, JingPiao Chen  wrote:
> ...

Your patch has been applied in master,
https://github.com/strace/strace/commit/d945e74377fe069de0fe1aa2823442cf8dbdbb52
. Thank you for your contribution.


-- 
Eugene Syromyatnikov
mailto:evg...@gmail.com
xmpp:esyr@jabber.{ru|org}

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: tests: add prctl-name.test, prctl-pdeathsig.test and prctl-tsc.test

2016-11-21 Thread Eugene Syromyatnikov
Hello.

Thank you for your contribution. Thanks to it, several bugs in current prctl
decoder implementation have been revealed. Please take a look

On Thu, Nov 17, 2016 at 09:17:27PM +0800, JingPiao Chen wrote:
> From 8995d87f0c27d40d574f032bf483f6ae2b5f7375 Mon Sep 17 00:00:00 2001
> From: JingPiao Chen 
> Date: Thu, 17 Nov 2016 21:15:51 +0800
> Subject: [PATCH] tests: add prctl-name.test, prctl-pdeathsig.test and
>  prctl-tsc.test
> 
> 
> * tests/prctl-name.c:New file.

Missing space.

> * tests/prctl-name.test: Likewise.

The established description format for the new *.test files is "New test".

> * tests/prctl-pdeathsig.c:Likewise.
> * tests/prctl-pdeathsig.test: Likewise.
> * tests/prctl-tsc.c: Likewise.
> * tests/prctl-tsc.test: Likewise

Summing up two previous notes, this part of commit message could be
rewritten as follows:

[[
* tests/prctl-name.c: New file.
* tests/prctl-pdeathsig.c:Likewise.
* tests/prctl-tsc.c: Likewise.
* tests/prctl-name.test: New test.
* tests/prctl-pdeathsig.test: Likewise.
* tests/prctl-tsc.test: Likewise
]]

> * tests/.gitignore: Add prctl-name, prctl-pdeathsig and prctl-tsc.
> * tests/Makefile.am (check_PROGRAMS): Likewise.
> (DECODER_TESTS): Add prctl-name.test, prctl-pdeathsig.test and prctl-tsc.test
> ---
>  tests/.gitignore   |  3 +++
>  tests/Makefile.am  |  6 +
>  tests/prctl-name.c | 63 
> ++
>  tests/prctl-name.test  |  6 +
>  tests/prctl-pdeathsig.c| 61 
>  tests/prctl-pdeathsig.test |  6 +
>  tests/prctl-tsc.c  | 60 +++
>  tests/prctl-tsc.test   |  6 +
>  8 files changed, 211 insertions(+)
>  create mode 100644 tests/prctl-name.c
>  create mode 100755 tests/prctl-name.test
>  create mode 100644 tests/prctl-pdeathsig.c
>  create mode 100755 tests/prctl-pdeathsig.test
>  create mode 100644 tests/prctl-tsc.c
>  create mode 100755 tests/prctl-tsc.test
> 
> 
> diff --git a/tests/.gitignore b/tests/.gitignore
> index 6fc3cd1..8497dfa 100644
> --- a/tests/.gitignore
> +++ b/tests/.gitignore
> @@ -207,8 +207,11 @@ pkey_free
>  pkey_mprotect
>  poll
>  ppoll
> +prctl-name
> +prctl-pdeathsig
>  prctl-seccomp-filter-v
>  prctl-seccomp-strict
> +prctl-tsc
>  pread64-pwrite64
>  preadv
>  preadv-pwritev
> diff --git a/tests/Makefile.am b/tests/Makefile.am
> index df5ddb2..744ed25 100644
> --- a/tests/Makefile.am
> +++ b/tests/Makefile.am
> @@ -265,8 +265,11 @@ check_PROGRAMS = \
>   pkey_mprotect \
>   poll \
>   ppoll \
> + prctl-name \
> + prctl-pdeathsig \
>   prctl-seccomp-filter-v \
>   prctl-seccomp-strict \
> + prctl-tsc \
>   pread64-pwrite64 \
>   preadv \
>   preadv-pwritev \
> @@ -637,8 +640,11 @@ DECODER_TESTS = \
>   pkey_mprotect.test \
>   poll.test \
>   ppoll.test \
> + prctl-name.test \
> + prctl-pdeathsig.test \
>   prctl-seccomp-filter-v.test \
>   prctl-seccomp-strict.test \
> + prctl-tsc.test \
>   pread64-pwrite64.test \
>   preadv-pwritev.test \
>   preadv2-pwritev2.test \
> diff --git a/tests/prctl-name.c b/tests/prctl-name.c
> new file mode 100644
> index 000..a508969
> --- /dev/null
> +++ b/tests/prctl-name.c
> @@ -0,0 +1,63 @@
> +/*

It is recommended to have a brief description of the file in the beginning of
this comment block. For example, "Check decoding of prctl
PR_GET_NAME/PR_SET_NAME operations."

> + * Copyright (c) 2016 JingPiao Chen 
> + * All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + * 1. Redistributions of source code must retain the above copyright
> + *notice, this list of conditions and the following disclaimer.
> + * 2. Redistributions in binary form must reproduce the above copyright
> + *notice, this list of conditions and the following disclaimer in the
> + *documentation and/or other materials provided with the distribution.
> + * 3. The name of the author may not be used to endorse or promote products
> + *derived from this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
> + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
> + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
> + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
> + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
> + * THIS SOFTWARE, EVEN IF AD

[Announce] Fault injection in upcoming strace 4.15

2016-11-16 Thread Eugene Syromyatnikov
This summer, as a part of his GSoC 2016 project, Nahim El Atmani has
implemented[1] a prototype of syscall fault injection. Fault injection is a
testing/debugging technique which tampers the system calls made by a program in
order to check (correctness of) program's behaviour in presence of errors.
In case of strace, syscalls are mangled in order to return failures of different
kinds (with a kind of failure signalled by appropriate errno).

Now, this feature has been finally merged into strace's master branch and going
to be part of the upcoming 4.15 release, which is expected somewhere in the
beginning on December (as some may recall, strace's release cycle is now
synchronised with kernel releases). Since this functionality is rather
unorthodox in comparison with other features already present in strace, strace's
development team encourages all enthusiastic strace users to give it a try in
order to determine its readiness for the upcoming release. More specifically:
 * Check out the provided documentation. Whether it is clear enough? If not,
   please suggest improvements.
 * Try to actually use it. During the course of its development, fault injection
   already enabled discovery of several bugs ([2], for example), and any
   feedback regarding various usage cases is appreciated.
 * Try it on different architectures. It has been tested on aarch64, alpha, arm,
   hppa, ia64, ppc, ppc64, s390, s390x, sparc, sparc64, x32, x86, and x86_64;
   other architectures are still untested.

How to get it:
 * Check out master branch of strace repository[3][4].
 * Install package from Fedora rawhide[5].
 * Install package from OBS[6].

---
[1] https://brokenpi.pe/tools/strace-fault-injection
[2] https://sourceware.org/bugzilla/show_bug.cgi?id=20831
[3] https://sourceforge.net/p/strace/code/ci/master/tree/
[4] https://github.com/strace/strace
[5] https://apps.fedoraproject.org/packages/strace
[6] https://build.opensuse.org/package/show/home:ldv_alt/strace/

--
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


Re: [PATCH] device mapper ioctl

2016-11-10 Thread Eugene Syromyatnikov
On Wed, Oct 19, 2016 at 8:31 PM, Mikulas Patocka  wrote:
>
> Hi
>
> Here I'm sending the device mapper ioctl patch with these changes merged.

Hello.

Thank you for your contribution. The implementation of DM_* ioctl
decoding is now in strace's master, you can check it out at
https://github.com/strace/strace/commit/a507a0bb777c552e43e1e45f302703a09ffea1b8

Could you please review it and let us know if there are any issues?

> In this piece of code:
> +   dm_arg_open3->target3.next = 0xdeadbeef;
> +   dm_arg_open3->param3[0] = '\1';
> +   dm_arg_open3->param3[1] = '\2';
> +   dm_arg_open3->param1[2] = '\0';
> there should be "dm_arg_open3->param3[2]" instead of
> "dm_arg_open3->param1[2]". "dm_arg_open3->param1[2]" produces a warning
> about access beyond the end of array.
Thank you for noticing, it was an oversight on my part.

> Mikulas


-- 
Eugene "eSyr" Syromyatnikov
mailto:evg...@gmail.com
xmpp:eSyr@jabber.{ru|org}

--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


[PATCH 03/26] bjm: Use getarg_ull for retrieving len parameter of init_module syscall

2016-10-23 Thread Eugene Syromyatnikov
Since it is of kernel_ulont_t type, in fact.

* bjm.c (SYS_FUNC(init_module)): Use "%llu" conversion specifier, obtain
len aargument via getarg_ull.
---
 bjm.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bjm.c b/bjm.c
index e77b73d..c8e8470 100644
--- a/bjm.c
+++ b/bjm.c
@@ -45,7 +45,7 @@ SYS_FUNC(delete_module)
 SYS_FUNC(init_module)
 {
printaddr(tcp->u_arg[0]);
-   tprintf(", %lu, ", tcp->u_arg[1]);
+   tprintf(", %llu, ", getarg_ull(tcp, 1));
printstr(tcp, tcp->u_arg[2], -1);
 
return RVAL_DECODED;
-- 
1.7.10.4


--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel


  1   2   3   4   >