the cost of inlining?

Max Filippov jcmvbkbc at gmail.com
Fri Dec 5 22:25:06 EST 2014


On Fri, Dec 5, 2014 at 4:32 AM, Jeff Haran <Jeff.Haran at citrix.com> wrote:
> Disassembly of section .text:
>
> 0000000000000000 <samp_atomic_read>:
> #include <asm/atomic.h>
> #include <asm/system.h>
>
> int samp_atomic_read(atomic_t *v)
> {
>    0:   55                      push   rbp
>    1:   48 89 e5                mov    rbp,rsp
>    4:   e8 00 00 00 00          call   9 <samp_atomic_read+0x9>
>  *
>  * Atomically reads the value of @v.
>  */
> static inline int atomic_read(const atomic_t *v)
> {
>         return v->counter;
>    9:   8b 07                   mov    eax,DWORD PTR [rdi]
>     int val;
>
>         val = atomic_read(v);
>         return val;
> }
>    b:   c9                      leave
>    c:   c3                      ret
>    d:   90                      nop
>    e:   90                      nop
>    f:   90                      nop

[...]

> But what is that call instruction at offset 4 for?

Looks like you have ftrace enabled in your kernel config, and this call is
a call to _mcount.

-- 
Thanks.
-- Max



More information about the Kernelnewbies mailing list