Re: strace -f -c segfaults if I pthread_create and fcntl(F_GETFL)

2014-07-21 Thread D Wang
On Sat, Jul 19, 2014 at 5:02 AM, yangmin zhu wrote: > Hi wang, > > On Fri, Jul 18, 2014 at 7:11 AM, D Wang wrote: >> (Please copy dw...@janestreet.com on reply, as I am not subscribed to the >> list.) >> >> >> What's going wrong? Is there any workaround? If not, is this >> something you would

[GSOC 2014][PATCH 1/7] JSON: Import the basic JSON output framework

2014-07-21 Thread Zhu YangMin
The JSON output format is used to make it easier for other program to parse strace's results. We need to modify the existing code to use this basic framework to support the JSON output. * defs.h: Add the interface of the JSON output framework. * json.c(newfile): The Implmentation of JSON output fr

[GSOC 2014] Add JSON support for strace

2014-07-21 Thread yangmin zhu
Hi all, I had cleaned my patch and here I send them here for a discussion. Patch list: 0001-JSON-Import-the-basic-JSON-output-framework.patch 0002-JSON-Add-j-option-to-support-JSON-output.patch 0003-JSON-Add-support-for-syscalls-in-io.c.patch 0004-JSON-Add-support-to-entering-exiting-of-syscall.pa

[GSOC 2014][PATCH 6/7] JSON: Add test case for syscalls in io.c

2014-07-21 Thread Zhu YangMin
A special test file for syscalls in io.c, I tried to make the trace results as stable as each time we execute the program. * test/.gitignore: Add json_io. * test/.Makefile: Add json_io.c to compile list. * test/json_io.c(newfile): contain test cases for syscalls in io.c, The only random number wou

[GSOC 2014][PATCH 4/7] JSON: Add support to entering/exiting of syscall

2014-07-21 Thread Zhu YangMin
Each syscall in the output will be a object in a single line. The object has at least 3 attributes:"type", "name", "args" and "ret". the vaule of "args" is an array and the output now only support string as the basic value. * syscall.c (trace_syscall_entering, trace_syscall_exiting): Add support

[GSOC 2014][PATCH 2/7] JSON: Add '-j' option to support JSON output

2014-07-21 Thread Zhu YangMin
Modify strace to use the JSON framework. * Makefile.am: Add json.c to compile list. * strace.c(tprintf, tprints, usage, init): Add a new option '-j' in init(), Modify tprintf/tprints to use the basic JSON framework, Add 2 new function:_tprintf/_tprints for the original output. * strace.1: Add docu

[GSOC 2014][PATCH 5/7] JSON: Add basic test support for JSON framework

2014-07-21 Thread Zhu YangMin
We will do 3 compare to check the output: 1) Compare the Unmodified strace output to the Normal outputs; 2) Compare the JSON parsed results to the Normal outputs(ignore space); 3) Compare the JSON parsed results to the Unmodified strace outputs(ignore space); The 1st comparison should be identica

[GSOC 2014][PATCH 3/7] JSON: Add support for syscalls in io.c

2014-07-21 Thread Zhu YangMin
Modify all the syscalls in io.c to support JSON output. There are mainly two kind modification to strace: 1) simply modify sys_* functions to use the JSON framework; 2) modify those format/detail funcitons(such as printfd, printlval etc..) to use the JSON framework; * io.c (sys_read/write, sys_rea

[GSOC 2014][PATCH 7/7] JSON: Add support for '+++' signals

2014-07-21 Thread Zhu YangMin
There are only 3 kind of '+++' signals in strace. Note: Currently do NOT support the '/' in JSON format. And this will make the those JSON lines invalid(or you can just ignore these lines). Need to find a way to solve this problem. * process.c(sys_exit): slightly reformat the code. * syscall.c(tra