GSOC 2015 : Structured Output
Amish Mittal
amishmittal12 at gmail.com
Sun Mar 8 21:48:05 UTC 2015
hi all
i grep the code of strace 4.10 in and out for this project. This is
what all i got for this project:
we don't need to change the tprintf and tprints calls, we only need to
slightly change their definition.
My idea for this project:
1) crate one global char buffer in strace.c
2) if json flag is set then tprintf and tprints will not print write
anything in current_tcp->outf , they will just write the whole string in
our char buffer
3) one JsonFormatter which converts and writes our string in json format
example :
JsonFormatter(execve( current_tcp->outf ,"\"./a.out", ["./a.out"], [/* 80
vars */]) = 0" , sizeOfBuffer)
will write
{
"Function" : execve
"Arguments" : ("./a.out", ["./a.out"], [/* 80 vars */])
"Return" : 0
}
we will call JsonFormatter function ALTERNATE ,so that we have full
information(entering and exiting) one syscall in our buffer, in strace.c in
trace() function definition , exact location is given below
if (trace_syscall(tcp) < 0)
{
return true;
}
if(json flag set && alternate flag is set)
{
JsonFormatter(current_tcp->outf, char buffer,sizeof buffer);
clear buffer;
}
restart_tracee_with_sig_0:
sig = 0;
i guess , this will work
plz correct me if have mentioned anything wrong
thank you
Amish Mittal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20150309/6ffae041/attachment.html>
More information about the Strace-devel
mailing list