lkml.org 
[lkml]   [2019]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv2 7/8] arm64: implement ftrace with regs
On Fri, 15 Nov 2019 07:05:39 +0900
Itaru Kitayama <itaru.kitayama@gmail.com> wrote:

> Is this feature avail even when building kernel with Clang?

If your compiler can ...

[...]
> > compiler insert a configurable number of NOPs between the function
> > entry point and the usual prologue. This also ensures functions are
> > AAPCS compliant (e.g. disabling inter-procedural register
> > allocation).
> >
> > For example, with -fpatchable-function-entry=2, GCC 8.1.0 compiles
> > the following:
> >
> > | unsigned long bar(void);
> > |
> > | unsigned long foo(void)
> > | {
> > | return bar() + 1;
> > | }
> >
> > ... to:
> >
> > | <foo>:
> > | nop
> > | nop
> > | stp x29, x30, [sp, #-16]!

* insert e.g. 2 NOPs
* record all those locations in a section called
"patchable_function_entries"
* stick to the AAPCS

then: yes. So far I only implemented this for gcc.

Torsten

\
 
 \ /
  Last update: 2019-11-15 08:46    [W:0.265 / U:11.648 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site