<div dir="ltr"><div class="gmail_quote"><br><div dir="ltr">hi <br><h3 class=""><span name="Dmitry V. Levin" class="">Dmitry V. Levin</span></h3><div> i grep the code of strace 4.10 in and out for this project. This is what all i got for this project:</div><div>we don't need to change the tprintf and tprints calls, we only need to slightly change their definition.</div><div>My idea for this project:</div><div>1) crate one global char buffer in strace.c</div><div>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</div><div>3) one JsonFormatter which converts and writes our string in json format</div><div><br></div><div>example :</div><div>JsonFormatter(execve( current_tcp->outf ,"\"./a.out", ["./a.out"], [/* 80 vars */]) = 0" , sizeOfBuffer)</div><div><br></div><div>will write </div><div><div>{</div><div> "Function" : execve</div><div> "Arguments" : ("./a.out", ["./a.out"], [/* 80 vars */])</div><div> "Return" : 0</div><div>}</div></div><div><br></div><div>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</div><div><br></div><div>if (trace_syscall(tcp) < 0) </div><div>{</div><div><span style="white-space:pre-wrap"> </span>return true;</div><div>}</div><div>if(json flag set && alternate flag is set)</div><div>{</div><div> JsonFormatter(current_tcp->outf, char buffer,sizeof buffer);</div><div> clear buffer;</div><div>}</div><div><div>restart_tracee_with_sig_0:</div><div><span style="white-space:pre-wrap"> </span>sig = 0;</div></div><div><br></div><div><br></div><div><br></div><div>i guess , this will work </div><div>plz correct me if have mentioned anything wrong</div><div><br></div><div>thank you</div><span class=""><font color="#888888"><div><br></div><div>Amish Mittal<br><br></div><div>waiting for your reply to start working on this idea<br></div></font></span></div>
</div><br></div>