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

2016-11-17 Thread JingPiao Chen
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. * tests/prctl-name.test: Likewise. * tests/prctl

A wiki I collect from mailing list

2016-12-03 Thread JingPiao Chen
A wiki I collect from mailing list, I look forward to help newbies like me. Also hope others perfect it. Thank you. Non-official, so I put it in my [github](https://github.com/ppiao/strace-wiki), Looking forward to your reply, Thank you. -- JingPiao Chen

A wiki I collect from mailing list

2016-12-03 Thread JingPiao Chen
A wiki I collect from mailing list, I look forward to help newbies like me. Also hope others perfect it. Thank you. Non-official, so I put it in my [github](https://github.com/ppiao/strace-wiki), Looking forward to your reply, Thank you. -- JingPiao Chen

readv.test is fail on Ubuntu 16.04 x86_64

2016-12-04 Thread JingPiao Chen
p 17 00:00:00 2001 From: JingPiao Chen Date: Sun, 4 Dec 2016 19:56:19 +0800 Subject: [PATCH] tests: fix maximum fd in pipe_maxfd * tests/pipe_maxfd.c: Change INT_MAX to 0x7fff. --- tests/pipe_maxfd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/pipe_ma

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

2016-12-07 Thread JingPiao Chen
d the way deep learning strace. Can you give me some advice? Thanks. -- JingPiao Chen-- Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With one year of

puzzle of ioctl decode in file_ioctl.c and userfaultfd.c

2016-12-11 Thread jingpiao chen
Version:4.14-ab28d7f1e5ab9b51f5708741bd13f92e768123d4 1.file_ioctl.c:130 125 int 126 file_ioctl(struct tcb *tcp, const unsigned int code, const long arg) 127 { 128 switch (code) { 129 case FICLONE: /* W */ 130 tprintf(", %d", (int) arg); 131 break

[PATCH] tests: check decoding of LOOP_* ioctls

2016-12-15 Thread JingPiao Chen
>From c40ccc35dc8e40fc6dc331af3d1884a54bc72784 Mon Sep 17 00:00:00 2001 From: JingPiao Chen Date: Fri, 16 Dec 2016 00:02:55 +0800 Subject: [PATCH] tests: check decoding of LOOP_* ioctls * tests/ioctl_loop.c: New file. * tests/ioctl_loop-v.c: Likewise. * tests/ioctl_loop.test: New test. * te

[PATCH 1/2] sock: fix bitwise OR operation short circuit

2016-12-19 Thread JingPiao Chen
c354f9bc0) = -1 EBADF (Bad file descriptor) >From 5b2d4f12d61e5a03212de948508e830c9aeeef87 Mon Sep 17 00:00:00 2001 From: JingPiao Chen Date: Mon, 19 Dec 2016 23:08:09 +0800 Subject: [PATCH 1/2] sock: fix bitwise OR operation short circuit * sock.c (decode_ifconf): Exchange the place of syserror()

[PATCH 2/2] tests: check decoding of SIOC* ioctls

2016-12-19 Thread JingPiao Chen
>From 8b0c44c17d17ea3a9710ae7586579c288289a46e Mon Sep 17 00:00:00 2001 From: JingPiao Chen Date: Mon, 19 Dec 2016 23:29:54 +0800 Subject: [PATCH 2/2] tests: check decoding of SIOC* ioctls * tests/ioctl_sock.c: New file. * tests/ioctl_sock.test: New test. * tests/.gitignore: Add ioctl_s

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

2016-12-22 Thread JingPiao Chen
on Sep 17 00:00:00 2001 From: JingPiao Chen Date: Fri, 16 Dec 2016 00:02:55 +0800 Subject: [PATCH] tests: check decoding of LOOP_* ioctls * 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/.gitign

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

2016-12-22 Thread JingPiao Chen
>No, the formatting is broken all the same. Sorry, my mistake. >From e6bfa146fdd5c5eef9d317dffec93023889bd697 Mon Sep 17 00:00:00 2001 From: JingPiao Chen Date: Fri, 23 Dec 2016 08:10:43 +0800 Subject: [PATCH] tests: check decoding of LOOP_* ioctls * tests/ioctl_loop.c: New file. *

Re: [PATCH v2 1/2] xattr: use printstr_ex instead of print_quoted_string

2016-12-22 Thread JingPiao Chen
* tests/Makefile.am (check_PROGRAMS): Likewise. >> (DECODER_TESTS): Add xattr-string.test. >> >> Signed-off-by: Gabriel Laskar >Applied, thanks! >-- >ldv Could I ask a question? All the string even in struct should comply with -s option? All the string should NUL te

Re: [PATCH 2/2] tests: check decoding of SIOC* ioctls

2016-12-22 Thread JingPiao Chen
>Could you resend this using a different method that doesn't lead >to damaged patches, please? >From 8f2e5c5081f3d3bd10df8c9a2326d6a1b48deb3f Mon Sep 17 00:00:00 2001 From: JingPiao Chen Date: Fri, 23 Dec 2016 08:23:52 +0800 Subject: [PATCH] tests: check decoding of SIOC* i

Re: [PATCH 1/2] sock: fix bitwise OR operation short circuit

2016-12-22 Thread JingPiao Chen
>This cannot be the right fix: >if umove returned an error, ifc.ifc_buf is undefined. Yes, I make the same mistake. How to fix this bug? Thanks. -- JingPiao Chen 2016-12-23 7:03 GMT+08:00 Dmitry V. Levin : > On Mon, Dec 19, 2016 at 11:33:46PM +0800, JingPiao Chen wrote: > &

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

2016-12-26 Thread JingPiao Chen
* tests/.gitignore: Add add_key, attach-f-p-cmd and scno.h. --- tests/.gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/.gitignore b/tests/.gitignore index 3b04590..bab02a0 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -5,17 +5,20 @@ *.tmp-* *.tmp.* *.trs +scno.h

[PATCH 4/4] tests: check decoding of SIOC* ioctls

2016-12-26 Thread JingPiao Chen
\ ioctl_uffdio.test \ ioctl_v4l2.test \ ioperm.test \ diff --git a/tests/ioctl_sock.c b/tests/ioctl_sock.c new file mode 100644 index 000..82a8385 --- /dev/null +++ b/tests/ioctl_sock.c @@ -0,0 +1,290 @@ +/* + * This file is part of ioctl_sock strace test. + * + * Copyright (c) 2016 JingPiao

[PATCH 2/4] sock: fix decode_ifconf print error

2016-12-26 Thread JingPiao Chen
* sock.c (decode_ifconf): Always print ifc_len, don't judge ifc_buf. --- sock.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/sock.c b/sock.c index 3e197ed..1c87927 100644 --- a/sock.c +++ b/sock.c @@ -140,24 +140,19 @@ decode_ifconf(struct tcb *tcp, const lo

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

2016-12-26 Thread JingPiao Chen
ew file mode 100644 index 000..323468a --- /dev/null +++ b/tests/ioctl_loop.c @@ -0,0 +1,184 @@ +/* + * This file is part of ioctl_loop strace test. + * + * Copyright (c) 2016 JingPiao Chen + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modif

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

2017-01-05 Thread JingPiao Chen
;> (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/3127a6a2754ee3c5cef94c91b9583a39cb3fe7

[PATCH 1/4] strace: move -k option to appropriate place

2017-01-05 Thread JingPiao Chen
Like strace.1 -k option should add in output format group. * strace.c (usage): Move -k option to output format group. --- strace.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/strace.c b/strace.c index 9df942e..13f4863 100644 --- a/strace.c +++ b/strace.c @@ -21

[PATCH 2/4] qualify: fix signal=SIG_0 and signal=0 do not print error message

2017-01-05 Thread JingPiao Chen
SIG_0 is not valid signal name, do not have signal number is 0. Maybe not have greatly effect, but print error message is friendly. * qualify.c (sigstr_to_uint): Compare signal number to zero. Change index start from one. --- qualify.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-)

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

2017-01-05 Thread JingPiao Chen
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. * getrandom.c: * tests/getrandom.c: Update print buffer. * tests/getrandom.test: Update. --- getrandom.c | 16 ++

[PATCH 4/4] Implement decoding of ustat syscall

2017-01-05 Thread JingPiao Chen
\ vmsplice.test \ wait4.test \ diff --git a/tests/ustat.c b/tests/ustat.c new file mode 100644 index 000..df58879 --- /dev/null +++ b/tests/ustat.c @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * All rights reserved. + * + * Redistribution and use in source and binary

[PATCH v2] Implement decoding of ustat syscall

2017-01-06 Thread JingPiao Chen
.test \ + ustat.test \ vhangup.test \ vmsplice.test \ wait4.test \ diff --git a/tests/ustat.c b/tests/ustat.c new file mode 100644 index 000..df58879 --- /dev/null +++ b/tests/ustat.c @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * All rights res

[PATCH v3] Implement decoding of ustat syscall

2017-01-07 Thread JingPiao Chen
e.test \ wait4.test \ diff --git a/tests/ustat.c b/tests/ustat.c new file mode 100644 index 000..ffc69b4 --- /dev/null +++ b/tests/ustat.c @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or w

[PATCH v4] Implement decoding of ustat syscall

2017-01-09 Thread JingPiao Chen
\ utimensat.test \ utimes.test \ diff --git a/tests/ustat.c b/tests/ustat.c new file mode 100644 index 000..3e82f12 --- /dev/null +++ b/tests/ustat.c @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * All rights reserved. + * + * Redistribution and use in source and binary forms

[PATCH v5] Implement decoding of ustat syscall

2017-01-11 Thread JingPiao Chen
\ utimensat.test \ utimes.test \ diff --git a/tests/ustat.c b/tests/ustat.c new file mode 100644 index 000..435b1fd --- /dev/null +++ b/tests/ustat.c @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * All rights reserved. + * + * Redistribution and use in source and binary forms

[PATCH v6] Implement decoding of ustat syscall

2017-01-12 Thread JingPiao Chen
\ utimensat.test \ utimes.test \ diff --git a/tests/ustat.c b/tests/ustat.c new file mode 100644 index 000..c93862c --- /dev/null +++ b/tests/ustat.c @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * All rights reserved. + * + * Redistribution and use in source and binary forms

[PATCH] tests: fix typo in mlock.c

2017-01-12 Thread JingPiao Chen
* tests/mlock.c: Fix SKIP_MAIN_UNDEFINED spell error. --- tests/mlock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/mlock.c b/tests/mlock.c index be962e2..8e9806b 100644 --- a/tests/mlock.c +++ b/tests/mlock.c @@ -24,6 +24,6 @@ main(void) #else -SKIP_MAIN_DEFINED

[PATCH v7] Implement decoding of ustat syscall

2017-01-13 Thread JingPiao Chen
\ userfaultfd.test \ + ustat.test \ utime.test \ utimensat.test \ utimes.test \ diff --git a/tests/ustat.c b/tests/ustat.c new file mode 100644 index 000..0b17aee --- /dev/null +++ b/tests/ustat.c @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * All rights

Re: [PATCH v7] Implement decoding of ustat syscall

2017-01-13 Thread JingPiao Chen
is unsigned int on alpha and s390, and kernel_ulong_t on other >architectures; >also, struct ustat also contains f_fname[] and f_fpack[]. > >In other words, you really need to decode ustat. Can you give me a hand? Is it if

[PATCH v8] Implement decoding of ustat syscall

2017-01-14 Thread JingPiao Chen
\ userfaultfd.test \ + ustat.test \ utime.test \ utimensat.test \ utimes.test \ diff --git a/tests/ustat.c b/tests/ustat.c new file mode 100644 index 000..99f1f9d --- /dev/null +++ b/tests/ustat.c @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * All rights

[PATCH 3/3] strace.1: change man page alignment

2017-01-16 Thread JingPiao Chen
--- strace.1 | 6 -- 1 file changed, 6 deletions(-) diff --git a/strace.1 b/strace.1 index 0356c2d..351dc14 100644 --- a/strace.1 +++ b/strace.1 @@ -205,7 +205,6 @@ Here the second argument represents the full set of all signals. .SH OPTIONS .SS Output format .TP 12 -.TP .BI "\-a " colum

[PATCH 1/3] Makefile.am: fix regular expression can not adapt whitespace

2017-01-16 Thread JingPiao Chen
--- When I decode ustat syscall # include DEF_MPERS_TYPE(ustat_t) will fault Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index afc3dd2..a7d7006 100644 --- a/Makefile.am +++ b/Makefile.am @@ -880,7 +880,7 @@ mpers-m%.stamp: $(srcdir_mpe

[PATCH v9 2/3] Implement decoding of ustat syscall

2017-01-16 Thread JingPiao Chen
/tests/ustat.c @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2017 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

Re: [PATCH 1/3] Makefile.am: fix regular expression can not adapt whitespace

2017-01-17 Thread JingPiao Chen
echo '#undef MPERS_PRINTER_NAME' >> $@-t >> echo '#define MPERS_PRINTER_NAME(printer_name) printer_name' >> $@-t -- JingPiao Chen -- Check out the vibrant tech community on one of

Re: [PATCH 3/3] strace.1: change man page alignment

2017-01-17 Thread JingPiao Chen
> .SS Miscellaneous >> .TP 12 >> -.TP >> .B \-d >> Show some debugging output of >> .B strace > >This patch removes redundant .TP macros, but does it really change >alignment? I means right alignment, I found that start from OPTIONS the description not over

[PATCH v2] Makefile.am: fix regular expression not tolerate extra whitespace

2017-01-18 Thread JingPiao Chen
If have whitespace between pound and include, or more than one whitespace between include and DEF_MPERS_TYPE, the regular expression will not match. * Makefile.am (m%_type_defs.h): Fix regular expression. --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile

GSoC 2017 Introduction: Netlink socket parsers

2017-03-18 Thread JingPiao Chen
Hello strace-developers: My name is JingPiao Chen. I'am a Computer Science sophomore from Guangdong Pharmaceutical University. I am interested in Netlink socket parsers suggested by Gabriel Laskar and Dmitry V. Levin. I am familiar with C, git, shell script, and gdb. My current work base o

Re: GSoC 2017 Introduction: Netlink socket parsers

2017-03-25 Thread JingPiao Chen
>Hello strace-developers: > My name is JingPiao Chen. I'am a Computer Science sophomore from >Guangdong Pharmaceutical University. I am interested in Netlink socket >parsers suggested by Gabriel Laskar and Dmitry V. Levin. I am familiar >with C, git, shell script, and gdb. >

Re: GSoC 2017 Introduction: Netlink socket parsers

2017-03-27 Thread JingPiao Chen
>Hi, 2017-03-27 6:16 GMT+08:00 Dmitry V. Levin wrote: >On Sun, Mar 19, 2017 at 12:25:11PM +0800, JingPiao Chen wrote: >> Hello strace-developers: >> My name is JingPiao Chen. I'am a Computer Science sophomore from >> Guangdong Pharmaceutical University. I am

Re: GSoC 2017 Introduction: Netlink socket parsers

2017-03-27 Thread JingPiao Chen
On Tue, Mar 28, 2017 at 10:37 AM, Dmitry V. Levin wrote: >On Mon, Mar 27, 2017 at 10:40:05PM +0800, JingPiao Chen wrote: >> 2017-03-27 6:16 GMT+08:00 Dmitry V. Levin wrote: >> >On Sun, Mar 19, 2017 at 12:25:11PM +0800, JingPiao Chen wrote: >> >> Hello strace-develop

Re: GSoC 2017 Introduction: Netlink socket parsers

2017-03-29 Thread JingPiao Chen
vin wrote: >>On Mon, Mar 27, 2017 at 10:40:05PM +0800, JingPiao Chen wrote: >>> 2017-03-27 6:16 GMT+08:00 Dmitry V. Levin wrote: >>> >On Sun, Mar 19, 2017 at 12:25:11PM +0800, JingPiao Chen wrote: >>> >> Hello strace-developers: >>> >> My n

[PATCH 2/3] Implement simple color output

2017-03-31 Thread JingPiao Chen
Color output system call name, return value, error message, fd, address and prefix pid. * color.h: New file. * Makefile.am (strace_SOURCES): Add color.h. * defs.h (color_attr): New enum. (color_tprintf, color_tprints): New prototype. * syscall.c (trace_syscall_entering): Color output system call n

[PATCH 3/3] tests: check -H option

2017-03-31 Thread JingPiao Chen
* tests/color_output.test: New test. * tests/Makefile.am (DECODER_TESTS): Add color_output.test. --- tests/Makefile.am | 1 + tests/color_output.test | 17 + 2 files changed, 18 insertions(+) create mode 100755 tests/color_output.test diff --git a/tests/Makefile.am b/tests

[PATCH 1/3] Introduce vtprintf function

2017-03-31 Thread JingPiao Chen
* strace.c (vtprintf): New function. (tprintf): Use it. --- strace.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/strace.c b/strace.c index 7214e6e..2b50cc0 100644 --- a/strace.c +++ b/strace.c @@ -569,12 +569,9 @@ strace_popen(const char *command)

Using regular expression filter system call

2017-04-08 Thread JingPiao Chen
Recently, class %sched and %clock are added. Is it necessary to add regular expression to filter system call? I use '@' as the prefix of regular expression. I think following regular expressions may be used. @time, @[pg]id, @^wait @xattr, @^dup, @^send, @^recv, @^read, @^write, @^sem, @^shm, @^msg

[PATCH v2] Implement -e trace=/REGEX/ option

2017-04-10 Thread JingPiao Chen
* qualify.c (qualify_syscall_regex): New function. (qualify_syscall_name): Use qualify_syscall_regex function. * tests/regex.test: Check this. * tests/Makefile.am (DECODER_TESTS): Add regex.test. --- qualify.c | 36 +++ tests/Makefile.am | 1 + tests/regex.test |

Re: Using regular expression filter system call

2017-04-10 Thread JingPiao Chen
On Mon, Apr 10, 2017 at 3:57 AM, Dmitry V. Levin wrote: >On Sat, Apr 08, 2017 at 10:16:52PM +0800, JingPiao Chen wrote: >> Recently, class %sched and %clock are added. Is it necessary to add >> regular expression to filter system call? > >Indeed. Do we really need %sched a

Re: Using regular expression filter system call

2017-04-10 Thread JingPiao Chen
>the start) to match sed, awk, perl (I think dtrace also has similar >predicate syntax as well?) etc. Yes, '/' is better, I updated the patch. -- JingPiao Chen -- Check out the vibrant tech community on one of the

[PATCH v3] Implement -e trace=/regex option

2017-04-12 Thread JingPiao Chen
* qualify.c (qualify_syscall_regex): New function. (qualify_syscall_name): Use qualify_syscall_regex function. * strace.1: Document it. * NEWS: Mention this. * tests/regex.test: Check this. * tests/Makefile.am (DECODER_TESTS): Add regex.test. * tests/options-syntax.test: Add check for invaild regex

Re: [PATCH v3] Implement -e trace=/regex option

2017-04-12 Thread JingPiao Chen
On Thu, Apr 13, 2017 at 5:10 AM, Dmitry V. Levin wrote: >On Wed, Apr 12, 2017 at 09:31:51PM +0800, JingPiao Chen wrote: >> @@ -198,6 +199,48 @@ qualify_syscall_number(const char *s, struct number_set *set) >> return done; >> } >> >> +static bool >> +qual

[PATCH v4] Implement -e trace=/regex option

2017-04-13 Thread JingPiao Chen
* qualify.c: Include . (qualify_syscall_regex): New function. (qualify_syscall): Use it. * strace.1: Document -e trace=/regex option. * NEWS: Mention -e trace=/regex option. * tests/regex.test: New test. * tests/Makefile.am (DECODER_TESTS): Add it. * tests/options-syntax.test: Add check for invaild

[PATCH 2/2] Implement -eread=@path and -ewrite=@path option

2017-04-18 Thread JingPiao Chen
* defs.h (readpath_select, readpath_match): New prototypes. (writepath_select, writepath_match): Likewise. * pathtrace.c (readpath_select, readpath_match): New functions. (writepath_select, writepath_match): Likewise. (path_select): Add syntax check. * qualify.c (qualify_read): Use readpath_select.

[PATCH 1/2] Extend path trace related function interface

2017-04-18 Thread JingPiao Chen
* defs.h (paths_selected): Remove the declaration. (tracing_paths): Replace the macro with a global variable. * strace.c (tracing_paths): New global variable. (init): Adjust -P option handler. * pathtrace.c (pathmatch): Add a parameter of type struct path_set. (upathmatch, fdmatch, storepath): Like

Re: GSoC 2017 Introduction: Netlink socket parsers

2017-04-18 Thread JingPiao Chen
On Mon, Apr 17, 2017 at 9:40 PM, Dmitry V. Levin wrote: >On Wed, Mar 29, 2017 at 05:39:59PM +0800, JingPiao Chen wrote: >> I updated the patch[1] and the proposal draft[2]. >> Please provide some feedback. >> [1]https://github.com/ppiao/strace/tree/nl-socket > >As I sai

Re: Want to Contribute

2017-05-07 Thread JingPiao Chen
i/Guide%20for%20new%20contributors/ [2]https://sourceforge.net/p/strace/wiki/FeatureRequests/ -- JingPiao Chen -- Check out the vibrant tech community on one of the world's most engaging te

[post 1]GSoC 2017: Netlink socket parsers

2017-05-07 Thread JingPiao Chen
Hi, strace community: My name is JingPiao Chen. I'm luckily selected by strace to work on Netlink socket parsers in GSoC this year. My main goal is to extend to support more netlink family protocols. I want to start my work now. When I modify the code by Fabien Siron, I have

JingPiao Chen's GSoC status report - #0 of 13

2017-05-30 Thread JingPiao Chen
Introduce getfdnlproto to obtain netlink protocol from fd 919e52c7 Introduce get_sockaddr_by_inode_cached and get_sockaddr_by_inode 26fb0cba Introduce cache_inode_details d61022f5 netlink: decode NLMSG_DONE message [1]https://github.com/ppiao/strace -- JingPiao Chen

Re: [PATCH] netlink: decode NLMSG_DONE message

2017-06-04 Thread JingPiao Chen
On Fri, Jun 02, 2017 at 06:25:28PM +0300, Dmitry V. Levin wrote: > On Fri, May 05, 2017 at 06:21:17PM +0800, JingPiao Chen wrote: > > * netlink.c (decode_payload): Decode NLMSG_DONE message. > > * tests/netlink_protocol.c: Add check for decoding > > of NLMSG_DONE message. &

Re: [PATCH] netlink: decode NLMSG_DONE message

2017-06-04 Thread JingPiao Chen
On 4 June 2017 at 17:56, Dmitry V. Levin wrote: > On Sun, Jun 04, 2017 at 03:57:08PM +0800, JingPiao Chen wrote: > > On Fri, Jun 02, 2017 at 06:25:28PM +0300, Dmitry V. Levin wrote: > > > On Fri, May 05, 2017 at 06:21:17PM +0800, JingPiao Chen wrote: [...] > > > I sug

[PATCH v2 2/6] tests: check decoding of NETLINK_ROUTE message types

2017-06-04 Thread JingPiao Chen
\ oldselect.test \ diff --git a/tests/netlink_route.c b/tests/netlink_route.c new file mode 100644 index 000..7946121 --- /dev/null +++ b/tests/netlink_route.c @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * All rights reserved. + * + * Redistribution and use in source and

[PATCH v2 5/6] tests: check decoding of NETLINK_SELINUX message types

2017-06-04 Thread JingPiao Chen
\ netlink_sock_diag.test \ nsyscalls.test \ oldselect.test \ diff --git a/tests/netlink_selinux.c b/tests/netlink_selinux.c new file mode 100644 index 000..ef30bad --- /dev/null +++ b/tests/netlink_selinux.c @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * All rights reserved

[PATCH v2 4/6] tests: check decoding of NETLINK_NETFILTER message types

2017-06-04 Thread JingPiao Chen
\ netlink_sock_diag.test \ nsyscalls.test \ diff --git a/tests/netlink_netfilter.c b/tests/netlink_netfilter.c new file mode 100644 index 000..811585a --- /dev/null +++ b/tests/netlink_netfilter.c @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * All rights reserved

[PATCH v2 3/6] tests: check decoding of NETLINK_AUDIT message types

2017-06-04 Thread JingPiao Chen
\ nsyscalls.test \ diff --git a/tests/netlink_audit.c b/tests/netlink_audit.c new file mode 100644 index 000..e955c42 --- /dev/null +++ b/tests/netlink_audit.c @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * All rights reserved. + * + * Redistribution and use in source and

[PATCH v2 1/6] tests: check decoding of NETLINK_SOCK_DIAG message types

2017-06-04 Thread JingPiao Chen
perror_msg_and_skip("bind"); + + return fd; +} diff --git a/tests/netlink_sock_diag.c b/tests/netlink_sock_diag.c new file mode 100644 index 000..09eb2bf --- /dev/null +++ b/tests/netlink_sock_diag.c @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * All rights re

[PATCH v2 6/6] tests: check decoding of NETLINK_XFRM message types

2017-06-04 Thread JingPiao Chen
\ personality.test \ diff --git a/tests/netlink_xfrm.c b/tests/netlink_xfrm.c new file mode 100644 index 000..fa50080 --- /dev/null +++ b/tests/netlink_xfrm.c @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * All rights reserved. + * + * Redistribution and use in source and binary forms, with

Re: [PATCH] netlink: add type decoding

2017-06-05 Thread JingPiao Chen
On Sun, Jun 04, 2017 at 10:40:09PM +0300, Dmitry V. Levin wrote: > On Mon, Jul 11, 2016 at 12:54:59PM +, Fabien Siron wrote: > > Decode and print the type of the main netlink protocols. > > JingPiao Chen, I've reworked Fabien's commits from your netlink branch >

[PATCH v3 1/6] tests: check decoding of NETLINK_SOCK_DIAG message types

2017-06-05 Thread JingPiao Chen
perror_msg_and_skip("bind"); + + return fd; +} diff --git a/tests/netlink_sock_diag.c b/tests/netlink_sock_diag.c new file mode 100644 index 000..09eb2bf --- /dev/null +++ b/tests/netlink_sock_diag.c @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * All rights re

[PATCH v3 4/6] tests: check decoding of NETLINK_NETFILTER message types

2017-06-05 Thread JingPiao Chen
old_mmap -a11 -e trace=mmap diff --git a/tests/netlink_netfilter.c b/tests/netlink_netfilter.c new file mode 100644 index 000..811585a --- /dev/null +++ b/tests/netlink_netfilter.c @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * All rights reserved. + * + * Redistribution and

[PATCH v3 6/6] tests: check decoding of NETLINK_XFRM message types

2017-06-05 Thread JingPiao Chen
--git a/tests/netlink_xfrm.c b/tests/netlink_xfrm.c new file mode 100644 index 000..fa50080 --- /dev/null +++ b/tests/netlink_xfrm.c @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without

[PATCH v3 2/6] tests: check decoding of NETLINK_ROUTE message types

2017-06-05 Thread JingPiao Chen
/tests/netlink_route.c b/tests/netlink_route.c new file mode 100644 index 000..7946121 --- /dev/null +++ b/tests/netlink_route.c @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without

[PATCH v3 5/6] tests: check decoding of NETLINK_SELINUX message types

2017-06-05 Thread JingPiao Chen
-a18 -v -P stat.sample diff --git a/tests/netlink_selinux.c b/tests/netlink_selinux.c new file mode 100644 index 000..ef30bad --- /dev/null +++ b/tests/netlink_selinux.c @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * All rights reserved. + * + * Redistribution and use in source

[PATCH v3 3/6] tests: check decoding of NETLINK_AUDIT message types

2017-06-05 Thread JingPiao Chen
/netlink_audit.c b/tests/netlink_audit.c new file mode 100644 index 000..e955c42 --- /dev/null +++ b/tests/netlink_audit.c @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification

Re: [PATCH] netlink: add type decoding

2017-06-06 Thread JingPiao Chen
Done, thank you. -- JingPiao Chen On 6 June 2017 at 00:53, Dmitry V. Levin wrote: > On Mon, Jun 05, 2017 at 03:07:04PM +0800, JingPiao Chen wrote: > > On Sun, Jun 04, 2017 at 10:40:09PM +0300, Dmitry V. Levin wrote: > [...] > > > getfdnlproto (get_fd_nl_family in my

JingPiao Chen's GSoC status report - #1 of 13

2017-06-06 Thread JingPiao Chen
I decoded selinux and audit. These two days are busy fixing last week's code. I have rebased my code to latest main tree, I will continue to fix last week's code and decode audit next week. -- Check out the vibrant tech com

[PATCH 1/2] netlink: implement generic nlmsg_flags decoding

2017-06-06 Thread JingPiao Chen
* netlink.c: Include xlat/netlink_get_flags.h, xlat/netlink_new_flags.h, xlat/nl_route_get_types.h, xlat/nl_route_new_types.h, xlat/nl_xfrm_get_types.h, and xlat/nl_xfrm_new_types.h. (decode_nlmsg_flags): New function. (print_nlmsghdr): Use it. * xlat/netlink_get_flags.in: New file. * xlat/netlink_

[PATCH 2/2] tests: add check for decoding netlink get and new flags

2017-06-06 Thread JingPiao Chen
* tests/netlink_route.c: Add check for NETLINK_ROUTE get and new flags. * tests/netlink_sock_diag.c: Add check for NETLINK_SOCK_DIAG get flags. * tests/netlink_xfrm.c: Add check for NETLINK_XFRM get and new flags. --- tests/netlink_route.c | 26 ++ tests/netlink_sock_di

[PATCH 2/2] tests: add check for decoding netlink get and new flags

2017-06-07 Thread JingPiao Chen
* tests/netlink_route.c: Add check for NETLINK_ROUTE get and new flags. * tests/netlink_sock_diag.c: Add check for NETLINK_SOCK_DIAG get flags. * tests/netlink_xfrm.c: Add check for NETLINK_XFRM get and new flags. --- tests/netlink_route.c | 43 +++ test

[PATCH 1/2] netlink: implement generic nlmsg_flags decoding

2017-06-07 Thread JingPiao Chen
* netlink.c (decode_nlmsg_flags): New function. (print_nlmsghdr): Use it. * xlat/netlink_get_flags.in: New file. * xlat/netlink_new_flags.in: Likewise. Co-authored-by: Fabien Siron Co-authored-by: Dmitry V. Levin --- RTM_DELACTION seem use get flags (NLM_F_ROOT) net/sched/act_api.c: static int t

[PATCH v3] netlink: implement generic nlmsg_flags decoding

2017-06-07 Thread JingPiao Chen
* netlink.c: Include "xlat/netlink_get_flags.h", "xlat/netlink_new_flags.h". (decode_nlmsg_flags): New function. (print_nlmsghdr): Use it. * xlat/netlink_get_flags.in: New file. * xlat/netlink_new_flags.in: Likewise. Co-authored-by: Fabien Siron Co-authored-by: Dmitry V. Levin --- Update commit

Re: [PATCH 5/6] netlink: decode "family" field of Netlink GENERIC protocol

2017-06-10 Thread JingPiao Chen
st struct { > static void > decode_nlmsg_type(const uint16_t type, const unsigned int family) > { > + if (!nlmsg_types [NETLINK_GENERIC].xlat) > + nlmsg_types [NETLINK_GENERIC].xlat = genl_families_xlat

Re: [PATCH 6/6] tests: add check for decoding family field of netlink GENERIC protocol

2017-06-10 Thread JingPiao Chen
YAMATO Missing tests/.gitignore. -- JingPiao Chen -- Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot __

[PATCH] tests: fix typo

2017-06-12 Thread JingPiao Chen
* dup3.c (SKIP_MAIN_UNDEFINED): Remove duplicated &&. --- tests/dup3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/dup3.c b/tests/dup3.c index 252e846..7a65b61 100644 --- a/tests/dup3.c +++ b/tests/dup3.c @@ -23,6 +23,6 @@ main(void) #else -SKIP_MAIN_UNDEFINED("_

[PATCH v2] tests: fix typo

2017-06-12 Thread JingPiao Chen
* tests/dup3.c (SKIP_MAIN_UNDEFINED): Remove repeated &&. --- Update commit message tests/dup3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/dup3.c b/tests/dup3.c index 252e846..7a65b61 100644 --- a/tests/dup3.c +++ b/tests/dup3.c @@ -23,6 +23,6 @@ main(void) #els

Re: [PATCH] netlink: add a basic netlink socket diag parser

2017-06-13 Thread JingPiao Chen
e than a switch statement where every case is a function call. > > I've pushed 3 commits to ldv/netlink that demonstrate my idea of netlink > family specific payload decoders, please have a look. Ok, I will update my code as soon as possible and send to ma

Re: [PATCH] tests: check decoding of NETLINK_SOCK_DIAG AF_UNIX messages

2017-06-13 Thread JingPiao Chen
%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {family=AF_UNIX, %p}}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, NLMSG_HDRLEN + (unsigned int) sizeof(*msg), + NLMSG_DATA(nlh) + 1, + NLMSG_HDRLEN + (unsigned int) sizeo

[PATCH 7/8] netlink: add a basic socket diag parser of AF_SMC messages

2017-06-13 Thread JingPiao Chen
* linux/smc_diag.h: New file. * Makefile.am (EXTRA_DIST): Add linux/smc_diag.h. * netlink_sock_diag.c: Include , "xlat/smc_diag_extended_flags.h" and "xlat/smc_states.h". (decode_smc_diag_req, decode_smc_diag_msg): New functions. (diag_decoders): Add AF_SMC. * xlat/smc_diag_extended_flags.in: New f

[PATCH 6/8] tests: check decoding of NETLINK_SOCK_DIAG AF_INET messages

2017-06-13 Thread JingPiao Chen
* tests/netlink_sock_diag.c: Include and . (test_inet_diag_req, test_inet_diag_req_v2) (test_inet_diag_msg): New functions. (mian): Use them. Co-authored-by: Fabien Siron --- tests/netlink_sock_diag.c | 397 ++ 1 file changed, 397 insertions(+) diff

[PATCH 2/8] tests: check decoding of NETLINK_SOCK_DIAG AF_NETLINK messages

2017-06-13 Thread JingPiao Chen
* tests/netlink_sock_diag.c: Include . (test_netlink_diag_req, test_netlink_diag_msg): New functions. (main): Use them. Co-authored-by: Fabien Siron --- tests/netlink_sock_diag.c | 242 ++ 1 file changed, 242 insertions(+) diff --git a/tests/netlink_s

[PATCH 5/8] netlink: add a basic socket diag parser of AF_INET messages

2017-06-13 Thread JingPiao Chen
* defs.h (inet_protocols): New xlat prototype. * linux/inet_diag.h (inet_diag_req): New structure. (INET_DIAG_*): New enum. * netlink_sock_diag.c: Include , and "xlat/inet_diag_extended_flags.h". (print_inet_diag_sockid, decode_inet_diag_req_compat) (decode_inet_diag_req_v2, decode_inet_diag_req)

[PATCH 4/8] tests: check decoding of NETLINK_SOCK_DIAG AF_PACKET messages

2017-06-13 Thread JingPiao Chen
* tests/netlink_sock_diag.c: Include and . (test_packet_diag_req, test_packet_diag_msg): New functions. (main): Use them. Co-authored-by: Fabien Siron --- tests/netlink_sock_diag.c | 240 ++ 1 file changed, 240 insertions(+) diff --git a/tests/netlin

[PATCH 8/8] tests: check decoding of NETLINK_SOCK_DIAG AF_SMC messages

2017-06-13 Thread JingPiao Chen
* tests/netlink_sock_diag.c: Include and . (test_smc_diag_req, test_smc_diag_msg): New functions. (main): Use them. --- tests/netlink_sock_diag.c | 266 ++ 1 file changed, 266 insertions(+) diff --git a/tests/netlink_sock_diag.c b/tests/netlink_sock_di

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

2017-06-13 Thread JingPiao Chen
* linux/netlink_diag.h (NDIAG_SHOW_GROUPS) (NDIAG_SHOW_RING_CFG): New macros. * netlink_sock_diag.c: Include , "xlat/netlink_diag_show.h" and "xlat/netlink_states.h". (decode_netlink_diag_req, decode_netlink_diag_msg): New functions. (diag_decoders): Add AF_NETLINK. * xlat/netlink_diag_show.in: New

[PATCH 3/8] netlink: add a basic socket diag parser of AF_PACKET messages

2017-06-13 Thread JingPiao Chen
* linux/packet_diag.h: New file. * Makefile.am (EXTRA_DIST): Add linux/packet_diag.h. * defs.h (ethernet_protocols): New xlat prototype. * netlink_sock_diag.c: Include and "xlat/packet_diag_show.h". (decode_packet_diag_req, decode_packet_diag_msg): New functions. (diag_decoders): Add AF_PACKET. *

Re: [PATCH] tests: check decoding of NETLINK_SOCK_DIAG AF_UNIX messages

2017-06-13 Thread JingPiao Chen
On Tue, Jun 13, 2017 at 07:10:13PM +0300, Dmitry V. Levin wrote: > On Tue, Jun 13, 2017 at 07:04:21PM +0800, JingPiao Chen wrote: > > +static void > > +test_unix_diag_req(const int fd) > > +{ > > ... > > + /* short read of unix_diag_req */ > > + nlh = nlh0

Re: [PATCH] tests: check decoding of NETLINK_SOCK_DIAG AF_UNIX messages

2017-06-13 Thread JingPiao Chen
On Wed, Jun 14, 2017 at 05:06:06AM +0300, Dmitry V. Levin wrote: > On Wed, Jun 14, 2017 at 03:19:46AM +0300, Dmitry V. Levin wrote: > > On Wed, Jun 14, 2017 at 07:49:34AM +0800, JingPiao Chen wrote: > > > On Tue, Jun 13, 2017 at 07:10:13PM +0300, Dmitry V. Levin wrote: > >

[PATCH] tests: enhance printstr decode check

2017-06-13 Thread JingPiao Chen
* tests/printstr.c: Add a case for room < DEFAULT_STRLEN + 1. --- tests/printstr.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/printstr.c b/tests/printstr.c index 330234f..035ce9c 100644 --- a/tests/printstr.c +++ b/tests/printstr.c @@ -40,7 +40,7 @@ int main(v

Re: [PATCH] tests: check decoding of NETLINK_SOCK_DIAG AF_UNIX messages

2017-06-14 Thread JingPiao Chen
2017-06-14 12:35 GMT+08:00 Dmitry V. Levin : > On Wed, Jun 14, 2017 at 11:53:02AM +0800, JingPiao Chen wrote: > > On Wed, Jun 14, 2017 at 05:06:06AM +0300, Dmitry V. Levin wrote: > > > On Wed, Jun 14, 2017 at 03:19:46AM +0300, Dmitry V. Levin wrote: > > > > On Wed, Ju

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

2017-06-14 Thread JingPiao Chen
On Tue, Jun 13, 2017 at 11:47:45PM +0300, Dmitry V. Levin wrote: > On Tue, Jun 13, 2017 at 10:13:24PM +0800, JingPiao Chen wrote: [...] > > +#ifdef AF_SMC > > +static bool > > +decode_smc_diag_req(struct tcb *const tcp, > > +const struct nlmsghdr *const nlmsghdr, &g

  1   2   3   4   5   6   >