diff options
author | Guo Ren <ren_guo@c-sky.com> | 2019-03-01 01:50:36 +0100 |
---|---|---|
committer | Guo Ren <ren_guo@c-sky.com> | 2019-04-22 07:44:57 +0200 |
commit | 28bb030f93334495ddc64ade0bff18721bf7023d (patch) | |
tree | d0a4e4eaa36575adf490165f63d2bd6160653124 /scripts/recordmcount.pl | |
parent | csky: Fixup vdsp&fpu issues in kernel (diff) | |
download | linux-28bb030f93334495ddc64ade0bff18721bf7023d.tar.xz linux-28bb030f93334495ddc64ade0bff18721bf7023d.zip |
csky/ftrace: Add dynamic function tracer (include graph tracer)
Support dynamic ftrace including dynamic graph tracer. Gcc-csky with -pg
will produce call site in every function prologue and we can use these
call site to hook trace function.
gcc with -pg origin call site:
push lr
jbsr _mcount
nop32
nop32
If the (callee - caller)'s offset is in range of bsr instruction, we'll
modify code with:
push lr
bsr _mcount
nop32
nop32
Else if the (callee - caller)'s offset is out of bsr instrunction, we'll
modify code with:
push lr
movih r26, ...
ori r26, ...
jsr r26
(r26 is reserved for jsr link reg in csky abiv2 spec.)
Signed-off-by: Guo Ren <ren_guo@c-sky.com>
Diffstat (limited to 'scripts/recordmcount.pl')
-rwxr-xr-x | scripts/recordmcount.pl | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl index 68841d01162c..f71666899245 100755 --- a/scripts/recordmcount.pl +++ b/scripts/recordmcount.pl @@ -397,6 +397,9 @@ if ($arch eq "x86_64") { } elsif ($arch eq "nds32") { $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_NDS32_HI20_RELA\\s+_mcount\$"; $alignment = 2; +} elsif ($arch eq "csky") { + $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_CKCORE_PCREL_JSR_IMM26BY2\\s+_mcount\$"; + $alignment = 2; } else { die "Arch $arch is not supported with CONFIG_FTRACE_MCOUNT_RECORD"; } |