<div dir="ltr">The output we see when we run lets say strace -e trace=open <program> which will list all the open syscalls performed in the program. Now as per README-linux-ptrace (if i interpreted it correctly) when tracee is ptrace-stop the necessary information which we are getting as output is extracted by ptrace(PTRACE_*,pid,...,...)  and this extracted information is somehow directed towards its specific decoder in this example open.c and then the decoders in the open.c are responsible for printing out the information.Am i correct with the flow? <br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 6, 2017 at 8:32 PM, Rishi Bhatt <span dir="ltr"><<a href="mailto:bhatt.rishi062@gmail.com" target="_blank">bhatt.rishi062@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Thanks,<br></div>It helped me to where to look for answers i got a better idea now how a -e trace=option works,And i see many *.c files which have these SYS_FUNC() in them what are these files for?<br></div><br>Thanks,<br></div>Rishi<br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Mar 4, 2017 at 10:58 PM, Eugene Syromyatnikov <span dir="ltr"><<a href="mailto:evgsyr@gmail.com" target="_blank">evgsyr@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On Sat, Mar 4, 2017 at 5:15 PM, Rishi Bhatt <<a href="mailto:bhatt.rishi062@gmail.com" target="_blank">bhatt.rishi062@gmail.com</a>> wrote:<br>
> Thanks ldv,<br>
> I have read the man pages and got basic idea about strace.Now where should i<br>
> start understanding the code?The codebase is so big i dont know where to<br>
> start.<br>
</span>The core is strace.c and syscall.c (mostly). Take a look at some<br>
simple (umask.c, readahead.c, mount.c) and not so simple (time.c,<br>
ioctl.c, net.c, signal.c, ipc.c) decoders. You can look at some tests<br>
then, like umask, or aio, or sendmmsg, or btrfs. util.c contains<br>
various utility functions, defs.h contains various utility macros and<br>
inlines. linux directory contains various (mostly<br>
architecture-specific) system definitions which are preferred to be<br>
part of strace codebase. linux/*/syscallent.h contains wirings for<br>
syscalls. xlat directory contains sources for generation of symbolic<br>
constant headers.<br>
<div class="m_5752407536054571199HOEnZb"><div class="m_5752407536054571199h5"><br>
> On Sat, Mar 4, 2017 at 4:25 AM, Dmitry V. Levin <<a href="mailto:ldv@altlinux.org" target="_blank">ldv@altlinux.org</a>> wrote:<br>
>><br>
>> Hi,<br>
>><br>
>> On Fri, Mar 03, 2017 at 11:55:33PM +0530, Rishi Bhatt wrote:<br>
>> > Hi ldv,<br>
>> > thanks for the reply i have build the strace  source-code and when i<br>
>> > was building it it skipped 50 test cases. So do you know why that<br>
>> > happened? or is it the  matter that i should look into?<br>
>><br>
>> Why skipped or why 50?<br>
>><br>
>> A test can be skipped if<br>
>> - it is not applicable for the architecture being tested, for example,<br>
>>   the test is for a syscall that is not inplemented for this architecture;<br>
>> - the test framework doesn't support the test, for example, a kernel<br>
>>   module is not loaded, or the filesystem is not capable, etc.<br>
>><br>
>> Currently there are two architectures where exactly 50 tests are skipped:<br>
>> - native x86_64;<br>
>> - native sparc64.<br>
>><br>
>> I bet sparc64 is not your case, so you must be running the test suite<br>
>> natively on x86_64.<br>
>><br>
>> > And can you guide me where should i start to know about -e trace=class?<br>
>><br>
>> I think the best is to start with reading the manual page, then look<br>
>> at the code to understand how it's implemented.  As soon as you've<br>
>> understood the implementation, it's easy to extend.<br>
>><br>
><br>
>><br>
>> --<br>
>> ldv<br>
>><br>
>><br>
>> ------------------------------<wbr>------------------------------<wbr>------------------<br>
>> Check out the vibrant tech community on one of the world's most<br>
>> engaging tech sites, SlashDot.org! <a href="http://sdm.link/slashdot" rel="noreferrer" target="_blank">http://sdm.link/slashdot</a><br>
>> ______________________________<wbr>_________________<br>
>> Strace-devel mailing list<br>
>> <a href="mailto:Strace-devel@lists.sourceforge.net" target="_blank">Strace-devel@lists.sourceforge<wbr>.net</a><br>
>> <a href="https://lists.sourceforge.net/lists/listinfo/strace-devel" rel="noreferrer" target="_blank">https://lists.sourceforge.net/<wbr>lists/listinfo/strace-devel</a><br>
>><br>
><br>
><br>
> ------------------------------<wbr>------------------------------<wbr>------------------<br>
> Check out the vibrant tech community on one of the world's most<br>
> engaging tech sites, SlashDot.org! <a href="http://sdm.link/slashdot" rel="noreferrer" target="_blank">http://sdm.link/slashdot</a><br>
> ______________________________<wbr>_________________<br>
> Strace-devel mailing list<br>
> <a href="mailto:Strace-devel@lists.sourceforge.net" target="_blank">Strace-devel@lists.sourceforge<wbr>.net</a><br>
> <a href="https://lists.sourceforge.net/lists/listinfo/strace-devel" rel="noreferrer" target="_blank">https://lists.sourceforge.net/<wbr>lists/listinfo/strace-devel</a><br>
><br>
<br>
<br>
<br>
</div></div><span class="m_5752407536054571199HOEnZb"><font color="#888888">--<br>
Eugene Syromyatnikov<br>
mailto:<a href="mailto:evgsyr@gmail.com" target="_blank">evgsyr@gmail.com</a><br>
xmpp:esyr@jabber.{ru|org}<br>
</font></span><div class="m_5752407536054571199HOEnZb"><div class="m_5752407536054571199h5"><br>
------------------------------<wbr>------------------------------<wbr>------------------<br>
Check out the vibrant tech community on one of the world's most<br>
engaging tech sites, SlashDot.org! <a href="http://sdm.link/slashdot" rel="noreferrer" target="_blank">http://sdm.link/slashdot</a><br>
______________________________<wbr>_________________<br>
Strace-devel mailing list<br>
<a href="mailto:Strace-devel@lists.sourceforge.net" target="_blank">Strace-devel@lists.sourceforge<wbr>.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/strace-devel" rel="noreferrer" target="_blank">https://lists.sourceforge.net/<wbr>lists/listinfo/strace-devel</a><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>