aboutsummaryrefslogtreecommitdiff
path: root/scripts/recordmcount.pl
diff options
context:
space:
mode:
authorPalmer Dabbelt <palmer@sifive.com>2018-04-02 20:30:49 -0700
committerPalmer Dabbelt <palmer@sifive.com>2018-04-02 20:30:49 -0700
commit1cead2d7fec53a8d385934caefcf5dbb1b7d778b (patch)
treef62b6429a1853e0d9627733a2f9ea7b4baeed937 /scripts/recordmcount.pl
parent0adb32858b0bddf4ada5f364a84ed60b196dbcda (diff)
parentb785ec129bd9498ecd6e221e45820b00c6ed4adf (diff)
RISC-V: Add dynamic ftrace support for RISC-V platforms
This patch set includes the building blocks of dynamic ftrace features for RISC-V machines. I'm afraid I'm not very familiar with ftrace, but the code looks OK to me. It's been used to track down a performance problem in our SPI driver and appears to work acceptably, but we haven't given it a whole lot of banging yet so there might still be some bugs lurking around somewhere.
Diffstat (limited to 'scripts/recordmcount.pl')
-rwxr-xr-xscripts/recordmcount.pl5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
index 2033af758173..d44d55db7c06 100755
--- a/scripts/recordmcount.pl
+++ b/scripts/recordmcount.pl
@@ -376,6 +376,11 @@ if ($arch eq "x86_64") {
$mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s__mcount\$";
$type = ".quad";
$alignment = 8;
+} elsif ($arch eq "riscv") {
+ $function_regex = "^([0-9a-fA-F]+)\\s+<([^.0-9][0-9a-zA-Z_\\.]+)>:";
+ $mcount_regex = "^\\s*([0-9a-fA-F]+):\\sR_RISCV_CALL\\s_mcount\$";
+ $type = ".quad";
+ $alignment = 2;
} else {
die "Arch $arch is not supported with CONFIG_FTRACE_MCOUNT_RECORD";
}