kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* inline keyword
@ 2016-03-11 18:39 Wenda Ni
  2016-03-11 18:47 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Wenda Ni @ 2016-03-11 18:39 UTC (permalink / raw)
  To: kernelnewbies

Hi all,

For a function that is defined static but without an explicit "inline"
keyword, is there a possibility that compiler will optimize it to be a
static inline function?

We observe that some of the functions defined as static but not "inline" in
in modules are not present in kernel system table, i.e., can not be found
in /proc/kallsysms.

Correct me if I am wrong.



Cheers,

Wenda Ni, Ph.D.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20160311/12695e7f/attachment.html 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* inline keyword
  2016-03-11 18:39 inline keyword Wenda Ni
@ 2016-03-11 18:47 ` Greg KH
  2016-03-13  8:40   ` Nicholas Mc Guire
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2016-03-11 18:47 UTC (permalink / raw)
  To: kernelnewbies

On Fri, Mar 11, 2016 at 01:39:53PM -0500, Wenda Ni wrote:
> Hi all,
> 
> For a function that is defined static but without an explicit "inline" keyword,
> is there a possibility that compiler will optimize it to be a static inline
> function?

Yes there is.

> We observe that some of the functions defined as static but not "inline" in in
> modules are not present in kernel system table, i.e., can not be found in /proc
> /kallsysms.

The symbols do not need to be in the symbol table if they are static to
the file, the compiler can just drop them as no one else needs to care
about them.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

* inline keyword
  2016-03-11 18:47 ` Greg KH
@ 2016-03-13  8:40   ` Nicholas Mc Guire
  0 siblings, 0 replies; 3+ messages in thread
From: Nicholas Mc Guire @ 2016-03-13  8:40 UTC (permalink / raw)
  To: kernelnewbies

On Fri, Mar 11, 2016 at 10:47:27AM -0800, Greg KH wrote:
> On Fri, Mar 11, 2016 at 01:39:53PM -0500, Wenda Ni wrote:
> > Hi all,
> > 
> > For a function that is defined static but without an explicit "inline" keyword,
> > is there a possibility that compiler will optimize it to be a static inline
> > function?
> 
> Yes there is.
>
see -finline-small-functions/-finline-functions-called-once in the gcc manual,
which are enabled by -O2 but can be controlled via -finline-limit and
-fkeep-inline-functions.

thx!
hofrat

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-13  8:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-11 18:39 inline keyword Wenda Ni
2016-03-11 18:47 ` Greg KH
2016-03-13  8:40   ` Nicholas Mc Guire

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).