<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <blockquote
cite="mid:CAL+pkpfAU1UisMgc_nH0RYpHfoxB9f7ORoXk44cDNwjmj2QHmw@mail.gmail.com"
      type="cite">
      <div class="gmail_quote">c)lets say for a program a.c i use gcc -S
        a.c ...do we have some other command to generate <br>
        somewhat more clear assembly code, may be with some comments in
        english <br>
        <br>
      </div>
    </blockquote>
    Not sure if this is of any help, but the kernel build system (no
    idea how to do this for user space programs) offers to generate a
    listing that interleaves the c code into assembly making it better
    readable. So if your function is e.g. in kernel/rtmutex.c you could
    do the following:<br>
    <br>
    andi@PC63:~/working_git/linux-next$ make kernel/rtmutex.lst<br>
    &nbsp; SYSHDR&nbsp;
    arch/x86/syscalls/../include/generated/uapi/asm/unistd_32.h<br>
    &nbsp; SYSHDR&nbsp;
    arch/x86/syscalls/../include/generated/uapi/asm/unistd_64.h<br>
    &lt;SNIP&gt;<br>
    &nbsp; HOSTCC&nbsp; scripts/asn1_compiler<br>
    &nbsp; MKLST&nbsp;&nbsp; kernel/rtmutex.lst<br>
    No System.map<br>
    andi@PC63:~/working_git/linux-next$ <br>
    <br>
    here is one function from the resulting rtmutex.lst file:<br>
    <br>
    static void fixup_rt_mutex_waiters(struct rt_mutex *lock)<br>
    {<br>
    &nbsp; 70:&nbsp;&nbsp;&nbsp; e8 00 00 00 00&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; callq&nbsp; 75
    &lt;fixup_rt_mutex_waiters+0x5&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; 71: R_X86_64_PC32&nbsp;&nbsp;&nbsp;
    __fentry__+0xfffffffffffffffc<br>
    &nbs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sp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; if
    (!rt_mutex_has_waiters(lock))<br>
    &nbsp; 84:&nbsp;&nbsp;&nbsp; e8 8e ff ff ff&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; callq&nbsp; 17
    &lt;rt_mutex_has_waiters&gt;<br>
    &nbsp; 89:&nbsp;&nbsp;&nbsp; 48 ff 05 00 00 00 00 &nbsp;&nbsp;&nbsp; incq&nbsp;&nbsp; 0x0(%rip)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # 90
    &lt;fixup_rt_mutex_waiters+0x20&gt;<br>
    &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 8c: R_X86_64_PC32&nbsp;&nbsp;&nbsp; .bss+0x704<br>
    &nbsp; 90:&nbsp;&nbsp;&nbsp; 85 c0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; test&nbsp;&nbsp; %eax,%eax<br>
    &nbsp; 92:&nbsp;&nbsp;&nbsp; 75 0c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; jne&nbsp;&nbsp;&nbsp; a0
    &lt;fixup_rt_mutex_waiters+0x30&gt;<br>
    }<br>
    <br>
    btw. you can for example generate the pre-processed code in the same
    way:<br>
    <br>
    andi@PC63:~/working_git/linux-next$ make kernel/rtmutex.i<br>
    <br>
    or the assembly code:<br>
    <br>
    andi@PC63:~/working_git/linux-next$ make kernel/rtmutex.s<br>
    <br>
    this is especially helpful, as it also contains a list of all the
    flags used for compiling.<br>
    <br>
    regards,<br>
    andi<br>
    <br>
    <br>
    <blockquote
cite="mid:CAL+pkpfAU1UisMgc_nH0RYpHfoxB9f7ORoXk44cDNwjmj2QHmw@mail.gmail.com"
      type="cite">
      <div class="gmail_quote">Any kind of help in understanding this
        will be appreciated ..<br>
        <br>
        Thanks<span class="HOEnZb"><font color="#888888"><br>
            Nidhi<br>
            <br>
            <br>
          </font></span></div>
      <br>
      <br clear="all">
      <br>
      -- <br>
      Thanks &amp; Regards <br>
      Nidhi Mittal Hada<br>
      <br>
      <a moz-do-not-send="true"
        href="http://nidhi-searchingmyself.blogspot.com/"
        target="_blank">http://nidhi-searchingmyself.blogspot.com/</a><br>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Kernelnewbies mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a>
<a class="moz-txt-link-freetext" href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>