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
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel