linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/1] support ftrace and -ffunction-sections
@ 2018-11-20 20:19 Joe Lawrence
  2018-11-20 20:19 ` [RFC PATCH 1/1] scripts/recordmcount.{c,pl}: support -ffunction-sections .text.* section names Joe Lawrence
  2018-11-27 20:27 ` [RFC PATCH 0/1] support ftrace and -ffunction-sections Joe Lawrence
  0 siblings, 2 replies; 5+ messages in thread
From: Joe Lawrence @ 2018-11-20 20:19 UTC (permalink / raw)
  To: linux-kernel; +Cc: Steven Rostedt, Masahiro Yamada

Hi Steve,

I noticed that ftrace does not currently support functions built with
the -ffunction-sections option as they end up in .text.<function_name>
ELF sections, never making into the __mcount_loc section.

I modified the recordmcount scripts to handle such .text. section
prefixes and this appears to work on x86_64, ppc64le, and s390x -- at
least for simple modules, including the "Test trace_printk from module"
ftrace self-test. 

That said, I did notice 90ad4052e85c ("kbuild: avoid conflict between
-ffunction-sections and -pg on gcc-4.7") which indicates that the kernel
still supports versions of gcc which may not play well with ftrace and
-ffunction-sections.

With that limitation in mind, can we support ftracing of functions in
such sections for compiler versions that do support it? (fwiw, gcc
v4.8.5 seems happy)  And then if so, what additional testing or coding
would need to be done to be confident that it is safe?  Is matching on
".text.*" too inclusive?

Thanks,

-- Joe


Joe Lawrence (1):
  scripts/recordmcount.{c,pl}: support -ffunction-sections .text.*
    section names

 scripts/recordmcount.c  |  2 +-
 scripts/recordmcount.pl | 13 +++++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

-- 
1.8.3.1


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

end of thread, other threads:[~2018-11-28 14:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-20 20:19 [RFC PATCH 0/1] support ftrace and -ffunction-sections Joe Lawrence
2018-11-20 20:19 ` [RFC PATCH 1/1] scripts/recordmcount.{c,pl}: support -ffunction-sections .text.* section names Joe Lawrence
2018-11-27 20:27 ` [RFC PATCH 0/1] support ftrace and -ffunction-sections Joe Lawrence
2018-11-28  2:09   ` Steven Rostedt
2018-11-28 14:59     ` Joe Lawrence

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).